@hookdeck/outpost-sdk 0.1.0 → 0.2.0

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 (45) hide show
  1. package/README.md +0 -5
  2. package/bin/mcp-server.js +21 -18
  3. package/bin/mcp-server.js.map +9 -9
  4. package/dist/commonjs/funcs/publishEvent.js +2 -1
  5. package/dist/commonjs/funcs/publishEvent.js.map +1 -1
  6. package/dist/commonjs/funcs/tenantsUpsert.js +1 -1
  7. package/dist/commonjs/funcs/tenantsUpsert.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/lib/config.js.map +1 -1
  11. package/dist/commonjs/mcp-server/cli/start/impl.js +4 -4
  12. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  13. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  14. package/dist/commonjs/mcp-server/server.js +1 -1
  15. package/dist/commonjs/models/components/publishrequest.d.ts +12 -7
  16. package/dist/commonjs/models/components/publishrequest.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/publishrequest.js +8 -6
  18. package/dist/commonjs/models/components/publishrequest.js.map +1 -1
  19. package/dist/esm/funcs/publishEvent.js +2 -1
  20. package/dist/esm/funcs/publishEvent.js.map +1 -1
  21. package/dist/esm/funcs/tenantsUpsert.js +1 -1
  22. package/dist/esm/funcs/tenantsUpsert.js.map +1 -1
  23. package/dist/esm/lib/config.d.ts +3 -3
  24. package/dist/esm/lib/config.js +3 -3
  25. package/dist/esm/lib/config.js.map +1 -1
  26. package/dist/esm/mcp-server/cli/start/impl.js +4 -4
  27. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  28. package/dist/esm/mcp-server/mcp-server.js +1 -1
  29. package/dist/esm/mcp-server/server.js +1 -1
  30. package/dist/esm/models/components/publishrequest.d.ts +12 -7
  31. package/dist/esm/models/components/publishrequest.d.ts.map +1 -1
  32. package/dist/esm/models/components/publishrequest.js +8 -6
  33. package/dist/esm/models/components/publishrequest.js.map +1 -1
  34. package/docs/sdks/destinations/README.md +12 -12
  35. package/docs/sdks/publish/README.md +2 -2
  36. package/docs/sdks/schemas/README.md +4 -4
  37. package/jsr.json +1 -1
  38. package/package.json +2 -2
  39. package/src/funcs/publishEvent.ts +2 -1
  40. package/src/funcs/tenantsUpsert.ts +1 -1
  41. package/src/lib/config.ts +3 -3
  42. package/src/mcp-server/cli/start/impl.ts +4 -4
  43. package/src/mcp-server/mcp-server.ts +1 -1
  44. package/src/mcp-server/server.ts +1 -1
  45. package/src/models/components/publishrequest.ts +20 -13
@@ -26,10 +26,10 @@ const outpost = new Outpost({
26
26
 
27
27
  async function run() {
28
28
  await outpost.publish.event({
29
+ id: "evt_custom_123",
29
30
  tenantId: "<TENANT_ID>",
30
31
  destinationId: "<DESTINATION_ID>",
31
32
  topic: "topic.name",
32
- eligibleForRetry: false,
33
33
  metadata: {
34
34
  "source": "crm",
35
35
  },
@@ -63,10 +63,10 @@ const outpost = new OutpostCore({
63
63
 
64
64
  async function run() {
65
65
  const res = await publishEvent(outpost, {
66
+ id: "evt_custom_123",
66
67
  tenantId: "<TENANT_ID>",
67
68
  destinationId: "<DESTINATION_ID>",
68
69
  topic: "topic.name",
69
- eligibleForRetry: false,
70
70
  metadata: {
71
71
  "source": "crm",
72
72
  },
@@ -119,7 +119,7 @@ const outpost = new Outpost({
119
119
  async function run() {
120
120
  const result = await outpost.schemas.get({
121
121
  tenantId: "<id>",
122
- type: "rabbitmq",
122
+ type: "hookdeck",
123
123
  });
124
124
 
125
125
  // Handle the result
@@ -148,7 +148,7 @@ const outpost = new OutpostCore({
148
148
  async function run() {
149
149
  const res = await schemasGet(outpost, {
150
150
  tenantId: "<id>",
151
- type: "rabbitmq",
151
+ type: "hookdeck",
152
152
  });
153
153
 
154
154
  if (!res.ok) {
@@ -294,7 +294,7 @@ const outpost = new Outpost({
294
294
 
295
295
  async function run() {
296
296
  const result = await outpost.schemas.getDestinationTypeJwt({
297
- type: "aws_kinesis",
297
+ type: "rabbitmq",
298
298
  });
299
299
 
300
300
  // Handle the result
@@ -322,7 +322,7 @@ const outpost = new OutpostCore({
322
322
 
323
323
  async function run() {
324
324
  const res = await schemasGetDestinationTypeJwt(outpost, {
325
- type: "aws_kinesis",
325
+ type: "rabbitmq",
326
326
  });
327
327
 
328
328
  if (!res.ok) {
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@hookdeck/outpost-sdk",
5
- "version": "0.1.0",
5
+ "version": "0.2.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hookdeck/outpost-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "author": "Speakeasy",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "repository": {
26
26
  "type": "git",
27
27
  "url": "https://github.com/hookdeck/outpost.git",
28
- "directory": "sdks/typescript"
28
+ "directory": "sdks/outpost-typescript"
29
29
  },
30
30
  "scripts": {
31
31
  "lint": "eslint --cache --max-warnings=0 src",
@@ -151,6 +151,7 @@ async function $do(
151
151
  "404",
152
152
  "407",
153
153
  "408",
154
+ "409",
154
155
  "413",
155
156
  "414",
156
157
  "415",
@@ -217,7 +218,7 @@ async function $do(
217
218
  ),
218
219
  M.jsonErr(510, errors.BadRequestError$inboundSchema),
219
220
  M.jsonErr(511, errors.UnauthorizedError$inboundSchema),
220
- M.fail([400, 401, "4XX"]),
221
+ M.fail([400, 401, 409, "4XX"]),
221
222
  M.fail("5XX"),
222
223
  )(response, { extraFields: responseFields });
223
224
  if (!result.ok) {
@@ -210,7 +210,7 @@ async function $do(
210
210
  | RequestTimeoutError
211
211
  | ConnectionError
212
212
  >(
213
- M.json(200, components.Tenant$inboundSchema),
213
+ M.json([200, 201], components.Tenant$inboundSchema),
214
214
  M.jsonErr(404, errors.NotFoundError$inboundSchema),
215
215
  M.jsonErr([401, 403, 407], errors.UnauthorizedError$inboundSchema),
216
216
  M.jsonErr(408, errors.TimeoutError$inboundSchema),
package/src/lib/config.ts CHANGED
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
69
  export const SDK_METADATA = {
70
70
  language: "typescript",
71
71
  openapiDocVersion: "0.0.1",
72
- sdkVersion: "0.1.0",
73
- genVersion: "2.598.21",
72
+ sdkVersion: "0.2.0",
73
+ genVersion: "2.605.0",
74
74
  userAgent:
75
- "speakeasy-sdk/typescript 0.1.0 2.598.21 0.0.1 @hookdeck/outpost-sdk",
75
+ "speakeasy-sdk/typescript 0.2.0 2.605.0 0.0.1 @hookdeck/outpost-sdk",
76
76
  } as const;
@@ -53,8 +53,8 @@ async function startStdio(flags: StartCommandFlags) {
53
53
  allowedTools: flags.tool,
54
54
  scopes: flags.scope,
55
55
  security: {
56
- adminApiKey: flags["admin-api-key"],
57
- tenantJwt: flags["tenant-jwt"],
56
+ adminApiKey: flags["admin-api-key"] ?? "",
57
+ tenantJwt: flags["tenant-jwt"] ?? "",
58
58
  },
59
59
  tenantId: flags["tenant-id"],
60
60
  serverURL: flags["server-url"],
@@ -78,8 +78,8 @@ async function startSSE(flags: StartCommandFlags) {
78
78
  allowedTools: flags.tool,
79
79
  scopes: flags.scope,
80
80
  security: {
81
- adminApiKey: flags["admin-api-key"],
82
- tenantJwt: flags["tenant-jwt"],
81
+ adminApiKey: flags["admin-api-key"] ?? "",
82
+ tenantJwt: flags["tenant-jwt"] ?? "",
83
83
  },
84
84
  tenantId: flags["tenant-id"],
85
85
  serverURL: flags["server-url"],
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.1.0",
22
+ currentVersion: "0.2.0",
23
23
  },
24
24
  });
25
25
 
@@ -51,7 +51,7 @@ export function createMCPServer(deps: {
51
51
  }) {
52
52
  const server = new McpServer({
53
53
  name: "Outpost",
54
- version: "0.1.0",
54
+ version: "0.2.0",
55
55
  });
56
56
 
57
57
  const client = new OutpostCore({
@@ -9,22 +9,26 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type PublishRequest = {
12
+ /**
13
+ * Optional. A unique identifier for the event. If not provided, a UUID will be generated.
14
+ */
15
+ id?: string | undefined;
12
16
  /**
13
17
  * The ID of the tenant to publish for.
14
18
  */
15
- tenantId: string;
19
+ tenantId?: string | undefined;
16
20
  /**
17
21
  * Optional. Route event to a specific destination.
18
22
  */
19
23
  destinationId?: string | undefined;
20
24
  /**
21
- * Topic name for the event.
25
+ * Topic name for the event. Required if Outpost has been configured with topics.
22
26
  */
23
- topic: string;
27
+ topic?: string | undefined;
24
28
  /**
25
29
  * Should event delivery be retried on failure.
26
30
  */
27
- eligibleForRetry: boolean;
31
+ eligibleForRetry?: boolean | undefined;
28
32
  /**
29
33
  * Any key-value string pairs for metadata.
30
34
  */
@@ -41,10 +45,11 @@ export const PublishRequest$inboundSchema: z.ZodType<
41
45
  z.ZodTypeDef,
42
46
  unknown
43
47
  > = z.object({
44
- tenant_id: z.string(),
48
+ id: z.string().optional(),
49
+ tenant_id: z.string().optional(),
45
50
  destination_id: z.string().optional(),
46
- topic: z.string(),
47
- eligible_for_retry: z.boolean(),
51
+ topic: z.string().optional(),
52
+ eligible_for_retry: z.boolean().optional(),
48
53
  metadata: z.record(z.string()).optional(),
49
54
  data: z.record(z.any()),
50
55
  }).transform((v) => {
@@ -57,10 +62,11 @@ export const PublishRequest$inboundSchema: z.ZodType<
57
62
 
58
63
  /** @internal */
59
64
  export type PublishRequest$Outbound = {
60
- tenant_id: string;
65
+ id?: string | undefined;
66
+ tenant_id?: string | undefined;
61
67
  destination_id?: string | undefined;
62
- topic: string;
63
- eligible_for_retry: boolean;
68
+ topic?: string | undefined;
69
+ eligible_for_retry?: boolean | undefined;
64
70
  metadata?: { [k: string]: string } | undefined;
65
71
  data: { [k: string]: any };
66
72
  };
@@ -71,10 +77,11 @@ export const PublishRequest$outboundSchema: z.ZodType<
71
77
  z.ZodTypeDef,
72
78
  PublishRequest
73
79
  > = z.object({
74
- tenantId: z.string(),
80
+ id: z.string().optional(),
81
+ tenantId: z.string().optional(),
75
82
  destinationId: z.string().optional(),
76
- topic: z.string(),
77
- eligibleForRetry: z.boolean(),
83
+ topic: z.string().optional(),
84
+ eligibleForRetry: z.boolean().optional(),
78
85
  metadata: z.record(z.string()).optional(),
79
86
  data: z.record(z.any()),
80
87
  }).transform((v) => {