@keystrokehq/ramp 0.0.9 → 0.0.15

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 (100) hide show
  1. package/dist/_official/index.d.mts +3 -8
  2. package/dist/_official/index.mjs +1 -1
  3. package/dist/accounting-fields.d.mts +15 -30
  4. package/dist/accounting-fields.mjs +3 -3
  5. package/dist/accounting-gl-accounts.d.mts +7 -14
  6. package/dist/accounting-gl-accounts.mjs +3 -3
  7. package/dist/{accounting-Ceh5QgHA.mjs → accounting-i6txC-MI.mjs} +1 -1
  8. package/dist/accounting-subsidiaries.d.mts +7 -14
  9. package/dist/accounting-subsidiaries.mjs +3 -3
  10. package/dist/accounting-sync.d.mts +7 -14
  11. package/dist/accounting-sync.mjs +3 -3
  12. package/dist/accounting-tracking-categories.d.mts +5 -10
  13. package/dist/accounting-tracking-categories.mjs +3 -3
  14. package/dist/accounting-vendors.d.mts +7 -14
  15. package/dist/accounting-vendors.mjs +3 -3
  16. package/dist/applications.d.mts +8 -13
  17. package/dist/applications.mjs +3 -3
  18. package/dist/{bills-D7vZ5JRH.mjs → bills-B8W9et3K.mjs} +1 -1
  19. package/dist/bills.d.mts +31 -46
  20. package/dist/bills.mjs +3 -3
  21. package/dist/{business-DAD870OI.mjs → business-CztnWUvt.mjs} +1 -1
  22. package/dist/business.d.mts +3 -6
  23. package/dist/business.mjs +2 -2
  24. package/dist/card-programs.d.mts +7 -14
  25. package/dist/card-programs.mjs +3 -3
  26. package/dist/{cards-DNZQtrd7.mjs → cards-BfgPcR38.mjs} +1 -1
  27. package/dist/cards.d.mts +19 -38
  28. package/dist/cards.mjs +4 -4
  29. package/dist/cashbacks.d.mts +5 -10
  30. package/dist/cashbacks.mjs +3 -3
  31. package/dist/client.d.mts +2 -2
  32. package/dist/client.mjs +2 -2
  33. package/dist/connection.d.mts +1 -1
  34. package/dist/connection.mjs +1 -1
  35. package/dist/departments.d.mts +11 -22
  36. package/dist/departments.mjs +3 -3
  37. package/dist/entities.d.mts +5 -10
  38. package/dist/entities.mjs +3 -3
  39. package/dist/events.d.mts +1 -1
  40. package/dist/events.mjs +1 -1
  41. package/dist/{factory-hiMPmrYD.mjs → factory-buRnGG7Q.mjs} +2 -1
  42. package/dist/integration-BhMk85GK.mjs +116 -0
  43. package/dist/{integration-BTjaW9hR.d.mts → integration-DJ7sYLA2.d.mts} +6 -19
  44. package/dist/limits.d.mts +11 -22
  45. package/dist/limits.mjs +3 -3
  46. package/dist/locations.d.mts +11 -22
  47. package/dist/locations.mjs +3 -3
  48. package/dist/memos.d.mts +5 -10
  49. package/dist/memos.mjs +3 -3
  50. package/dist/{new-resources-Cj_YECLc.mjs → new-resources-BBJsJEjT.mjs} +1 -1
  51. package/dist/{organization-BdyZhkYN.mjs → organization-BSaEpvBn.mjs} +1 -1
  52. package/dist/purchase-orders.d.mts +8 -13
  53. package/dist/purchase-orders.mjs +3 -3
  54. package/dist/receipt-integrations.d.mts +5 -10
  55. package/dist/receipt-integrations.mjs +2 -2
  56. package/dist/{receipts-DKq5Kjhr.mjs → receipts-STq41c2M.mjs} +1 -1
  57. package/dist/receipts.d.mts +7 -14
  58. package/dist/receipts.mjs +3 -3
  59. package/dist/{reimbursements--xBvXROu.mjs → reimbursements-OknrZUMF.mjs} +1 -1
  60. package/dist/reimbursements.d.mts +8 -13
  61. package/dist/reimbursements.mjs +3 -3
  62. package/dist/schemas/index.d.mts +3 -3
  63. package/dist/schemas/index.mjs +15 -15
  64. package/dist/spend-programs.d.mts +5 -10
  65. package/dist/spend-programs.mjs +3 -3
  66. package/dist/spend-requests.d.mts +7 -14
  67. package/dist/spend-requests.mjs +3 -3
  68. package/dist/statements.d.mts +5 -10
  69. package/dist/statements.mjs +3 -3
  70. package/dist/{transactions-IIG8obly.mjs → transactions-Djd0oIGK.mjs} +1 -1
  71. package/dist/transactions.d.mts +12 -19
  72. package/dist/transactions.mjs +3 -3
  73. package/dist/{transfers-C-76qq3o.mjs → transfers-WBQZVdGP.mjs} +1 -1
  74. package/dist/transfers.d.mts +11 -16
  75. package/dist/transfers.mjs +3 -3
  76. package/dist/triggers/index.d.mts +3 -3
  77. package/dist/triggers/index.mjs +11 -11
  78. package/dist/unified-requests.d.mts +5 -10
  79. package/dist/unified-requests.mjs +3 -3
  80. package/dist/{users-Bx4SR4el.mjs → users-ufcXrfNK.mjs} +1 -1
  81. package/dist/users.d.mts +13 -26
  82. package/dist/users.mjs +3 -3
  83. package/dist/vendor-bank-accounts.d.mts +11 -22
  84. package/dist/vendor-bank-accounts.mjs +3 -3
  85. package/dist/{vendors-lAh0yain.mjs → vendors-Bx1cgXwC.mjs} +1 -1
  86. package/dist/{vendors-De3fNIYJ.d.mts → vendors-gH-w9b_R.d.mts} +32 -32
  87. package/dist/vendors.d.mts +11 -22
  88. package/dist/vendors.mjs +3 -3
  89. package/dist/verification.mjs +1 -1
  90. package/dist/{webhook-CzjBDCWU.mjs → webhook-CsbvcgrC.mjs} +1 -1
  91. package/dist/{webhooks-mgmt--fU1Uxfa.mjs → webhooks-mgmt-d1xgVpWx.mjs} +1 -1
  92. package/dist/webhooks.d.mts +11 -22
  93. package/dist/webhooks.mjs +3 -3
  94. package/package.json +5 -5
  95. package/dist/dist-Bbp6t-WQ.mjs +0 -74
  96. package/dist/integration-BczMK0aE.mjs +0 -216
  97. /package/dist/{common-Dune7BHS.mjs → common-CUpmNYXw.mjs} +0 -0
  98. /package/dist/{errors-TrirAChI.d.mts → errors-CIJf9-v0.d.mts} +0 -0
  99. /package/dist/{shared-3DudrK5L.mjs → shared-CTTtP5gv.mjs} +0 -0
  100. /package/dist/{webhook-sde3Ui2N.d.mts → webhook-Bp38YQE9.d.mts} +0 -0
@@ -1,6 +1,5 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
1
  import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
3
 
5
4
  //#region src/vendors.d.ts
6
5
  declare const listVendors: _keystrokehq_core0.Operation<z.ZodObject<{
@@ -25,11 +24,9 @@ declare const listVendors: _keystrokehq_core0.Operation<z.ZodObject<{
25
24
  page: z.ZodOptional<z.ZodObject<{
26
25
  next: z.ZodOptional<z.ZodString>;
27
26
  }, z.core.$strip>>;
28
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
27
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
29
28
  RAMP_ACCESS_TOKEN: z.ZodString;
30
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
31
- RAMP_ACCESS_TOKEN: z.ZodString;
32
- }, z.core.$strip>>[] | undefined>], undefined>;
29
+ }, z.core.$strip>>], undefined>;
33
30
  declare const getVendor: _keystrokehq_core0.Operation<z.ZodObject<{
34
31
  vendorId: z.ZodString;
35
32
  }, z.core.$strip>, z.ZodObject<{
@@ -44,11 +41,9 @@ declare const getVendor: _keystrokehq_core0.Operation<z.ZodObject<{
44
41
  address: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
45
42
  created_at: z.ZodOptional<z.ZodString>;
46
43
  updated_at: z.ZodOptional<z.ZodString>;
47
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
48
- RAMP_ACCESS_TOKEN: z.ZodString;
49
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
44
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
50
45
  RAMP_ACCESS_TOKEN: z.ZodString;
51
- }, z.core.$strip>>[] | undefined>], undefined>;
46
+ }, z.core.$strip>>], undefined>;
52
47
  declare const createVendor: _keystrokehq_core0.Operation<z.ZodObject<{
53
48
  name: z.ZodString;
54
49
  email: z.ZodOptional<z.ZodString>;
@@ -71,11 +66,9 @@ declare const createVendor: _keystrokehq_core0.Operation<z.ZodObject<{
71
66
  address: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
72
67
  created_at: z.ZodOptional<z.ZodString>;
73
68
  updated_at: z.ZodOptional<z.ZodString>;
74
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
69
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
75
70
  RAMP_ACCESS_TOKEN: z.ZodString;
76
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
77
- RAMP_ACCESS_TOKEN: z.ZodString;
78
- }, z.core.$strip>>[] | undefined>], undefined>;
71
+ }, z.core.$strip>>], undefined>;
79
72
  declare const updateVendor: _keystrokehq_core0.Operation<z.ZodObject<{
80
73
  vendorId: z.ZodString;
81
74
  name: z.ZodOptional<z.ZodString>;
@@ -98,19 +91,15 @@ declare const updateVendor: _keystrokehq_core0.Operation<z.ZodObject<{
98
91
  address: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
99
92
  created_at: z.ZodOptional<z.ZodString>;
100
93
  updated_at: z.ZodOptional<z.ZodString>;
101
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
102
- RAMP_ACCESS_TOKEN: z.ZodString;
103
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
94
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
104
95
  RAMP_ACCESS_TOKEN: z.ZodString;
105
- }, z.core.$strip>>[] | undefined>], undefined>;
96
+ }, z.core.$strip>>], undefined>;
106
97
  declare const deleteVendor: _keystrokehq_core0.Operation<z.ZodObject<{
107
98
  vendorId: z.ZodString;
108
99
  }, z.core.$strip>, z.ZodObject<{
109
100
  success: z.ZodBoolean;
110
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
111
- RAMP_ACCESS_TOKEN: z.ZodString;
112
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
101
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
113
102
  RAMP_ACCESS_TOKEN: z.ZodString;
114
- }, z.core.$strip>>[] | undefined>], undefined>;
103
+ }, z.core.$strip>>], undefined>;
115
104
  //#endregion
116
105
  export { createVendor, deleteVendor, getVendor, listVendors, updateVendor };
package/dist/vendors.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRampClient } from "./client.mjs";
2
- import { c as rampVendorCreateInputSchema, d as rampVendorListInputSchema, f as rampVendorListSchema, l as rampVendorDeleteInputSchema, m as rampVendorUpdateInputSchema, p as rampVendorSchema, u as rampVendorGetInputSchema } from "./vendors-lAh0yain.mjs";
3
- import { t as rampOperation } from "./factory-hiMPmrYD.mjs";
4
- import { t as omitUndefined } from "./shared-3DudrK5L.mjs";
2
+ import { c as rampVendorCreateInputSchema, d as rampVendorListInputSchema, f as rampVendorListSchema, l as rampVendorDeleteInputSchema, m as rampVendorUpdateInputSchema, p as rampVendorSchema, u as rampVendorGetInputSchema } from "./vendors-Bx1cgXwC.mjs";
3
+ import { t as rampOperation } from "./factory-buRnGG7Q.mjs";
4
+ import { t as omitUndefined } from "./shared-CTTtP5gv.mjs";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/vendors.ts
@@ -1,4 +1,4 @@
1
- import { n as RAMP_WEBHOOK_SIGNATURE_HEADER } from "./webhook-CzjBDCWU.mjs";
1
+ import { n as RAMP_WEBHOOK_SIGNATURE_HEADER } from "./webhook-CsbvcgrC.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
 
4
4
  //#region src/verification.ts
@@ -1,4 +1,4 @@
1
- import { f as rampTimestampSchema, i as rampIdSchema } from "./common-Dune7BHS.mjs";
1
+ import { f as rampTimestampSchema, i as rampIdSchema } from "./common-CUpmNYXw.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/schemas/webhook.ts
@@ -1,4 +1,4 @@
1
- import { a as rampListPaginationInputSchema, f as rampTimestampSchema, i as rampIdSchema, o as rampListResponseSchema } from "./common-Dune7BHS.mjs";
1
+ import { a as rampListPaginationInputSchema, f as rampTimestampSchema, i as rampIdSchema, o as rampListResponseSchema } from "./common-CUpmNYXw.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/schemas/webhooks-mgmt.ts
@@ -1,6 +1,5 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
1
  import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
3
 
5
4
  //#region src/webhooks.d.ts
6
5
  declare const listWebhookSubscriptions: _keystrokehq_core0.Operation<z.ZodObject<{
@@ -18,11 +17,9 @@ declare const listWebhookSubscriptions: _keystrokehq_core0.Operation<z.ZodObject
18
17
  page: z.ZodOptional<z.ZodObject<{
19
18
  next: z.ZodOptional<z.ZodString>;
20
19
  }, z.core.$strip>>;
21
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
20
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
22
21
  RAMP_ACCESS_TOKEN: z.ZodString;
23
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
24
- RAMP_ACCESS_TOKEN: z.ZodString;
25
- }, z.core.$strip>>[] | undefined>], undefined>;
22
+ }, z.core.$strip>>], undefined>;
26
23
  declare const getWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
27
24
  webhookId: z.ZodString;
28
25
  }, z.core.$strip>, z.ZodObject<{
@@ -32,11 +29,9 @@ declare const getWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
32
29
  enabled_events: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
30
  created_at: z.ZodOptional<z.ZodString>;
34
31
  updated_at: z.ZodOptional<z.ZodString>;
35
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
36
- RAMP_ACCESS_TOKEN: z.ZodString;
37
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
32
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
38
33
  RAMP_ACCESS_TOKEN: z.ZodString;
39
- }, z.core.$strip>>[] | undefined>], undefined>;
34
+ }, z.core.$strip>>], undefined>;
40
35
  declare const createWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
41
36
  url: z.ZodString;
42
37
  enabled_events: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -48,11 +43,9 @@ declare const createWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObjec
48
43
  enabled_events: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
44
  created_at: z.ZodOptional<z.ZodString>;
50
45
  updated_at: z.ZodOptional<z.ZodString>;
51
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
46
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
52
47
  RAMP_ACCESS_TOKEN: z.ZodString;
53
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
54
- RAMP_ACCESS_TOKEN: z.ZodString;
55
- }, z.core.$strip>>[] | undefined>], undefined>;
48
+ }, z.core.$strip>>], undefined>;
56
49
  declare const updateWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
57
50
  webhookId: z.ZodString;
58
51
  url: z.ZodOptional<z.ZodString>;
@@ -65,19 +58,15 @@ declare const updateWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObjec
65
58
  enabled_events: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
59
  created_at: z.ZodOptional<z.ZodString>;
67
60
  updated_at: z.ZodOptional<z.ZodString>;
68
- }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
69
- RAMP_ACCESS_TOKEN: z.ZodString;
70
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
61
+ }, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
71
62
  RAMP_ACCESS_TOKEN: z.ZodString;
72
- }, z.core.$strip>>[] | undefined>], undefined>;
63
+ }, z.core.$strip>>], undefined>;
73
64
  declare const deleteWebhookSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
74
65
  webhookId: z.ZodString;
75
66
  }, z.core.$strip>, z.ZodObject<{
76
67
  success: z.ZodBoolean;
77
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"ramp", z.ZodObject<{
78
- RAMP_ACCESS_TOKEN: z.ZodString;
79
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
68
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:ramp", z.ZodObject<{
80
69
  RAMP_ACCESS_TOKEN: z.ZodString;
81
- }, z.core.$strip>>[] | undefined>], undefined>;
70
+ }, z.core.$strip>>], undefined>;
82
71
  //#endregion
83
72
  export { createWebhookSubscription, deleteWebhookSubscription, getWebhookSubscription, listWebhookSubscriptions, updateWebhookSubscription };
package/dist/webhooks.mjs CHANGED
@@ -1,7 +1,7 @@
1
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--fU1Uxfa.mjs";
3
- import { t as rampOperation } from "./factory-hiMPmrYD.mjs";
4
- import { t as omitUndefined } from "./shared-3DudrK5L.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-buRnGG7Q.mjs";
4
+ import { t as omitUndefined } from "./shared-CTTtP5gv.mjs";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/webhooks.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystrokehq/ramp",
3
- "version": "0.0.9",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -176,20 +176,20 @@
176
176
  "LICENSE"
177
177
  ],
178
178
  "dependencies": {
179
+ "@keystrokehq/integration-authoring": "^0.0.9",
179
180
  "zod": "^4.3.6"
180
181
  },
181
182
  "peerDependencies": {
182
- "@keystrokehq/core": ">=0.0.8 <0.1.0"
183
+ "@keystrokehq/core": ">=0.0.13 <0.1.0"
183
184
  },
184
185
  "devDependencies": {
185
186
  "@types/node": "^22.19.11",
186
187
  "tsdown": "^0.20.3",
187
188
  "typescript": "^5.9.3",
188
189
  "vitest": "^4.0.18",
189
- "@keystrokehq/core": "^0.0.12",
190
- "@keystrokehq/typescript-config": "0.0.0",
190
+ "@keystrokehq/core": "^0.0.13",
191
191
  "@keystrokehq/test-utils": "0.0.0",
192
- "@keystrokehq/integration-authoring": "0.0.9"
192
+ "@keystrokehq/typescript-config": "0.0.0"
193
193
  },
194
194
  "keywords": [
195
195
  "ramp",
@@ -1,74 +0,0 @@
1
- import { Operation } from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import { pollingTrigger } from "@keystrokehq/core/trigger";
4
-
5
- //#region ../../packages/integration-authoring/dist/index.mjs
6
- function isThenable(value) {
7
- return !!value && typeof value === "object" && "then" in value && typeof value.then === "function";
8
- }
9
- function createErrorNormalizingProxy(target, normalizeError, path = []) {
10
- return new Proxy(target, { get(obj, property, receiver) {
11
- const value = Reflect.get(obj, property, receiver);
12
- if (typeof value === "function") return (...args) => {
13
- try {
14
- const result = value.apply(obj, args);
15
- if (isThenable(result)) return result.then(void 0, (error) => {
16
- throw normalizeError(error, { methodPath: [...path, String(property)].join(".") });
17
- });
18
- return result;
19
- } catch (error) {
20
- throw normalizeError(error, { methodPath: [...path, String(property)].join(".") });
21
- }
22
- };
23
- if (value && typeof value === "object") return createErrorNormalizingProxy(value, normalizeError, [...path, String(property)]);
24
- return value;
25
- } });
26
- }
27
- const IntegrationConfigSchema = z.object({
28
- id: z.string().min(1),
29
- name: z.string().min(1),
30
- description: z.string().optional()
31
- });
32
- function resolveMetadata(metadata, defaults) {
33
- return {
34
- id: metadata?.id ?? defaults.defaultId,
35
- description: metadata?.description ?? defaults.defaultDescription
36
- };
37
- }
38
- function resolveAuthorPayload(payload, mapPayload) {
39
- if (!mapPayload) return payload;
40
- return mapPayload(payload);
41
- }
42
- function createIntegrationTriggerBindingFactory(config) {
43
- const bind = (options) => {
44
- const resolvedMetadata = resolveMetadata(options, config);
45
- const baseTrigger = config.createBaseTrigger(resolvedMetadata);
46
- const userTransform = options?.transform;
47
- return baseTrigger({ transform: userTransform || config.mapPayload ? (runtimePayload, request) => {
48
- const authorPayload = resolveAuthorPayload(runtimePayload, config.mapPayload);
49
- if (authorPayload === null) throw new Error(`Trigger "${resolvedMetadata.id}" mapPayload returned null after the trigger filter passed; tighten the trigger filter schema.`);
50
- if (!userTransform) return authorPayload;
51
- return userTransform(authorPayload, request);
52
- } : void 0 });
53
- };
54
- return Object.freeze(bind);
55
- }
56
- function createPollingTriggerBindingFactory(config) {
57
- return createIntegrationTriggerBindingFactory({
58
- defaultId: config.defaultId,
59
- defaultDescription: config.defaultDescription,
60
- mapPayload: config.mapPayload,
61
- createBaseTrigger: (metadata) => pollingTrigger({
62
- id: metadata.id,
63
- description: metadata.description,
64
- schedule: config.schedule,
65
- response: config.response,
66
- poll: config.poll,
67
- ...config.credentialSets ? { credentialSets: config.credentialSets } : {},
68
- ...config.filter ? { filter: config.filter } : {}
69
- })
70
- });
71
- }
72
-
73
- //#endregion
74
- export { createPollingTriggerBindingFactory as n, createErrorNormalizingProxy as t };
@@ -1,216 +0,0 @@
1
- import { CredentialSet, Operation } from "@keystrokehq/core";
2
- import { z } from "zod";
3
-
4
- //#region ../../packages/integration-authoring/dist/official/runtime.mjs
5
- const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
6
- function getRegistry() {
7
- const globalStore = globalThis;
8
- if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
9
- return globalStore[REGISTRY_KEY];
10
- }
11
- function registerOfficialOperation(operation, metadata) {
12
- getRegistry().set(operation, Object.freeze({ ...metadata }));
13
- }
14
-
15
- //#endregion
16
- //#region ../../packages/integration-authoring/dist/official/index.mjs
17
- const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
18
- function officialCredentialSetId(id) {
19
- return `${OFFICIAL_CREDENTIAL_SET_ID_PREFIX}${id}`;
20
- }
21
- function stripOfficialCredentialSetIdPrefix(id) {
22
- return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
23
- }
24
- /**
25
- * Creates a factory for Keystroke-official integration operations.
26
- *
27
- * It keeps the same flat `run(input, credentials)` ergonomics as the generic
28
- * operation factory, while registering official metadata for builder/runtime
29
- * operation metadata.
30
- */
31
- function createOfficialOperationFactory(credentialSet) {
32
- const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
33
- return (config) => {
34
- const wrappedRun = async (input, ctx) => {
35
- const creds = ctx.credentials[credentialSet.id];
36
- return config.run(input, creds);
37
- };
38
- const operation = new Operation({
39
- id: config.id,
40
- name: config.name,
41
- description: config.description,
42
- input: config.input,
43
- output: config.output,
44
- credentialSets: [credentialSet],
45
- ...config.tags !== void 0 ? { tags: config.tags } : {},
46
- ...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
47
- ...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
48
- ...config.retries !== void 0 ? { retries: config.retries } : {},
49
- ...config.timeout !== void 0 ? { timeout: config.timeout } : {},
50
- ...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
51
- run: wrappedRun
52
- });
53
- registerOfficialOperation(operation, { integrationId });
54
- return operation;
55
- };
56
- }
57
- /**
58
- * Creates an official integration bundle from a single config object.
59
- *
60
- * - Creates the public `CredentialSet` internally.
61
- * - Accepts optional `internal` fields for Keystroke-owned platform credentials.
62
- */
63
- function defineOfficialIntegration(config) {
64
- const internalCredentialSets = config.internal ?? {};
65
- const allInternalCredentialSets = [
66
- ...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
67
- ...internalCredentialSets.providerAppVariants ?? [],
68
- ...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
69
- ...internalCredentialSets.other ?? []
70
- ];
71
- const credentialSet = new CredentialSet({
72
- id: config.id,
73
- name: config.name,
74
- description: config.description,
75
- auth: config.auth,
76
- ...config.connections ? { connections: config.connections } : {},
77
- ...config.proxy ? { proxy: config.proxy } : {},
78
- ...config.needsRawSecret === true ? { needsRawSecret: true } : {}
79
- });
80
- return Object.freeze({
81
- integration: {
82
- id: config.id,
83
- name: config.name,
84
- ...config.description !== void 0 ? { description: config.description } : {},
85
- auth: config.auth,
86
- ...config.proxy ? { proxy: config.proxy } : {},
87
- ...config.needsRawSecret === true ? { needsRawSecret: true } : {},
88
- ...config.connections ? { connections: config.connections } : {}
89
- },
90
- credentialSet,
91
- internalCredentialSets,
92
- allInternalCredentialSets
93
- });
94
- }
95
-
96
- //#endregion
97
- //#region src/_official/provider-app.ts
98
- /**
99
- * Internal credential set for the Keystroke-owned Ramp OAuth application.
100
- *
101
- * Mirrors the `zoomAppCredentialSet` pattern: stores the client id/secret that
102
- * Keystroke uses to speak to Ramp's token endpoint, and optionally the webhook
103
- * signing secret used to verify inbound `X-Ramp-Signature` headers.
104
- *
105
- * This is never exposed directly to end users — the public OAuth flow injects
106
- * access tokens into {@link ramp} (defined in `integration.ts`).
107
- */
108
- const rampAppCredentialSet = new CredentialSet({
109
- id: officialCredentialSetId("ramp-app"),
110
- exposure: "platform-only",
111
- name: "Ramp App",
112
- auth: z.object({
113
- clientId: z.string().min(1),
114
- clientSecret: z.string().min(1),
115
- webhookSecret: z.string().min(1).optional()
116
- })
117
- });
118
- const rampOfficialProviderSeed = {
119
- provider: "ramp",
120
- appRef: "ramp-platform",
121
- displayName: "Ramp Platform",
122
- credentialSetName: "Keystroke Ramp Platform App",
123
- envShape: {
124
- KEYSTROKE_OFFICIAL_RAMP_CLIENT_ID: z.string().optional(),
125
- KEYSTROKE_OFFICIAL_RAMP_CLIENT_SECRET: z.string().optional(),
126
- KEYSTROKE_OFFICIAL_RAMP_WEBHOOK_SECRET: z.string().optional()
127
- },
128
- requiredEnvKeys: ["KEYSTROKE_OFFICIAL_RAMP_CLIENT_ID", "KEYSTROKE_OFFICIAL_RAMP_CLIENT_SECRET"],
129
- externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_RAMP_CLIENT_ID",
130
- buildCredentials: (env) => ({
131
- clientId: env.KEYSTROKE_OFFICIAL_RAMP_CLIENT_ID,
132
- clientSecret: env.KEYSTROKE_OFFICIAL_RAMP_CLIENT_SECRET,
133
- ...env.KEYSTROKE_OFFICIAL_RAMP_WEBHOOK_SECRET ? { webhookSecret: env.KEYSTROKE_OFFICIAL_RAMP_WEBHOOK_SECRET } : {}
134
- })
135
- };
136
-
137
- //#endregion
138
- //#region src/integration.ts
139
- /**
140
- * Public auth schema for Ramp connections.
141
- *
142
- * Stores only the OAuth access token. The Ramp platform issues access tokens
143
- * with a ~10-day lifetime; the refresh token lifecycle is managed by the
144
- * platform OAuth machinery and does not need to be re-exposed here.
145
- *
146
- * Deliberately does NOT include environment discrimination — we route all
147
- * API traffic through `https://api.ramp.com` by default. Sandbox usage
148
- * requires bypassing the public connection and calling {@link createRampClient}
149
- * directly with `{ environment: 'sandbox' }`.
150
- */
151
- const rampAuthSchema = z.object({ RAMP_ACCESS_TOKEN: z.string().min(1) });
152
- /**
153
- * OAuth scopes requested at connect time.
154
- *
155
- * Only includes scopes that are currently documented in Ramp's developer docs
156
- * (verified 2026-04-17). Operations gated on undocumented scopes must fail at
157
- * runtime with `RampMissingScopeError` and must NOT add phantom scopes here.
158
- */
159
- const RAMP_OAUTH_SCOPES = [
160
- "accounting:read",
161
- "accounting:write",
162
- "bank_accounts:read",
163
- "bills:read",
164
- "bills:write",
165
- "business:read",
166
- "card_programs:read",
167
- "card_programs:write",
168
- "cards:read",
169
- "cards:write",
170
- "cashbacks:read",
171
- "departments:read",
172
- "departments:write",
173
- "entities:read",
174
- "limits:read",
175
- "limits:write",
176
- "locations:read",
177
- "locations:write",
178
- "memos:read",
179
- "receipt_integrations:read",
180
- "receipt_integrations:write",
181
- "receipts:read",
182
- "receipts:write",
183
- "reimbursements:read",
184
- "spend_programs:read",
185
- "statements:read",
186
- "transactions:read",
187
- "transfers:read",
188
- "users:read",
189
- "users:write",
190
- "vendors:read",
191
- "vendors:write"
192
- ];
193
- const rampOfficialIntegration = {
194
- id: "ramp",
195
- name: "Ramp",
196
- description: "Ramp corporate cards, spend management, bill pay, reimbursements, and accounting integrations for Keystroke workflows.",
197
- auth: rampAuthSchema,
198
- connections: [{
199
- id: "oauth",
200
- kind: "oauth",
201
- tokenType: "refreshable",
202
- authUrl: "https://app.ramp.com/v1/authorize",
203
- tokenUrl: "https://api.ramp.com/developer/v1/token",
204
- revokeUrl: "https://api.ramp.com/developer/v1/token/revoke",
205
- scopes: RAMP_OAUTH_SCOPES,
206
- vault: { accessToken: "RAMP_ACCESS_TOKEN" }
207
- }]
208
- };
209
- const rampBundle = defineOfficialIntegration({
210
- ...rampOfficialIntegration,
211
- internal: { providerApp: rampAppCredentialSet }
212
- });
213
- const ramp = rampBundle.credentialSet;
214
-
215
- //#endregion
216
- export { rampAppCredentialSet as a, rampOfficialIntegration as i, ramp as n, rampOfficialProviderSeed as o, rampBundle as r, createOfficialOperationFactory as s, RAMP_OAUTH_SCOPES as t };