@epilot/customer-portal-client 0.1.9 → 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.
@@ -1 +1 @@
1
- !function(e,t){for(var r in t)e[r]=t[r];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(279));t.default=o.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Customer Portal API","description":"Backend for epilot end customer portals","version":"1.0.0"},"tags":[{"name":"mock","description":"Mock endpoints"}],"security":[{"CustomerPortalAuth":[]},{"AsOrganization":[]},{"AsBrand":[]},{"AsCustomer":[]}],"paths":{"/v1/customer-portal/auth":{"get":{"operationId":"testAuth","summary":"testAuth","description":"TODO","tags":["mock"],"responses":{"200":{"description":"ok"}}}},"/v1/customer-portal/public/config":{"get":{"operationId":"getPortalConfig","summary":"getPortalConfig","description":"TODO","tags":["mock"],"security":[],"parameters":[{"in":"query","name":"domain","required":true,"schema":{"type":"string","example":"exmaple.com"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"auth_config":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]}}}}}}}}},"/v1/customer-portal/info":{"get":{"operationId":"getCustomerInfo","summary":"getCustomerInfo","description":"TODO","tags":["mock"],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"object","properties":{"street":{"type":"string","example":"Melatengurtel"},"street_number":{"type":"string","example":"71"},"city":{"type":"string","example":"Koln"}}}}}}}}}}},"/v1/customer-portal/public/register/exists":{"get":{"operationId":"userExists","summary":"userExists","description":"Checks whether a user exists in the customer portal","tags":["mock"],"security":[],"parameters":[{"in":"query","name":"username","required":false,"schema":{"type":"string","example":"user@example.com"}},{"in":"query","name":"customerId","required":false,"schema":{"type":"string","example":12345678}}],"responses":{"200":{"description":"User exists in the portal","content":{"application/json":{"schema":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}},"404":{"description":"User does not exist in the portal","content":{"application/json":{"schema":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}}}}}},"components":{"securitySchemes":{"CustomerPortalAuth":{"type":"http","scheme":"bearer","description":"Customer Portal Cognito Token"},"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id as internal user"},"AsBrand":{"type":"apiKey","in":"header","name":"x-ivy-brand-id","description":"Set brand id as internal user"},"AsContact":{"type":"apiKey","in":"header","name":"x-contact-id","description":"Set contact id as internal user"},"AsCustomer":{"type":"apiKey","in":"header","name":"x-portal-id","description":"Set portal id as customer"}},"schemas":{"PortalConfig":{"type":"object","properties":{"auth_config":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]}}},"AuthConfig":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]},"Exists":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}}')}},t={};return function r(i){if(t[i])return t[i].exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.exports}(914)})());
1
+ !function(e,t){for(var r in t)e[r]=t[r];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(r(279));t.default=s.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"Customer Portal API","description":"Backend for epilot end customer portals","version":"1.0.0"},"tags":[{"name":"mock","description":"Mock endpoints"}],"security":[{"CustomerPortalAuth":[]},{"AsOrganization":[]},{"AsBrand":[]},{"AsCustomer":[]}],"paths":{"/v1/customer-portal/auth":{"get":{"operationId":"testAuth","summary":"testAuth","description":"TODO","tags":["mock"],"responses":{"200":{"description":"ok"}}}},"/v1/customer-portal/portal":{"post":{"operationId":"createPortal","summary":"creates a portal","description":"Creates a portal and db item","tags":["mock"],"requestBody":{"description":"Portal payload","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userpool_name":{"type":"string","example":"testing-pool"},"config":{"type":"object","properties":{"domain":{"type":"string","example":"example.com"},"styleId":{"type":"string","example":"af1198c0-3a9b-11eb-b62d-0ff2447a94d8"}}}}}}}},"responses":{"201":{"description":"Success - portal created with success.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Validation Errors","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Authentication Errors","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"500":{"description":"Other errors","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/v1/customer-portal/public/config":{"get":{"operationId":"getPortalConfig","summary":"getPortalConfig","description":"TODO","tags":["mock"],"security":[],"parameters":[{"in":"query","name":"domain","required":true,"schema":{"type":"string","example":"exmaple.com"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"auth_config":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]}}}}}}}}},"/v1/customer-portal/info":{"get":{"operationId":"getCustomerInfo","summary":"getCustomerInfo","description":"TODO","tags":["mock"],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"object","properties":{"street":{"type":"string","example":"Melatengurtel"},"street_number":{"type":"string","example":"71"},"city":{"type":"string","example":"Koln"}}}}}}}}}}},"/v1/customer-portal/public/register/exists":{"get":{"operationId":"userExists","summary":"userExists","description":"Checks whether a user exists in the customer portal","tags":["mock"],"security":[],"parameters":[{"in":"query","name":"username","required":false,"schema":{"type":"string","example":"user@example.com"}},{"in":"query","name":"customerId","required":false,"schema":{"type":"string","example":12345678}}],"responses":{"200":{"description":"User exists in the portal","content":{"application/json":{"schema":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}},"404":{"description":"User does not exist in the portal","content":{"application/json":{"schema":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}}}}}},"components":{"securitySchemes":{"CustomerPortalAuth":{"type":"http","scheme":"bearer","description":"Customer Portal Cognito Token"},"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id as internal user"},"AsBrand":{"type":"apiKey","in":"header","name":"x-ivy-brand-id","description":"Set brand id as internal user"},"AsContact":{"type":"apiKey","in":"header","name":"x-contact-id","description":"Set contact id as internal user"},"AsCustomer":{"type":"apiKey","in":"header","name":"x-portal-id","description":"Set portal id as customer"}},"schemas":{"PortalConfig":{"type":"object","properties":{"auth_config":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]}}},"ErrorResp":{"type":"object","properties":{"message":{"type":"string"}}},"AddPortalResp":{"type":"object","properties":{"message":{"type":"string"}}},"AuthConfig":{"type":"object","properties":{"user_pool_id":{"type":"string","example":"eu-central-1_CUEQRNbUb"},"user_pool_client_id":{"type":"string","example":"6bsd0jkgoie74k2i8mrhc1vest"},"user_pool_identity_pool_id":{"type":"string","example":"eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1"},"portal_id":{"type":"string","example":"7h2hwdj7hhjsdcjkq03eidna3ep"}},"required":["user_pool_id","user_pool_client_id","portal_id"]},"Exists":{"type":"object","required":["exists"],"properties":{"exists":{"type":"boolean"},"active":{"type":"boolean"}},"example":{"exists":true,"active":false}}}}}')}},t={};return function r(o){if(t[o])return t[o].exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,r),s.exports}(914)})());
package/dist/openapi.d.ts CHANGED
@@ -9,6 +9,9 @@ import {
9
9
 
10
10
  declare namespace Components {
11
11
  namespace Schemas {
12
+ export interface AddPortalResp {
13
+ message?: string;
14
+ }
12
15
  export interface AuthConfig {
13
16
  /**
14
17
  * example:
@@ -31,6 +34,9 @@ declare namespace Components {
31
34
  */
32
35
  portal_id: string;
33
36
  }
37
+ export interface ErrorResp {
38
+ message?: string;
39
+ }
34
40
  /**
35
41
  * example:
36
42
  * {
@@ -48,6 +54,33 @@ declare namespace Components {
48
54
  }
49
55
  }
50
56
  declare namespace Paths {
57
+ namespace CreatePortal {
58
+ export interface RequestBody {
59
+ /**
60
+ * example:
61
+ * testing-pool
62
+ */
63
+ userpool_name?: string;
64
+ config?: {
65
+ /**
66
+ * example:
67
+ * example.com
68
+ */
69
+ domain?: string;
70
+ /**
71
+ * example:
72
+ * af1198c0-3a9b-11eb-b62d-0ff2447a94d8
73
+ */
74
+ styleId?: string;
75
+ };
76
+ }
77
+ namespace Responses {
78
+ export type $201 = Components.Schemas.AddPortalResp;
79
+ export type $400 = Components.Schemas.ErrorResp;
80
+ export type $401 = Components.Schemas.ErrorResp;
81
+ export type $500 = Components.Schemas.ErrorResp;
82
+ }
83
+ }
51
84
  namespace GetCustomerInfo {
52
85
  namespace Responses {
53
86
  export interface $200 {
@@ -121,6 +154,16 @@ export interface OperationMethods {
121
154
  data?: any,
122
155
  config?: AxiosRequestConfig
123
156
  ): OperationResponse<any>
157
+ /**
158
+ * createPortal - creates a portal
159
+ *
160
+ * Creates a portal and db item
161
+ */
162
+ 'createPortal'(
163
+ parameters?: Parameters<UnknownParamsObject> | null,
164
+ data?: Paths.CreatePortal.RequestBody,
165
+ config?: AxiosRequestConfig
166
+ ): OperationResponse<Paths.CreatePortal.Responses.$201 | Paths.CreatePortal.Responses.$400 | Paths.CreatePortal.Responses.$401 | Paths.CreatePortal.Responses.$500>
124
167
  /**
125
168
  * getPortalConfig - getPortalConfig
126
169
  *
@@ -166,6 +209,18 @@ export interface PathsDictionary {
166
209
  config?: AxiosRequestConfig
167
210
  ): OperationResponse<any>
168
211
  }
212
+ ['/v1/customer-portal/portal']: {
213
+ /**
214
+ * createPortal - creates a portal
215
+ *
216
+ * Creates a portal and db item
217
+ */
218
+ 'post'(
219
+ parameters?: Parameters<UnknownParamsObject> | null,
220
+ data?: Paths.CreatePortal.RequestBody,
221
+ config?: AxiosRequestConfig
222
+ ): OperationResponse<Paths.CreatePortal.Responses.$201 | Paths.CreatePortal.Responses.$400 | Paths.CreatePortal.Responses.$401 | Paths.CreatePortal.Responses.$500>
223
+ }
169
224
  ['/v1/customer-portal/public/config']: {
170
225
  /**
171
226
  * getPortalConfig - getPortalConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/customer-portal-client",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "API Client for epilot customer-portal API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,262 @@
1
+ /* eslint-disable */
2
+ import {
3
+ OpenAPIClient,
4
+ Parameters,
5
+ UnknownParamsObject,
6
+ OperationResponse,
7
+ AxiosRequestConfig,
8
+ } from 'openapi-client-axios';
9
+
10
+ declare namespace Components {
11
+ namespace Schemas {
12
+ export interface AddPortalResp {
13
+ message?: string;
14
+ }
15
+ export interface AuthConfig {
16
+ /**
17
+ * example:
18
+ * eu-central-1_CUEQRNbUb
19
+ */
20
+ user_pool_id: string;
21
+ /**
22
+ * example:
23
+ * 6bsd0jkgoie74k2i8mrhc1vest
24
+ */
25
+ user_pool_client_id: string;
26
+ /**
27
+ * example:
28
+ * eu-central-1:a63af1f7-ab86-4ab5-a0eb-f461cb37c2b1
29
+ */
30
+ user_pool_identity_pool_id?: string;
31
+ /**
32
+ * example:
33
+ * 7h2hwdj7hhjsdcjkq03eidna3ep
34
+ */
35
+ portal_id: string;
36
+ }
37
+ export interface ErrorResp {
38
+ message?: string;
39
+ }
40
+ /**
41
+ * example:
42
+ * {
43
+ * "exists": true,
44
+ * "active": false
45
+ * }
46
+ */
47
+ export interface Exists {
48
+ exists: boolean;
49
+ active?: boolean;
50
+ }
51
+ export interface PortalConfig {
52
+ auth_config?: AuthConfig;
53
+ }
54
+ }
55
+ }
56
+ declare namespace Paths {
57
+ namespace CreatePortal {
58
+ export interface RequestBody {
59
+ /**
60
+ * example:
61
+ * testing-pool
62
+ */
63
+ userpool_name?: string;
64
+ config?: {
65
+ /**
66
+ * example:
67
+ * example.com
68
+ */
69
+ domain?: string;
70
+ /**
71
+ * example:
72
+ * af1198c0-3a9b-11eb-b62d-0ff2447a94d8
73
+ */
74
+ styleId?: string;
75
+ };
76
+ }
77
+ namespace Responses {
78
+ export type $201 = Components.Schemas.AddPortalResp;
79
+ export type $400 = Components.Schemas.ErrorResp;
80
+ export type $401 = Components.Schemas.ErrorResp;
81
+ export type $500 = Components.Schemas.ErrorResp;
82
+ }
83
+ }
84
+ namespace GetCustomerInfo {
85
+ namespace Responses {
86
+ export interface $200 {
87
+ address?: {
88
+ /**
89
+ * example:
90
+ * Melatengurtel
91
+ */
92
+ street?: string;
93
+ /**
94
+ * example:
95
+ * 71
96
+ */
97
+ street_number?: string;
98
+ /**
99
+ * example:
100
+ * Koln
101
+ */
102
+ city?: string;
103
+ };
104
+ }
105
+ }
106
+ }
107
+ namespace GetPortalConfig {
108
+ namespace Parameters {
109
+ /**
110
+ * example:
111
+ * exmaple.com
112
+ */
113
+ export type Domain = string;
114
+ }
115
+ export interface QueryParameters {
116
+ domain: Parameters.Domain;
117
+ }
118
+ namespace Responses {
119
+ export type $200 = Components.Schemas.PortalConfig;
120
+ }
121
+ }
122
+ namespace UserExists {
123
+ namespace Parameters {
124
+ /**
125
+ * example:
126
+ * 12345678
127
+ */
128
+ export type CustomerId = string;
129
+ /**
130
+ * example:
131
+ * user@example.com
132
+ */
133
+ export type Username = string;
134
+ }
135
+ export interface QueryParameters {
136
+ username?: Parameters.Username;
137
+ customerId?: Parameters.CustomerId;
138
+ }
139
+ namespace Responses {
140
+ export type $200 = Components.Schemas.Exists;
141
+ export type $404 = Components.Schemas.Exists;
142
+ }
143
+ }
144
+ }
145
+
146
+ export interface OperationMethods {
147
+ /**
148
+ * testAuth - testAuth
149
+ *
150
+ * TODO
151
+ */
152
+ 'testAuth'(
153
+ parameters?: Parameters<UnknownParamsObject> | null,
154
+ data?: any,
155
+ config?: AxiosRequestConfig
156
+ ): OperationResponse<any>
157
+ /**
158
+ * createPortal - creates a portal
159
+ *
160
+ * Creates a portal and db item
161
+ */
162
+ 'createPortal'(
163
+ parameters?: Parameters<UnknownParamsObject> | null,
164
+ data?: Paths.CreatePortal.RequestBody,
165
+ config?: AxiosRequestConfig
166
+ ): OperationResponse<Paths.CreatePortal.Responses.$201 | Paths.CreatePortal.Responses.$400 | Paths.CreatePortal.Responses.$401 | Paths.CreatePortal.Responses.$500>
167
+ /**
168
+ * getPortalConfig - getPortalConfig
169
+ *
170
+ * TODO
171
+ */
172
+ 'getPortalConfig'(
173
+ parameters?: Parameters<Paths.GetPortalConfig.QueryParameters> | null,
174
+ data?: any,
175
+ config?: AxiosRequestConfig
176
+ ): OperationResponse<Paths.GetPortalConfig.Responses.$200>
177
+ /**
178
+ * getCustomerInfo - getCustomerInfo
179
+ *
180
+ * TODO
181
+ */
182
+ 'getCustomerInfo'(
183
+ parameters?: Parameters<UnknownParamsObject> | null,
184
+ data?: any,
185
+ config?: AxiosRequestConfig
186
+ ): OperationResponse<Paths.GetCustomerInfo.Responses.$200>
187
+ /**
188
+ * userExists - userExists
189
+ *
190
+ * Checks whether a user exists in the customer portal
191
+ */
192
+ 'userExists'(
193
+ parameters?: Parameters<Paths.UserExists.QueryParameters> | null,
194
+ data?: any,
195
+ config?: AxiosRequestConfig
196
+ ): OperationResponse<Paths.UserExists.Responses.$200 | Paths.UserExists.Responses.$404>
197
+ }
198
+
199
+ export interface PathsDictionary {
200
+ ['/v1/customer-portal/auth']: {
201
+ /**
202
+ * testAuth - testAuth
203
+ *
204
+ * TODO
205
+ */
206
+ 'get'(
207
+ parameters?: Parameters<UnknownParamsObject> | null,
208
+ data?: any,
209
+ config?: AxiosRequestConfig
210
+ ): OperationResponse<any>
211
+ }
212
+ ['/v1/customer-portal/portal']: {
213
+ /**
214
+ * createPortal - creates a portal
215
+ *
216
+ * Creates a portal and db item
217
+ */
218
+ 'post'(
219
+ parameters?: Parameters<UnknownParamsObject> | null,
220
+ data?: Paths.CreatePortal.RequestBody,
221
+ config?: AxiosRequestConfig
222
+ ): OperationResponse<Paths.CreatePortal.Responses.$201 | Paths.CreatePortal.Responses.$400 | Paths.CreatePortal.Responses.$401 | Paths.CreatePortal.Responses.$500>
223
+ }
224
+ ['/v1/customer-portal/public/config']: {
225
+ /**
226
+ * getPortalConfig - getPortalConfig
227
+ *
228
+ * TODO
229
+ */
230
+ 'get'(
231
+ parameters?: Parameters<Paths.GetPortalConfig.QueryParameters> | null,
232
+ data?: any,
233
+ config?: AxiosRequestConfig
234
+ ): OperationResponse<Paths.GetPortalConfig.Responses.$200>
235
+ }
236
+ ['/v1/customer-portal/info']: {
237
+ /**
238
+ * getCustomerInfo - getCustomerInfo
239
+ *
240
+ * TODO
241
+ */
242
+ 'get'(
243
+ parameters?: Parameters<UnknownParamsObject> | null,
244
+ data?: any,
245
+ config?: AxiosRequestConfig
246
+ ): OperationResponse<Paths.GetCustomerInfo.Responses.$200>
247
+ }
248
+ ['/v1/customer-portal/public/register/exists']: {
249
+ /**
250
+ * userExists - userExists
251
+ *
252
+ * Checks whether a user exists in the customer portal
253
+ */
254
+ 'get'(
255
+ parameters?: Parameters<Paths.UserExists.QueryParameters> | null,
256
+ data?: any,
257
+ config?: AxiosRequestConfig
258
+ ): OperationResponse<Paths.UserExists.Responses.$200 | Paths.UserExists.Responses.$404>
259
+ }
260
+ }
261
+
262
+ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>