@epilot/app-client 0.12.2 → 0.12.3

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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={330:function(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t(466));r.default=o.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.1.0","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/public/app/{appId}/components/{componentId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"},{"name":"componentId","in":"path","required":true,"description":"ID of the component to retrieve"}],"get":{"operationId":"getPublicFacingComponent","responses":{}}},"/v1/app-configurations":{"get":{"operationId":"listConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}},"post":{"operationId":"createConfiguration","requestBody":{"$ref":"#/components/requestBodies/CreateConfigRequest"},"responses":{}}},"/v1/app-configurations/public":{"get":{"operationId":"listPublicConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/public/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"}],"get":{"operationId":"getPublicConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"get":{"operationId":"getConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}},"patch":{"operationId":"patchMetadata","requestBody":{"$ref":"#/components/requestBodies/PatchConfigMetadataRequest"},"responses":{}},"delete":{"operationId":"deleteConfiguration","responses":{}}},"/v1/app-configurations/{appId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/bundle":{"post":{"operationId":"createBundleUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateBundlePresignedRequest"},"responses":{}}},"/v1/app-configurations/{appId}/zip":{"post":{"operationId":"createZipUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/logo":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"post":{"operationId":"createLogoUploadUrl","requestBody":{"$ref":"#/components/requestBodies/CreateLogoPresignedRequest"},"responses":{}},"delete":{"operationId":"deleteLogo","responses":{}}},"/v1/app-configurations/{appId}/versions":{"get":{"operationId":"listVersions","parameters":[{"name":"appId","in":"path","required":true},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}":{"get":{"operationId":"getVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"patch":{"operationId":"patchVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/PatchVersionRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/review":{"get":{"operationId":"getReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"post":{"operationId":"createReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateReviewRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components":{"post":{"operationId":"createComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components/{componentId}":{"patch":{"operationId":"patchComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}},"delete":{"operationId":"deleteComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{sourceVersion}/clone-to/{targetVersion}":{"post":{"operationId":"cloneVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"sourceVersion","in":"path","required":true},{"name":"targetVersion","in":"path","required":true}],"responses":{}}},"/v1/app":{"get":{"operationId":"listInstallations","parameters":[{"name":"componentType","in":"query"},{"name":"enabled","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstallation","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"post":{"operationId":"install","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"patch":{"operationId":"patchInstallation","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"delete":{"operationId":"uninstall","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/promote-to/{version}":{"post":{"operationId":"promoteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/app-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}}},"components":{"requestBodies":{"CreateReviewRequest":{"required":true,"content":{"application/json":{}}},"CreateLogoPresignedRequest":{"required":true,"content":{"application/json":{}}},"CreateBundlePresignedRequest":{"required":true,"content":{"application/json":{}}},"PatchConfigMetadataRequest":{"required":true,"content":{"application/json":{}}},"PatchVersionRequest":{"required":true,"content":{"application/json":{}}},"UpsertComponentRequest":{"required":true,"content":{"application/json":{}}},"CreateConfigRequest":{"required":true,"content":{"application/json":{}}},"InstallRequest":{"content":{"application/json":{}}}}}}')}},r={},t=function t(n){var o=r[n];if(void 0!==o)return o.exports;var p=r[n]={exports:{}};return e[n].call(p.exports,p,p.exports,t),p.exports}(330),n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={330(e,r,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var p=n(t(466));r.default=p.default},466(e){e.exports=JSON.parse('{"openapi":"3.1.0","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/public/app/{appId}/components/{componentId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"},{"name":"componentId","in":"path","required":true,"description":"ID of the component to retrieve"}],"get":{"operationId":"getPublicFacingComponent","responses":{}}},"/v1/app-configurations":{"get":{"operationId":"listConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}},"post":{"operationId":"createConfiguration","requestBody":{"$ref":"#/components/requestBodies/CreateConfigRequest"},"responses":{}}},"/v1/app-configurations/public":{"get":{"operationId":"listPublicConfigurations","parameters":[{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/public/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration to install"}],"get":{"operationId":"getPublicConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"get":{"operationId":"getConfiguration","parameters":[{"name":"version","in":"query"}],"responses":{}},"patch":{"operationId":"patchMetadata","requestBody":{"$ref":"#/components/requestBodies/PatchConfigMetadataRequest"},"responses":{}},"delete":{"operationId":"deleteConfiguration","responses":{}}},"/v1/app-configurations/{appId}/events":{"post":{"operationId":"queryEvents","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/bundle":{"post":{"operationId":"createBundleUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateBundlePresignedRequest"},"responses":{}}},"/v1/app-configurations/{appId}/zip":{"post":{"operationId":"createZipUploadUrl","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app-configurations/{appId}/logo":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"post":{"operationId":"createLogoUploadUrl","requestBody":{"$ref":"#/components/requestBodies/CreateLogoPresignedRequest"},"responses":{}},"delete":{"operationId":"deleteLogo","responses":{}}},"/v1/app-configurations/{appId}/versions":{"get":{"operationId":"listVersions","parameters":[{"name":"appId","in":"path","required":true},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}":{"get":{"operationId":"getVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"delete":{"operationId":"deleteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"patch":{"operationId":"patchVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/PatchVersionRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/review":{"get":{"operationId":"getReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}},"post":{"operationId":"createReview","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/CreateReviewRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components":{"post":{"operationId":"createComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}}},"/v1/app-configurations/{appId}/versions/{version}/components/{componentId}":{"patch":{"operationId":"patchComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/UpsertComponentRequest"},"responses":{}},"delete":{"operationId":"deleteComponent","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true},{"name":"componentId","in":"path","required":true}],"responses":{}}},"/v1/app-configurations/{appId}/versions/{sourceVersion}/clone-to/{targetVersion}":{"post":{"operationId":"cloneVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"sourceVersion","in":"path","required":true},{"name":"targetVersion","in":"path","required":true}],"responses":{}}},"/v1/app":{"get":{"operationId":"listInstallations","parameters":[{"name":"componentType","in":"query"},{"name":"enabled","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstallation","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"post":{"operationId":"install","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"patch":{"operationId":"patchInstallation","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallRequest"},"responses":{}},"delete":{"operationId":"uninstall","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}},"/v1/app/{appId}/promote-to/{version}":{"post":{"operationId":"promoteVersion","parameters":[{"name":"appId","in":"path","required":true},{"name":"version","in":"path","required":true}],"responses":{}}},"/v1/app-events":{"post":{"operationId":"ingestEvent","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/app/{appId}/proxy/{proxyName}/{path}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the installed app"},{"name":"proxyName","in":"path","required":true,"description":"Name of the proxy target as defined in the app manifest"},{"name":"path","in":"path","required":true,"description":"Path to forward to the proxy target"}],"get":{"operationId":"publicProxyGet","responses":{}},"post":{"operationId":"publicProxyPost","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{"requestBodies":{"CreateReviewRequest":{"required":true,"content":{"application/json":{}}},"CreateLogoPresignedRequest":{"required":true,"content":{"application/json":{}}},"CreateBundlePresignedRequest":{"required":true,"content":{"application/json":{}}},"PatchConfigMetadataRequest":{"required":true,"content":{"application/json":{}}},"PatchVersionRequest":{"required":true,"content":{"application/json":{}}},"UpsertComponentRequest":{"required":true,"content":{"application/json":{}}},"CreateConfigRequest":{"required":true,"content":{"application/json":{}}},"InstallRequest":{"content":{"application/json":{}}}}}}')}},r={},t=function t(n){var p=r[n];if(void 0!==p)return p.exports;var o=r[n]={exports:{}};return e[n].call(o.exports,o,o.exports,t),o.exports}(330),n=exports;for(var p in t)n[p]=t[p];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
@@ -501,6 +501,41 @@
501
501
  },
502
502
  "responses": {}
503
503
  }
504
+ },
505
+ "/v1/public/app/{appId}/proxy/{proxyName}/{path}": {
506
+ "parameters": [
507
+ {
508
+ "name": "appId",
509
+ "in": "path",
510
+ "required": true,
511
+ "description": "ID of the installed app"
512
+ },
513
+ {
514
+ "name": "proxyName",
515
+ "in": "path",
516
+ "required": true,
517
+ "description": "Name of the proxy target as defined in the app manifest"
518
+ },
519
+ {
520
+ "name": "path",
521
+ "in": "path",
522
+ "required": true,
523
+ "description": "Path to forward to the proxy target"
524
+ }
525
+ ],
526
+ "get": {
527
+ "operationId": "publicProxyGet",
528
+ "responses": {}
529
+ },
530
+ "post": {
531
+ "operationId": "publicProxyPost",
532
+ "requestBody": {
533
+ "content": {
534
+ "application/json": {}
535
+ }
536
+ },
537
+ "responses": {}
538
+ }
504
539
  }
505
540
  },
506
541
  "components": {
package/dist/openapi.d.ts CHANGED
@@ -138,6 +138,35 @@ declare namespace Components {
138
138
  };
139
139
  }[];
140
140
  }
141
+ export interface ApiProxyComponent {
142
+ component_type: "API_PROXY";
143
+ configuration: /* Configuration for an API proxy component */ ApiProxyConfig;
144
+ }
145
+ /**
146
+ * Configuration for an API proxy component
147
+ */
148
+ export interface ApiProxyConfig {
149
+ /**
150
+ * Human-friendly proxy name used in SDK calls
151
+ */
152
+ name: string; // ^[a-zA-Z0-9_-]+$
153
+ /**
154
+ * Base URL of the target API. Must be HTTPS.
155
+ */
156
+ target: string; // uri ^https://
157
+ /**
158
+ * Authentication strategy
159
+ */
160
+ auth_type: "header" | "bearer" | "oauth2" | "none";
161
+ /**
162
+ * Header name for 'header' auth type
163
+ */
164
+ auth_header?: string;
165
+ /**
166
+ * OAuth2 token endpoint URL
167
+ */
168
+ token_url?: string; // uri ^https://
169
+ }
141
170
  export interface AppBridgeSurfaceConfig {
142
171
  /**
143
172
  * URL of the uploaded App Bridge App. This is the entrypoint for the app
@@ -245,7 +274,7 @@ declare namespace Components {
245
274
  surfaces?: {
246
275
  [key: string]: any;
247
276
  };
248
- } & (JourneyBlockComponent | PortalBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent | ExternalProductCatalogComponent | CustomPageComponent);
277
+ } & (JourneyBlockComponent | PortalBlockComponent | PortalExtensionComponent | CustomFlowActionComponent | ErpInformToolkitComponent | CustomCapabilityComponent | ExternalProductCatalogComponent | CustomPageComponent | ApiProxyComponent);
249
278
  export interface BaseComponentCommon {
250
279
  /**
251
280
  * Unique identifier for the component
@@ -407,6 +436,22 @@ declare namespace Components {
407
436
  * How often the subscription is billed
408
437
  */
409
438
  export type BillingFrequency = "MONTHLY" | "QUARTERLY" | "YEARLY" | "CUSTOM";
439
+ /**
440
+ * References another journey block by its ID. The configuring user picks
441
+ * a block from the journey via a dropdown in the journey-builder; the
442
+ * chosen block's ID is stored as the arg value (a string). The bundle can
443
+ * then call `subscribe(blockId, cb)` / `getValue(blockId)` against that ID.
444
+ *
445
+ */
446
+ export interface BlockReferenceArg {
447
+ type?: "block_reference";
448
+ /**
449
+ * Restrict the picker to blocks of these journey block types
450
+ * (e.g. ["availability-check", "address"]). Omit to allow any type.
451
+ *
452
+ */
453
+ allowed_types?: string[];
454
+ }
410
455
  export interface BlueprintRef {
411
456
  /**
412
457
  * ID of the blueprint
@@ -453,7 +498,7 @@ declare namespace Components {
453
498
  /**
454
499
  * Type of app component
455
500
  */
456
- export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "CUSTOM_PORTAL_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY" | "EXTERNAL_PRODUCT_CATALOG" | "CUSTOM_PAGE";
501
+ export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "CUSTOM_PORTAL_BLOCK" | "PORTAL_EXTENSION" | "CUSTOM_FLOW_ACTION" | "ERP_INFORM_TOOLKIT" | "CUSTOM_CAPABILITY" | "EXTERNAL_PRODUCT_CATALOG" | "CUSTOM_PAGE" | "API_PROXY";
457
502
  /**
458
503
  * Configuration of the published app
459
504
  */
@@ -1214,7 +1259,7 @@ declare namespace Components {
1214
1259
  * Unique identifier for this component arg
1215
1260
  */
1216
1261
  key: string;
1217
- type: "text" | "boolean" | "enum";
1262
+ type: "text" | "boolean" | "enum" | "block_reference";
1218
1263
  /**
1219
1264
  * Flag to indicate if this option is required
1220
1265
  */
@@ -1245,7 +1290,14 @@ declare namespace Components {
1245
1290
  */
1246
1291
  de: string;
1247
1292
  };
1248
- } & (TextArg | BooleanArg | EnumArg);
1293
+ } & (TextArg | BooleanArg | EnumArg | /**
1294
+ * References another journey block by its ID. The configuring user picks
1295
+ * a block from the journey via a dropdown in the journey-builder; the
1296
+ * chosen block's ID is stored as the arg value (a string). The bundle can
1297
+ * then call `subscribe(blockId, cb)` / `getValue(blockId)` against that ID.
1298
+ *
1299
+ */
1300
+ BlockReferenceArg);
1249
1301
  export interface JourneyBlockConfig {
1250
1302
  override_dev_mode?: /* Override URL when app is in dev mode */ OverrideDevMode;
1251
1303
  /**
@@ -2607,6 +2659,32 @@ declare namespace Paths {
2607
2659
  }
2608
2660
  }
2609
2661
  }
2662
+ namespace PublicProxyGet {
2663
+ namespace Responses {
2664
+ export interface $200 {
2665
+ }
2666
+ export interface $403 {
2667
+ }
2668
+ export interface $404 {
2669
+ }
2670
+ export interface $502 {
2671
+ }
2672
+ }
2673
+ }
2674
+ namespace PublicProxyPost {
2675
+ export interface RequestBody {
2676
+ }
2677
+ namespace Responses {
2678
+ export interface $200 {
2679
+ }
2680
+ export interface $403 {
2681
+ }
2682
+ export interface $404 {
2683
+ }
2684
+ export interface $502 {
2685
+ }
2686
+ }
2687
+ }
2610
2688
  namespace QueryEvents {
2611
2689
  namespace Parameters {
2612
2690
  export type AppId = string;
@@ -2671,6 +2749,18 @@ declare namespace Paths {
2671
2749
  componentId: Parameters.ComponentId;
2672
2750
  }
2673
2751
  }
2752
+ namespace V1PublicApp$AppIdProxy$ProxyName$Path {
2753
+ namespace Parameters {
2754
+ export type AppId = string;
2755
+ export type Path = string;
2756
+ export type ProxyName = string;
2757
+ }
2758
+ export interface PathParameters {
2759
+ appId: Parameters.AppId;
2760
+ proxyName: Parameters.ProxyName;
2761
+ path: Parameters.Path;
2762
+ }
2763
+ }
2674
2764
  }
2675
2765
 
2676
2766
 
@@ -2976,6 +3066,26 @@ export interface OperationMethods {
2976
3066
  data?: Paths.IngestEvent.RequestBody,
2977
3067
  config?: AxiosRequestConfig
2978
3068
  ): OperationResponse<Paths.IngestEvent.Responses.$202>
3069
+ /**
3070
+ * publicProxyGet - publicProxyGet
3071
+ *
3072
+ * Forward a GET request to a registered proxy target from a public-facing component (e.g. journey blocks)
3073
+ */
3074
+ 'publicProxyGet'(
3075
+ parameters?: Parameters<Paths.V1PublicApp$AppIdProxy$ProxyName$Path.PathParameters> | null,
3076
+ data?: any,
3077
+ config?: AxiosRequestConfig
3078
+ ): OperationResponse<Paths.PublicProxyGet.Responses.$200>
3079
+ /**
3080
+ * publicProxyPost - publicProxyPost
3081
+ *
3082
+ * Forward a POST request to a registered proxy target from a public-facing component (e.g. journey blocks)
3083
+ */
3084
+ 'publicProxyPost'(
3085
+ parameters?: Parameters<Paths.V1PublicApp$AppIdProxy$ProxyName$Path.PathParameters> | null,
3086
+ data?: Paths.PublicProxyPost.RequestBody,
3087
+ config?: AxiosRequestConfig
3088
+ ): OperationResponse<Paths.PublicProxyPost.Responses.$200>
2979
3089
  }
2980
3090
 
2981
3091
  export interface PathsDictionary {
@@ -3318,6 +3428,28 @@ export interface PathsDictionary {
3318
3428
  config?: AxiosRequestConfig
3319
3429
  ): OperationResponse<Paths.IngestEvent.Responses.$202>
3320
3430
  }
3431
+ ['/v1/public/app/{appId}/proxy/{proxyName}/{path}']: {
3432
+ /**
3433
+ * publicProxyGet - publicProxyGet
3434
+ *
3435
+ * Forward a GET request to a registered proxy target from a public-facing component (e.g. journey blocks)
3436
+ */
3437
+ 'get'(
3438
+ parameters?: Parameters<Paths.V1PublicApp$AppIdProxy$ProxyName$Path.PathParameters> | null,
3439
+ data?: any,
3440
+ config?: AxiosRequestConfig
3441
+ ): OperationResponse<Paths.PublicProxyGet.Responses.$200>
3442
+ /**
3443
+ * publicProxyPost - publicProxyPost
3444
+ *
3445
+ * Forward a POST request to a registered proxy target from a public-facing component (e.g. journey blocks)
3446
+ */
3447
+ 'post'(
3448
+ parameters?: Parameters<Paths.V1PublicApp$AppIdProxy$ProxyName$Path.PathParameters> | null,
3449
+ data?: Paths.PublicProxyPost.RequestBody,
3450
+ config?: AxiosRequestConfig
3451
+ ): OperationResponse<Paths.PublicProxyPost.Responses.$200>
3452
+ }
3321
3453
  }
3322
3454
 
3323
3455
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
@@ -3325,6 +3457,8 @@ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
3325
3457
 
3326
3458
  export type Actor = Components.Schemas.Actor;
3327
3459
  export type AggregatedEvents = Components.Schemas.AggregatedEvents;
3460
+ export type ApiProxyComponent = Components.Schemas.ApiProxyComponent;
3461
+ export type ApiProxyConfig = Components.Schemas.ApiProxyConfig;
3328
3462
  export type AppBridgeSurfaceConfig = Components.Schemas.AppBridgeSurfaceConfig;
3329
3463
  export type AppEventData = Components.Schemas.AppEventData;
3330
3464
  export type Audit = Components.Schemas.Audit;
@@ -3334,6 +3468,7 @@ export type BaseComponentCommon = Components.Schemas.BaseComponentCommon;
3334
3468
  export type BaseCustomActionConfig = Components.Schemas.BaseCustomActionConfig;
3335
3469
  export type BatchEventRequest = Components.Schemas.BatchEventRequest;
3336
3470
  export type BillingFrequency = Components.Schemas.BillingFrequency;
3471
+ export type BlockReferenceArg = Components.Schemas.BlockReferenceArg;
3337
3472
  export type BlueprintRef = Components.Schemas.BlueprintRef;
3338
3473
  export type BooleanArg = Components.Schemas.BooleanArg;
3339
3474
  export type CallerIdentity = Components.Schemas.CallerIdentity;
package/dist/openapi.json CHANGED
@@ -17,6 +17,10 @@
17
17
  {
18
18
  "name": "App Analytics",
19
19
  "description": "Analytics for installed apps"
20
+ },
21
+ {
22
+ "name": "App Proxy",
23
+ "description": "Forward requests to external APIs via registered proxy targets"
20
24
  }
21
25
  ],
22
26
  "servers": [
@@ -1468,6 +1472,100 @@
1468
1472
  }
1469
1473
  }
1470
1474
  }
1475
+ },
1476
+ "/v1/public/app/{appId}/proxy/{proxyName}/{path}": {
1477
+ "parameters": [
1478
+ {
1479
+ "name": "appId",
1480
+ "in": "path",
1481
+ "required": true,
1482
+ "schema": {
1483
+ "type": "string"
1484
+ },
1485
+ "description": "ID of the installed app"
1486
+ },
1487
+ {
1488
+ "name": "proxyName",
1489
+ "in": "path",
1490
+ "required": true,
1491
+ "schema": {
1492
+ "type": "string"
1493
+ },
1494
+ "description": "Name of the proxy target as defined in the app manifest"
1495
+ },
1496
+ {
1497
+ "name": "path",
1498
+ "in": "path",
1499
+ "required": true,
1500
+ "schema": {
1501
+ "type": "string"
1502
+ },
1503
+ "description": "Path to forward to the proxy target"
1504
+ }
1505
+ ],
1506
+ "get": {
1507
+ "summary": "publicProxyGet",
1508
+ "operationId": "publicProxyGet",
1509
+ "description": "Forward a GET request to a registered proxy target from a public-facing component (e.g. journey blocks)",
1510
+ "tags": [
1511
+ "App Proxy"
1512
+ ],
1513
+ "security": [
1514
+ {
1515
+ "EpilotAuth": []
1516
+ }
1517
+ ],
1518
+ "responses": {
1519
+ "200": {
1520
+ "description": "Proxied response from the target API"
1521
+ },
1522
+ "403": {
1523
+ "description": "Forbidden - app not installed or no public component uses this proxy"
1524
+ },
1525
+ "404": {
1526
+ "description": "Proxy target not found"
1527
+ },
1528
+ "502": {
1529
+ "description": "Bad gateway - proxy target unreachable or error"
1530
+ }
1531
+ }
1532
+ },
1533
+ "post": {
1534
+ "summary": "publicProxyPost",
1535
+ "operationId": "publicProxyPost",
1536
+ "description": "Forward a POST request to a registered proxy target from a public-facing component (e.g. journey blocks)",
1537
+ "tags": [
1538
+ "App Proxy"
1539
+ ],
1540
+ "security": [
1541
+ {
1542
+ "EpilotAuth": []
1543
+ }
1544
+ ],
1545
+ "requestBody": {
1546
+ "content": {
1547
+ "application/json": {
1548
+ "schema": {
1549
+ "type": "object"
1550
+ }
1551
+ }
1552
+ }
1553
+ },
1554
+ "responses": {
1555
+ "200": {
1556
+ "description": "Proxied response from the target API"
1557
+ },
1558
+ "403": {
1559
+ "description": "Forbidden - app not installed or no public component uses this proxy"
1560
+ },
1561
+ "404": {
1562
+ "description": "Proxy target not found"
1563
+ },
1564
+ "502": {
1565
+ "description": "Bad gateway - proxy target unreachable or error"
1566
+ }
1567
+ }
1568
+ }
1471
1569
  }
1472
1570
  },
1473
1571
  "components": {
@@ -1832,7 +1930,8 @@
1832
1930
  "ERP_INFORM_TOOLKIT",
1833
1931
  "CUSTOM_CAPABILITY",
1834
1932
  "EXTERNAL_PRODUCT_CATALOG",
1835
- "CUSTOM_PAGE"
1933
+ "CUSTOM_PAGE",
1934
+ "API_PROXY"
1836
1935
  ],
1837
1936
  "description": "Type of app component"
1838
1937
  },
@@ -1944,7 +2043,8 @@
1944
2043
  "ERP_INFORM_TOOLKIT": "#/components/schemas/ErpInformToolkitComponent",
1945
2044
  "CUSTOM_CAPABILITY": "#/components/schemas/CustomCapabilityComponent",
1946
2045
  "EXTERNAL_PRODUCT_CATALOG": "#/components/schemas/ExternalProductCatalogComponent",
1947
- "CUSTOM_PAGE": "#/components/schemas/CustomPageComponent"
2046
+ "CUSTOM_PAGE": "#/components/schemas/CustomPageComponent",
2047
+ "API_PROXY": "#/components/schemas/ApiProxyComponent"
1948
2048
  }
1949
2049
  },
1950
2050
  "oneOf": [
@@ -1971,11 +2071,32 @@
1971
2071
  },
1972
2072
  {
1973
2073
  "$ref": "#/components/schemas/CustomPageComponent"
2074
+ },
2075
+ {
2076
+ "$ref": "#/components/schemas/ApiProxyComponent"
1974
2077
  }
1975
2078
  ]
1976
2079
  }
1977
2080
  ]
1978
2081
  },
2082
+ "ApiProxyComponent": {
2083
+ "type": "object",
2084
+ "required": [
2085
+ "component_type",
2086
+ "configuration"
2087
+ ],
2088
+ "properties": {
2089
+ "component_type": {
2090
+ "type": "string",
2091
+ "enum": [
2092
+ "API_PROXY"
2093
+ ]
2094
+ },
2095
+ "configuration": {
2096
+ "$ref": "#/components/schemas/ApiProxyConfig"
2097
+ }
2098
+ }
2099
+ },
1979
2100
  "CustomCapabilityComponent": {
1980
2101
  "type": "object",
1981
2102
  "required": [
@@ -3430,7 +3551,8 @@
3430
3551
  "enum": [
3431
3552
  "text",
3432
3553
  "boolean",
3433
- "enum"
3554
+ "enum",
3555
+ "block_reference"
3434
3556
  ]
3435
3557
  },
3436
3558
  "required": {
@@ -3467,7 +3589,8 @@
3467
3589
  "mapping": {
3468
3590
  "text": "#/components/schemas/TextArg",
3469
3591
  "boolean": "#/components/schemas/BooleanArg",
3470
- "enum": "#/components/schemas/EnumArg"
3592
+ "enum": "#/components/schemas/EnumArg",
3593
+ "block_reference": "#/components/schemas/BlockReferenceArg"
3471
3594
  }
3472
3595
  },
3473
3596
  "oneOf": [
@@ -3479,6 +3602,9 @@
3479
3602
  },
3480
3603
  {
3481
3604
  "$ref": "#/components/schemas/EnumArg"
3605
+ },
3606
+ {
3607
+ "$ref": "#/components/schemas/BlockReferenceArg"
3482
3608
  }
3483
3609
  ]
3484
3610
  }
@@ -3506,6 +3632,25 @@
3506
3632
  }
3507
3633
  }
3508
3634
  },
3635
+ "BlockReferenceArg": {
3636
+ "type": "object",
3637
+ "description": "References another journey block by its ID. The configuring user picks\na block from the journey via a dropdown in the journey-builder; the\nchosen block's ID is stored as the arg value (a string). The bundle can\nthen call `subscribe(blockId, cb)` / `getValue(blockId)` against that ID.\n",
3638
+ "properties": {
3639
+ "type": {
3640
+ "type": "string",
3641
+ "enum": [
3642
+ "block_reference"
3643
+ ]
3644
+ },
3645
+ "allowed_types": {
3646
+ "type": "array",
3647
+ "description": "Restrict the picker to blocks of these journey block types\n(e.g. [\"availability-check\", \"address\"]). Omit to allow any type.\n",
3648
+ "items": {
3649
+ "type": "string"
3650
+ }
3651
+ }
3652
+ }
3653
+ },
3509
3654
  "EnumArg": {
3510
3655
  "type": "object",
3511
3656
  "required": [
@@ -3876,6 +4021,49 @@
3876
4021
  }
3877
4022
  }
3878
4023
  },
4024
+ "ApiProxyConfig": {
4025
+ "type": "object",
4026
+ "description": "Configuration for an API proxy component",
4027
+ "required": [
4028
+ "name",
4029
+ "target",
4030
+ "auth_type"
4031
+ ],
4032
+ "properties": {
4033
+ "name": {
4034
+ "type": "string",
4035
+ "description": "Human-friendly proxy name used in SDK calls",
4036
+ "pattern": "^[a-zA-Z0-9_-]+$",
4037
+ "maxLength": 64
4038
+ },
4039
+ "target": {
4040
+ "type": "string",
4041
+ "format": "uri",
4042
+ "description": "Base URL of the target API. Must be HTTPS.",
4043
+ "pattern": "^https://"
4044
+ },
4045
+ "auth_type": {
4046
+ "type": "string",
4047
+ "enum": [
4048
+ "header",
4049
+ "bearer",
4050
+ "oauth2",
4051
+ "none"
4052
+ ],
4053
+ "description": "Authentication strategy"
4054
+ },
4055
+ "auth_header": {
4056
+ "type": "string",
4057
+ "description": "Header name for 'header' auth type"
4058
+ },
4059
+ "token_url": {
4060
+ "type": "string",
4061
+ "format": "uri",
4062
+ "description": "OAuth2 token endpoint URL",
4063
+ "pattern": "^https://"
4064
+ }
4065
+ }
4066
+ },
3879
4067
  "Grants": {
3880
4068
  "type": "array",
3881
4069
  "description": "Required grants for the app in order to call APIs for the installing tenant",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "test": "vitest",
26
26
  "typescript": "tsc",
27
27
  "bundle-definition": "webpack",
28
- "openapi:local": "node ../../scripts/update-openapi.js ../../../app-api/openapi.yml",
28
+ "openapi:local": "node ../../scripts/update-openapi.js /Users/sauerer/epilot/app-api/openapi.yml",
29
29
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/app.yaml",
30
30
  "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
31
31
  "build": "tsc && npm run build:patch && npm run bundle-definition",
@@ -64,7 +64,7 @@
64
64
  "axios": "^1.11.0",
65
65
  "copy-webpack-plugin": "^7.0.0",
66
66
  "json-loader": "^0.5.7",
67
- "openapicmd": "^2.7.0",
67
+ "openapicmd": "^2.9.2",
68
68
  "ts-loader": "^8.0.14",
69
69
  "ts-node": "^10.9.1",
70
70
  "typescript": "^4.1.3",