@epilot/app-client 0.0.1 → 0.0.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={187:function(e,t,p){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(p(466));t.default=s.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/app:uploadManifest":{"post":{"operationId":"uploadManifest","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/app":{"get":{"operationId":"listInstalledApps","parameters":[{"name":"componentType","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstalledApp","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"put":{"operationId":"installApp","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallAppRequest"},"responses":{}},"delete":{"operationId":"uninstallApp","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}}},"components":{"requestBodies":{"InstallAppRequest":{"content":{"application/json":{}}}}}}')}},t={},p=function p(r){var s=t[r];if(void 0!==s)return s.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,p),a.exports}(187),r=exports;for(var s in p)r[s]=p[s];p.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={187:function(e,p,t){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0});var a=r(t(466));p.default=a.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://app.sls.epilot.io"}],"paths":{"/v1/app-configurations/{appId}":{"parameters":[{"name":"appId","in":"path","required":true,"description":"ID of the app configuration"}],"get":{"operationId":"getAppConfiguration","responses":{}}},"/v1/app":{"get":{"operationId":"listInstalledApps","parameters":[{"name":"componentType","in":"query"},{"name":"page","in":"query"},{"name":"pageSize","in":"query"}],"responses":{}}},"/v1/app/{appId}":{"get":{"operationId":"getInstalledApp","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}},"put":{"operationId":"installApp","parameters":[{"name":"appId","in":"path","required":true}],"requestBody":{"$ref":"#/components/requestBodies/InstallAppRequest"},"responses":{}},"delete":{"operationId":"uninstallApp","parameters":[{"name":"appId","in":"path","required":true}],"responses":{}}}},"components":{"requestBodies":{"InstallAppRequest":{"content":{"application/json":{}}}}}}')}},p={},t=function t(r){var a=p[r];if(void 0!==a)return a.exports;var n=p[r]={exports:{}};return e[r].call(n.exports,n,n.exports,t),n.exports}(187),r=exports;for(var a in t)r[a]=t[a];t.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
@@ -10,14 +10,17 @@
10
10
  }
11
11
  ],
12
12
  "paths": {
13
- "/v1/app:uploadManifest": {
14
- "post": {
15
- "operationId": "uploadManifest",
16
- "requestBody": {
17
- "content": {
18
- "application/json": {}
19
- }
20
- },
13
+ "/v1/app-configurations/{appId}": {
14
+ "parameters": [
15
+ {
16
+ "name": "appId",
17
+ "in": "path",
18
+ "required": true,
19
+ "description": "ID of the app configuration"
20
+ }
21
+ ],
22
+ "get": {
23
+ "operationId": "getAppConfiguration",
21
24
  "responses": {}
22
25
  }
23
26
  },
package/dist/openapi.d.ts CHANGED
@@ -10,7 +10,12 @@ import type {
10
10
 
11
11
  declare namespace Components {
12
12
  namespace RequestBodies {
13
- export type InstallAppRequest = /* Information about the installed app */ Schemas.App;
13
+ export interface InstallAppRequest {
14
+ /**
15
+ * Configuration values for the app components
16
+ */
17
+ option_values?: Schemas.OptionsRef[];
18
+ }
14
19
  }
15
20
  namespace Schemas {
16
21
  /**
@@ -27,11 +32,20 @@ declare namespace Components {
27
32
  * URL of the app documentation.
28
33
  */
29
34
  documentation_url?: string;
35
+ /**
36
+ * Markdown description of the app.
37
+ */
30
38
  description?: string;
31
- app_s3ref?: S3Reference;
32
39
  created_by?: string;
33
40
  created_at?: string;
41
+ /**
42
+ * Timestamp of the last update
43
+ */
34
44
  updated_at?: string;
45
+ /**
46
+ * User ID of the user who last updated the app
47
+ */
48
+ updated_by?: string;
35
49
  version?: string;
36
50
  author?: Author;
37
51
  status?: "published" | "pending";
@@ -69,12 +83,9 @@ declare namespace Components {
69
83
  */
70
84
  enabled?: boolean;
71
85
  /**
72
- * Configuration values for the app components
86
+ * Configuration values for the app components options
73
87
  */
74
- config_values?: {
75
- component_id?: string;
76
- options?: /* Options for the component configuration */ ConfigurationOptions[];
77
- };
88
+ option_values?: OptionsRef[];
78
89
  }
79
90
  /**
80
91
  * Configuration of the published app
@@ -90,14 +101,14 @@ declare namespace Components {
90
101
  * URL of the app documentation.
91
102
  */
92
103
  documentation_url?: string;
93
- description?: string;
94
104
  /**
95
- * Link to the bundle (.zip) which contains all the app relevant assets
105
+ * Markdown description of the app.
96
106
  */
97
- app_s3ref?: S3Reference;
107
+ description?: string;
98
108
  created_by?: string;
99
109
  created_at?: string;
100
110
  updated_at?: string;
111
+ updated_by?: string;
101
112
  version?: string;
102
113
  author?: Author;
103
114
  status?: "published" | "pending";
@@ -141,20 +152,21 @@ declare namespace Components {
141
152
  */
142
153
  id: string;
143
154
  /**
144
- * List of required options for the app component
155
+ * List of options for the app component
145
156
  */
146
- config_options?: /* Options for the component configuration */ ConfigurationOptions[];
157
+ options?: /* Options for the component configuration */ Options[];
147
158
  } | {
148
159
  component_type?: "PORTAL_EXTENSION";
160
+ origin?: "END_CUSTOMER_PORTAL" | "INSTALLER_PORTAL";
149
161
  configuration: PortalExtensionConfig;
150
162
  /**
151
163
  * Unique identifier for the component
152
164
  */
153
165
  id: string;
154
166
  /**
155
- * List of required options for the app component
167
+ * List of options for the app component
156
168
  */
157
- config_options?: /* Options for the component configuration */ ConfigurationOptions[];
169
+ options?: /* Options for the component configuration */ Options[];
158
170
  };
159
171
  export interface BaseComponentCommon {
160
172
  /**
@@ -162,9 +174,9 @@ declare namespace Components {
162
174
  */
163
175
  id: string;
164
176
  /**
165
- * List of required options for the app component
177
+ * List of options for the app component
166
178
  */
167
- config_options?: /* Options for the component configuration */ ConfigurationOptions[];
179
+ options?: /* Options for the component configuration */ Options[];
168
180
  }
169
181
  export interface CallerIdentity {
170
182
  /**
@@ -196,10 +208,30 @@ declare namespace Components {
196
208
  * Type of app component
197
209
  */
198
210
  export type ComponentType = "CUSTOM_JOURNEY_BLOCK" | "PORTAL_EXTENSION";
211
+ export interface JourneyBlockConfig {
212
+ /**
213
+ * URL of the web component object
214
+ */
215
+ component_url: string;
216
+ /**
217
+ * Custom element tag for the component
218
+ */
219
+ component_tag?: string;
220
+ }
221
+ export interface Option {
222
+ /**
223
+ * Key matching a config_option from the component
224
+ */
225
+ key: string;
226
+ /**
227
+ * The configured value for this option
228
+ */
229
+ value: string;
230
+ }
199
231
  /**
200
232
  * Options for the component configuration
201
233
  */
202
- export interface ConfigurationOptions {
234
+ export interface Options {
203
235
  /**
204
236
  * Unique identifier for this configuration option
205
237
  */
@@ -209,25 +241,21 @@ declare namespace Components {
209
241
  */
210
242
  label?: string;
211
243
  /**
212
- * Detailed description of what this configuration option does
244
+ * Flag to indicate if this option is required
213
245
  */
214
- description?: string;
246
+ required?: boolean;
215
247
  /**
216
- * The configured value (only used in App installation)
248
+ * Detailed description of what this configuration option does
217
249
  */
218
- value?: string;
250
+ description?: string;
219
251
  type: "string" | "number" | "boolean" | "secret";
220
- /**
221
- * Whether this configuration option must be set
222
- */
223
- required?: boolean;
224
252
  }
225
- export interface JourneyBlockConfig {
226
- bundle_s3Ref?: S3Reference;
253
+ export interface OptionsRef {
227
254
  /**
228
- * Custom element tag for the component
255
+ * ID of the component these values are for
229
256
  */
230
- component_tag?: string;
257
+ component_id: string;
258
+ options: Option[];
231
259
  }
232
260
  export interface PortalAuth {
233
261
  type?: string;
@@ -294,6 +322,13 @@ declare namespace Components {
294
322
  }
295
323
  }
296
324
  declare namespace Paths {
325
+ namespace GetAppConfiguration {
326
+ namespace Responses {
327
+ export type $200 = /* Configuration of the published app */ Components.Schemas.AppConfiguration;
328
+ export interface $404 {
329
+ }
330
+ }
331
+ }
297
332
  namespace GetInstalledApp {
298
333
  namespace Parameters {
299
334
  export type AppId = string;
@@ -358,33 +393,27 @@ declare namespace Paths {
358
393
  }
359
394
  }
360
395
  }
361
- namespace UploadManifest {
362
- export type RequestBody = Components.Schemas.UploadFilePayload;
363
- namespace Responses {
364
- export interface $201 {
365
- s3ref?: Components.Schemas.S3Reference;
366
- /**
367
- * example:
368
- * https://epilot-dev-blueprints.s3.eu-central-1.amazonaws.com/templates/document.pdf
369
- */
370
- upload_url?: string; // url
371
- }
396
+ namespace V1AppConfigurations$AppId {
397
+ namespace Parameters {
398
+ export type AppId = string;
399
+ }
400
+ export interface PathParameters {
401
+ appId: Parameters.AppId;
372
402
  }
373
403
  }
374
404
  }
375
405
 
376
406
  export interface OperationMethods {
377
407
  /**
378
- * uploadManifest - uploadManifest
379
- *
380
- * Create pre-signed S3 URL to upload a manifest file.
408
+ * getAppConfiguration - getAppConfiguration
381
409
  *
410
+ * Retrieve a specific app configuration
382
411
  */
383
- 'uploadManifest'(
384
- parameters?: Parameters<UnknownParamsObject> | null,
385
- data?: Paths.UploadManifest.RequestBody,
412
+ 'getAppConfiguration'(
413
+ parameters?: Parameters<Paths.V1AppConfigurations$AppId.PathParameters> | null,
414
+ data?: any,
386
415
  config?: AxiosRequestConfig
387
- ): OperationResponse<Paths.UploadManifest.Responses.$201>
416
+ ): OperationResponse<Paths.GetAppConfiguration.Responses.$200>
388
417
  /**
389
418
  * listInstalledApps - listInstalledApps
390
419
  *
@@ -408,7 +437,7 @@ export interface OperationMethods {
408
437
  /**
409
438
  * installApp - installApp
410
439
  *
411
- * Update assets of a specific installed app by its ID.
440
+ * Upsert app installation by its ID.
412
441
  */
413
442
  'installApp'(
414
443
  parameters?: Parameters<Paths.InstallApp.PathParameters> | null,
@@ -428,18 +457,17 @@ export interface OperationMethods {
428
457
  }
429
458
 
430
459
  export interface PathsDictionary {
431
- ['/v1/app:uploadManifest']: {
460
+ ['/v1/app-configurations/{appId}']: {
432
461
  /**
433
- * uploadManifest - uploadManifest
434
- *
435
- * Create pre-signed S3 URL to upload a manifest file.
462
+ * getAppConfiguration - getAppConfiguration
436
463
  *
464
+ * Retrieve a specific app configuration
437
465
  */
438
- 'post'(
439
- parameters?: Parameters<UnknownParamsObject> | null,
440
- data?: Paths.UploadManifest.RequestBody,
466
+ 'get'(
467
+ parameters?: Parameters<Paths.V1AppConfigurations$AppId.PathParameters> | null,
468
+ data?: any,
441
469
  config?: AxiosRequestConfig
442
- ): OperationResponse<Paths.UploadManifest.Responses.$201>
470
+ ): OperationResponse<Paths.GetAppConfiguration.Responses.$200>
443
471
  }
444
472
  ['/v1/app']: {
445
473
  /**
@@ -467,7 +495,7 @@ export interface PathsDictionary {
467
495
  /**
468
496
  * installApp - installApp
469
497
  *
470
- * Update assets of a specific installed app by its ID.
498
+ * Upsert app installation by its ID.
471
499
  */
472
500
  'put'(
473
501
  parameters?: Parameters<Paths.InstallApp.PathParameters> | null,
@@ -496,8 +524,10 @@ export type BaseComponent = Components.Schemas.BaseComponent;
496
524
  export type BaseComponentCommon = Components.Schemas.BaseComponentCommon;
497
525
  export type CallerIdentity = Components.Schemas.CallerIdentity;
498
526
  export type ComponentType = Components.Schemas.ComponentType;
499
- export type ConfigurationOptions = Components.Schemas.ConfigurationOptions;
500
527
  export type JourneyBlockConfig = Components.Schemas.JourneyBlockConfig;
528
+ export type Option = Components.Schemas.Option;
529
+ export type Options = Components.Schemas.Options;
530
+ export type OptionsRef = Components.Schemas.OptionsRef;
501
531
  export type PortalAuth = Components.Schemas.PortalAuth;
502
532
  export type PortalExtensionConfig = Components.Schemas.PortalExtensionConfig;
503
533
  export type S3Reference = Components.Schemas.S3Reference;
package/dist/openapi.json CHANGED
@@ -22,43 +22,35 @@
22
22
  }
23
23
  ],
24
24
  "paths": {
25
- "/v1/app:uploadManifest": {
26
- "post": {
27
- "operationId": "uploadManifest",
28
- "summary": "uploadManifest",
29
- "description": "Create pre-signed S3 URL to upload a manifest file.\n",
30
- "tags": [
31
- "Import"
32
- ],
33
- "requestBody": {
34
- "content": {
35
- "application/json": {
36
- "schema": {
37
- "$ref": "#/components/schemas/UploadFilePayload"
38
- }
39
- }
40
- }
41
- },
25
+ "/v1/app-configurations/{appId}": {
26
+ "parameters": [
27
+ {
28
+ "name": "appId",
29
+ "in": "path",
30
+ "required": true,
31
+ "schema": {
32
+ "type": "string"
33
+ },
34
+ "description": "ID of the app configuration"
35
+ }
36
+ ],
37
+ "get": {
38
+ "summary": "getAppConfiguration",
39
+ "description": "Retrieve a specific app configuration",
40
+ "operationId": "getAppConfiguration",
42
41
  "responses": {
43
- "201": {
44
- "description": "Pre-signed URL for POST / PUT upload",
42
+ "200": {
43
+ "description": "Successful response",
45
44
  "content": {
46
45
  "application/json": {
47
46
  "schema": {
48
- "type": "object",
49
- "properties": {
50
- "s3ref": {
51
- "$ref": "#/components/schemas/S3Reference"
52
- },
53
- "upload_url": {
54
- "type": "string",
55
- "format": "url",
56
- "example": "https://epilot-dev-blueprints.s3.eu-central-1.amazonaws.com/templates/document.pdf"
57
- }
58
- }
47
+ "$ref": "#/components/schemas/AppConfiguration"
59
48
  }
60
49
  }
61
50
  }
51
+ },
52
+ "404": {
53
+ "description": "App configuration not found"
62
54
  }
63
55
  }
64
56
  }
@@ -166,7 +158,7 @@
166
158
  },
167
159
  "put": {
168
160
  "summary": "installApp",
169
- "description": "Update assets of a specific installed app by its ID.",
161
+ "description": "Upsert app installation by its ID.",
170
162
  "operationId": "installApp",
171
163
  "parameters": [
172
164
  {
@@ -221,7 +213,16 @@
221
213
  "content": {
222
214
  "application/json": {
223
215
  "schema": {
224
- "$ref": "#/components/schemas/App"
216
+ "type": "object",
217
+ "properties": {
218
+ "option_values": {
219
+ "type": "array",
220
+ "items": {
221
+ "$ref": "#/components/schemas/OptionsRef"
222
+ },
223
+ "description": "Configuration values for the app components"
224
+ }
225
+ }
225
226
  }
226
227
  }
227
228
  }
@@ -242,7 +243,7 @@
242
243
  }
243
244
  },
244
245
  "schemas": {
245
- "ConfigurationOptions": {
246
+ "Options": {
246
247
  "type": "object",
247
248
  "description": "Options for the component configuration",
248
249
  "required": [
@@ -258,14 +259,14 @@
258
259
  "type": "string",
259
260
  "description": "Human-readable label for the configuration option"
260
261
  },
262
+ "required": {
263
+ "type": "boolean",
264
+ "description": "Flag to indicate if this option is required"
265
+ },
261
266
  "description": {
262
267
  "type": "string",
263
268
  "description": "Detailed description of what this configuration option does"
264
269
  },
265
- "value": {
266
- "type": "string",
267
- "description": "The configured value (only used in App installation)"
268
- },
269
270
  "type": {
270
271
  "type": "string",
271
272
  "enum": [
@@ -274,11 +275,42 @@
274
275
  "boolean",
275
276
  "secret"
276
277
  ]
278
+ }
279
+ }
280
+ },
281
+ "Option": {
282
+ "type": "object",
283
+ "required": [
284
+ "key",
285
+ "value"
286
+ ],
287
+ "properties": {
288
+ "key": {
289
+ "type": "string",
290
+ "description": "Key matching a config_option from the component"
277
291
  },
278
- "required": {
279
- "type": "boolean",
280
- "default": false,
281
- "description": "Whether this configuration option must be set"
292
+ "value": {
293
+ "type": "string",
294
+ "description": "The configured value for this option"
295
+ }
296
+ }
297
+ },
298
+ "OptionsRef": {
299
+ "type": "object",
300
+ "required": [
301
+ "component_id",
302
+ "options"
303
+ ],
304
+ "properties": {
305
+ "component_id": {
306
+ "type": "string",
307
+ "description": "ID of the component these values are for"
308
+ },
309
+ "options": {
310
+ "type": "array",
311
+ "items": {
312
+ "$ref": "#/components/schemas/Option"
313
+ }
282
314
  }
283
315
  }
284
316
  },
@@ -356,12 +388,12 @@
356
388
  "type": "string",
357
389
  "description": "Unique identifier for the component"
358
390
  },
359
- "config_options": {
391
+ "options": {
360
392
  "type": "array",
361
393
  "items": {
362
- "$ref": "#/components/schemas/ConfigurationOptions"
394
+ "$ref": "#/components/schemas/Options"
363
395
  },
364
- "description": "List of required options for the app component"
396
+ "description": "List of options for the app component"
365
397
  }
366
398
  }
367
399
  },
@@ -403,6 +435,13 @@
403
435
  "PORTAL_EXTENSION"
404
436
  ]
405
437
  },
438
+ "origin": {
439
+ "type": "string",
440
+ "enum": [
441
+ "END_CUSTOMER_PORTAL",
442
+ "INSTALLER_PORTAL"
443
+ ]
444
+ },
406
445
  "configuration": {
407
446
  "$ref": "#/components/schemas/PortalExtensionConfig"
408
447
  }
@@ -536,12 +575,13 @@
536
575
  "JourneyBlockConfig": {
537
576
  "type": "object",
538
577
  "required": [
539
- "bundleS3ref",
578
+ "component_url",
540
579
  "componentTag"
541
580
  ],
542
581
  "properties": {
543
- "bundle_s3Ref": {
544
- "$ref": "#/components/schemas/S3Reference"
582
+ "component_url": {
583
+ "type": "string",
584
+ "description": "URL of the web component object"
545
585
  },
546
586
  "component_tag": {
547
587
  "type": "string",
@@ -578,25 +618,28 @@
578
618
  "description": "User ID of the user who installed the app",
579
619
  "readOnly": true
580
620
  },
621
+ "updated_by": {
622
+ "type": "string",
623
+ "description": "User ID of the user who last updated the app",
624
+ "readOnly": true
625
+ },
626
+ "updated_at": {
627
+ "type": "string",
628
+ "description": "Timestamp of the last update",
629
+ "readOnly": true
630
+ },
581
631
  "enabled": {
632
+ "readOnly": true,
582
633
  "type": "boolean",
583
634
  "default": true,
584
635
  "description": "Flag to indicate if the app is enabled."
585
636
  },
586
- "config_values": {
587
- "type": "object",
588
- "properties": {
589
- "component_id": {
590
- "type": "string"
591
- },
592
- "options": {
593
- "type": "array",
594
- "items": {
595
- "$ref": "#/components/schemas/ConfigurationOptions"
596
- }
597
- }
598
- },
599
- "description": "Configuration values for the app components"
637
+ "option_values": {
638
+ "description": "Configuration values for the app components options",
639
+ "type": "array",
640
+ "items": {
641
+ "$ref": "#/components/schemas/OptionsRef"
642
+ }
600
643
  }
601
644
  }
602
645
  },
@@ -619,11 +662,8 @@
619
662
  "description": "URL of the app documentation."
620
663
  },
621
664
  "description": {
622
- "type": "string"
623
- },
624
- "app_s3ref": {
625
- "description": "Link to the bundle (.zip) which contains all the app relevant assets",
626
- "$ref": "#/components/schemas/S3Reference"
665
+ "type": "string",
666
+ "description": "Markdown description of the app."
627
667
  },
628
668
  "created_by": {
629
669
  "type": "string",
@@ -637,6 +677,10 @@
637
677
  "type": "string",
638
678
  "readOnly": true
639
679
  },
680
+ "updated_by": {
681
+ "type": "string",
682
+ "readOnly": true
683
+ },
640
684
  "version": {
641
685
  "type": "string",
642
686
  "readOnly": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/app-client",
3
- "version": "0.0.1",
3
+ "version": "0.0.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",