@epilot/app-client 0.0.1 → 0.0.2

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
+ config_values?: Schemas.ComponentConfigValues[];
18
+ }
14
19
  }
15
20
  namespace Schemas {
16
21
  /**
@@ -27,8 +32,10 @@ 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;
34
41
  updated_at?: string;
@@ -71,10 +78,7 @@ declare namespace Components {
71
78
  /**
72
79
  * Configuration values for the app components
73
80
  */
74
- config_values?: {
75
- component_id?: string;
76
- options?: /* Options for the component configuration */ ConfigurationOptions[];
77
- };
81
+ config_values?: ComponentConfigValues[];
78
82
  }
79
83
  /**
80
84
  * Configuration of the published app
@@ -90,11 +94,10 @@ declare namespace Components {
90
94
  * URL of the app documentation.
91
95
  */
92
96
  documentation_url?: string;
93
- description?: string;
94
97
  /**
95
- * Link to the bundle (.zip) which contains all the app relevant assets
98
+ * Markdown description of the app.
96
99
  */
97
- app_s3ref?: S3Reference;
100
+ description?: string;
98
101
  created_by?: string;
99
102
  created_at?: string;
100
103
  updated_at?: string;
@@ -192,6 +195,23 @@ declare namespace Components {
192
195
  */
193
196
  token_id?: string;
194
197
  }
198
+ export interface ComponentConfigValue {
199
+ /**
200
+ * Key matching a config_option from the component
201
+ */
202
+ key: string;
203
+ /**
204
+ * The configured value for this option
205
+ */
206
+ value: string;
207
+ }
208
+ export interface ComponentConfigValues {
209
+ /**
210
+ * ID of the component these values are for
211
+ */
212
+ component_id: string;
213
+ options: ComponentConfigValue[];
214
+ }
195
215
  /**
196
216
  * Type of app component
197
217
  */
@@ -212,18 +232,13 @@ declare namespace Components {
212
232
  * Detailed description of what this configuration option does
213
233
  */
214
234
  description?: string;
215
- /**
216
- * The configured value (only used in App installation)
217
- */
218
- value?: string;
219
235
  type: "string" | "number" | "boolean" | "secret";
220
- /**
221
- * Whether this configuration option must be set
222
- */
223
- required?: boolean;
224
236
  }
225
237
  export interface JourneyBlockConfig {
226
- bundle_s3Ref?: S3Reference;
238
+ /**
239
+ * URL of the web component object
240
+ */
241
+ object_url: string;
227
242
  /**
228
243
  * Custom element tag for the component
229
244
  */
@@ -294,6 +309,13 @@ declare namespace Components {
294
309
  }
295
310
  }
296
311
  declare namespace Paths {
312
+ namespace GetAppConfiguration {
313
+ namespace Responses {
314
+ export type $200 = /* Configuration of the published app */ Components.Schemas.AppConfiguration;
315
+ export interface $404 {
316
+ }
317
+ }
318
+ }
297
319
  namespace GetInstalledApp {
298
320
  namespace Parameters {
299
321
  export type AppId = string;
@@ -358,33 +380,27 @@ declare namespace Paths {
358
380
  }
359
381
  }
360
382
  }
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
- }
383
+ namespace V1AppConfigurations$AppId {
384
+ namespace Parameters {
385
+ export type AppId = string;
386
+ }
387
+ export interface PathParameters {
388
+ appId: Parameters.AppId;
372
389
  }
373
390
  }
374
391
  }
375
392
 
376
393
  export interface OperationMethods {
377
394
  /**
378
- * uploadManifest - uploadManifest
379
- *
380
- * Create pre-signed S3 URL to upload a manifest file.
395
+ * getAppConfiguration - getAppConfiguration
381
396
  *
397
+ * Retrieve a specific app configuration
382
398
  */
383
- 'uploadManifest'(
384
- parameters?: Parameters<UnknownParamsObject> | null,
385
- data?: Paths.UploadManifest.RequestBody,
399
+ 'getAppConfiguration'(
400
+ parameters?: Parameters<Paths.V1AppConfigurations$AppId.PathParameters> | null,
401
+ data?: any,
386
402
  config?: AxiosRequestConfig
387
- ): OperationResponse<Paths.UploadManifest.Responses.$201>
403
+ ): OperationResponse<Paths.GetAppConfiguration.Responses.$200>
388
404
  /**
389
405
  * listInstalledApps - listInstalledApps
390
406
  *
@@ -428,18 +444,17 @@ export interface OperationMethods {
428
444
  }
429
445
 
430
446
  export interface PathsDictionary {
431
- ['/v1/app:uploadManifest']: {
447
+ ['/v1/app-configurations/{appId}']: {
432
448
  /**
433
- * uploadManifest - uploadManifest
434
- *
435
- * Create pre-signed S3 URL to upload a manifest file.
449
+ * getAppConfiguration - getAppConfiguration
436
450
  *
451
+ * Retrieve a specific app configuration
437
452
  */
438
- 'post'(
439
- parameters?: Parameters<UnknownParamsObject> | null,
440
- data?: Paths.UploadManifest.RequestBody,
453
+ 'get'(
454
+ parameters?: Parameters<Paths.V1AppConfigurations$AppId.PathParameters> | null,
455
+ data?: any,
441
456
  config?: AxiosRequestConfig
442
- ): OperationResponse<Paths.UploadManifest.Responses.$201>
457
+ ): OperationResponse<Paths.GetAppConfiguration.Responses.$200>
443
458
  }
444
459
  ['/v1/app']: {
445
460
  /**
@@ -495,6 +510,8 @@ export type Author = Components.Schemas.Author;
495
510
  export type BaseComponent = Components.Schemas.BaseComponent;
496
511
  export type BaseComponentCommon = Components.Schemas.BaseComponentCommon;
497
512
  export type CallerIdentity = Components.Schemas.CallerIdentity;
513
+ export type ComponentConfigValue = Components.Schemas.ComponentConfigValue;
514
+ export type ComponentConfigValues = Components.Schemas.ComponentConfigValues;
498
515
  export type ComponentType = Components.Schemas.ComponentType;
499
516
  export type ConfigurationOptions = Components.Schemas.ConfigurationOptions;
500
517
  export type JourneyBlockConfig = Components.Schemas.JourneyBlockConfig;
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
  }
@@ -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
+ "config_values": {
219
+ "type": "array",
220
+ "items": {
221
+ "$ref": "#/components/schemas/ComponentConfigValues"
222
+ },
223
+ "description": "Configuration values for the app components"
224
+ }
225
+ }
225
226
  }
226
227
  }
227
228
  }
@@ -262,10 +263,6 @@
262
263
  "type": "string",
263
264
  "description": "Detailed description of what this configuration option does"
264
265
  },
265
- "value": {
266
- "type": "string",
267
- "description": "The configured value (only used in App installation)"
268
- },
269
266
  "type": {
270
267
  "type": "string",
271
268
  "enum": [
@@ -274,11 +271,42 @@
274
271
  "boolean",
275
272
  "secret"
276
273
  ]
274
+ }
275
+ }
276
+ },
277
+ "ComponentConfigValue": {
278
+ "type": "object",
279
+ "required": [
280
+ "key",
281
+ "value"
282
+ ],
283
+ "properties": {
284
+ "key": {
285
+ "type": "string",
286
+ "description": "Key matching a config_option from the component"
277
287
  },
278
- "required": {
279
- "type": "boolean",
280
- "default": false,
281
- "description": "Whether this configuration option must be set"
288
+ "value": {
289
+ "type": "string",
290
+ "description": "The configured value for this option"
291
+ }
292
+ }
293
+ },
294
+ "ComponentConfigValues": {
295
+ "type": "object",
296
+ "required": [
297
+ "component_id",
298
+ "options"
299
+ ],
300
+ "properties": {
301
+ "component_id": {
302
+ "type": "string",
303
+ "description": "ID of the component these values are for"
304
+ },
305
+ "options": {
306
+ "type": "array",
307
+ "items": {
308
+ "$ref": "#/components/schemas/ComponentConfigValue"
309
+ }
282
310
  }
283
311
  }
284
312
  },
@@ -536,12 +564,13 @@
536
564
  "JourneyBlockConfig": {
537
565
  "type": "object",
538
566
  "required": [
539
- "bundleS3ref",
567
+ "object_url",
540
568
  "componentTag"
541
569
  ],
542
570
  "properties": {
543
- "bundle_s3Ref": {
544
- "$ref": "#/components/schemas/S3Reference"
571
+ "object_url": {
572
+ "type": "string",
573
+ "description": "URL of the web component object"
545
574
  },
546
575
  "component_tag": {
547
576
  "type": "string",
@@ -579,24 +608,17 @@
579
608
  "readOnly": true
580
609
  },
581
610
  "enabled": {
611
+ "readOnly": true,
582
612
  "type": "boolean",
583
613
  "default": true,
584
614
  "description": "Flag to indicate if the app is enabled."
585
615
  },
586
616
  "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"
617
+ "description": "Configuration values for the app components",
618
+ "type": "array",
619
+ "items": {
620
+ "$ref": "#/components/schemas/ComponentConfigValues"
621
+ }
600
622
  }
601
623
  }
602
624
  },
@@ -619,11 +641,8 @@
619
641
  "description": "URL of the app documentation."
620
642
  },
621
643
  "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"
644
+ "type": "string",
645
+ "description": "Markdown description of the app."
627
646
  },
628
647
  "created_by": {
629
648
  "type": "string",
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.2",
4
4
  "description": "JavaScript client library for the epilot App API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",