@epilot/customer-portal-client 0.13.1 → 0.15.0-alpha

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/customer-portal-client",
3
- "version": "0.13.1",
3
+ "version": "0.15.0-alpha",
4
4
  "description": "API Client for epilot portal API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -70,4 +70,4 @@
70
70
  "webpack": "^5.18.0",
71
71
  "webpack-cli": "^4.4.0"
72
72
  }
73
- }
73
+ }
@@ -41,6 +41,11 @@
41
41
  }
42
42
  }
43
43
  },
44
+ "/v2/portal/token/validate": {
45
+ "post": {
46
+ "operationId": "validateToken"
47
+ }
48
+ },
44
49
  "/v2/portal/token/revoke": {
45
50
  "post": {
46
51
  "operationId": "revokeToken",
@@ -264,6 +269,7 @@
264
269
  "/v2/portal/contact/email/count": {
265
270
  "get": {
266
271
  "operationId": "getCountByEmail",
272
+ "deprecated": true,
267
273
  "parameters": [
268
274
  {
269
275
  "in": "query",
@@ -593,6 +599,17 @@
593
599
  }
594
600
  }
595
601
  },
602
+ "/v2/portal/contract/by-identifiers": {
603
+ "post": {
604
+ "operationId": "getContractByIdentifiers",
605
+ "requestBody": {
606
+ "required": true,
607
+ "content": {
608
+ "application/json": {}
609
+ }
610
+ }
611
+ }
612
+ },
596
613
  "/v2/portal/entity/identifiers/{slug}": {
597
614
  "get": {
598
615
  "operationId": "getEntityIdentifiers",
@@ -608,6 +625,7 @@
608
625
  "/v2/portal/entity/by-identifiers/{slug}": {
609
626
  "post": {
610
627
  "operationId": "getEntitiesByIdentifiers",
628
+ "deprecated": true,
611
629
  "parameters": [
612
630
  {
613
631
  "in": "path",
package/src/openapi.json CHANGED
@@ -155,6 +155,32 @@
155
155
  }
156
156
  }
157
157
  },
158
+ "/v2/portal/token/validate": {
159
+ "post": {
160
+ "operationId": "validateToken",
161
+ "summary": "validateToken",
162
+ "description": "Validates Portal Token is valid. Pass the token via Authorization Header.",
163
+ "tags": [
164
+ "ECP"
165
+ ],
166
+ "security": [
167
+ {
168
+ "PortalAuth": []
169
+ }
170
+ ],
171
+ "responses": {
172
+ "204": {
173
+ "description": "Tokens is valid for the given organization."
174
+ },
175
+ "401": {
176
+ "$ref": "#/components/responses/Unauthorized"
177
+ },
178
+ "500": {
179
+ "$ref": "#/components/responses/InternalServerError"
180
+ }
181
+ }
182
+ }
183
+ },
158
184
  "/v2/portal/token/revoke": {
159
185
  "post": {
160
186
  "operationId": "revokeToken",
@@ -849,9 +875,8 @@
849
875
  "type": "object",
850
876
  "properties": {
851
877
  "_id": {
852
- "type": "string",
853
- "example": "7aa44fb8-d60e-40cc-9a3a-ba09a1ff7f51",
854
- "description": "ID of the contact"
878
+ "$ref": "#/components/schemas/EntityId",
879
+ "description": "ID of the entity"
855
880
  },
856
881
  "is_main_entity": {
857
882
  "type": "boolean"
@@ -1198,9 +1223,7 @@
1198
1223
  "name": "id",
1199
1224
  "required": true,
1200
1225
  "schema": {
1201
- "description": "ID of the mapped contact",
1202
- "type": "string",
1203
- "example": 1234
1226
+ "$ref": "#/components/schemas/EntityId"
1204
1227
  }
1205
1228
  }
1206
1229
  ],
@@ -1239,7 +1262,8 @@
1239
1262
  "get": {
1240
1263
  "operationId": "getCountByEmail",
1241
1264
  "summary": "getCountByEmail",
1242
- "description": "Check Contact by email",
1265
+ "deprecated": true,
1266
+ "description": "Check Contact by email. Deprecated in favor of /contact/exists.",
1243
1267
  "tags": [
1244
1268
  "Public"
1245
1269
  ],
@@ -1295,7 +1319,7 @@
1295
1319
  "deprecated": true,
1296
1320
  "operationId": "getContactCount",
1297
1321
  "summary": "getContactCount",
1298
- "description": "Return number of contacts matching identifier values.",
1322
+ "description": "Return number of contacts matching identifier values. Deprecated in favor of /contact/exists.",
1299
1323
  "security": [],
1300
1324
  "tags": [
1301
1325
  "Public"
@@ -1759,9 +1783,6 @@
1759
1783
  "type": "boolean",
1760
1784
  "description": "Whether the user exists in the portal",
1761
1785
  "example": true
1762
- },
1763
- "user": {
1764
- "$ref": "#/components/schemas/PortalUser"
1765
1786
  }
1766
1787
  }
1767
1788
  }
@@ -1808,8 +1829,7 @@
1808
1829
  }
1809
1830
  },
1810
1831
  "template_id": {
1811
- "type": "string",
1812
- "example": "d11eb11a-c4cf-4365-8a92-e7c05f61cde4",
1832
+ "$ref": "#/components/schemas/EntityId",
1813
1833
  "description": "Email template ID that used on the automation"
1814
1834
  }
1815
1835
  }
@@ -1844,9 +1864,8 @@
1844
1864
  "example": "john@doe.com"
1845
1865
  },
1846
1866
  "recipient_id": {
1847
- "type": "string",
1848
- "description": "ID of the recipient",
1849
- "example": "d11eb11a-c4cf-4365-8a92-e7c05f61cde4"
1867
+ "$ref": "#/components/schemas/EntityId",
1868
+ "description": "ID of the recipient"
1850
1869
  }
1851
1870
  }
1852
1871
  }
@@ -2340,7 +2359,7 @@
2340
2359
  "purposes": {
2341
2360
  "type": "array",
2342
2361
  "items": {
2343
- "type": "string"
2362
+ "$ref": "#/components/schemas/EntityId"
2344
2363
  }
2345
2364
  },
2346
2365
  "workflows": {
@@ -2751,6 +2770,69 @@
2751
2770
  }
2752
2771
  }
2753
2772
  },
2773
+ "/v2/portal/contract/by-identifiers": {
2774
+ "post": {
2775
+ "operationId": "getContractByIdentifiers",
2776
+ "summary": "getContractByIdentifiers",
2777
+ "description": "Get contract by pre-configured identifiers.",
2778
+ "tags": [
2779
+ "ECP"
2780
+ ],
2781
+ "security": [
2782
+ {
2783
+ "PortalAuth": []
2784
+ }
2785
+ ],
2786
+ "requestBody": {
2787
+ "description": "Identifiers to search by. Have to be pre-configured in Portal Configuration Permissions.",
2788
+ "required": true,
2789
+ "content": {
2790
+ "application/json": {
2791
+ "schema": {
2792
+ "$ref": "#/components/schemas/Entity",
2793
+ "example": "```json\n {\n \"name\": \"My Contract\",\n \"contract_number\": \"123\"\n }\n```\n"
2794
+ }
2795
+ }
2796
+ }
2797
+ },
2798
+ "responses": {
2799
+ "200": {
2800
+ "description": "The found contract.",
2801
+ "content": {
2802
+ "application/json": {
2803
+ "schema": {
2804
+ "type": "object",
2805
+ "properties": {
2806
+ "data": {
2807
+ "$ref": "#/components/schemas/EntityItem"
2808
+ },
2809
+ "hits": {
2810
+ "type": "number",
2811
+ "minimum": 0
2812
+ }
2813
+ },
2814
+ "required": [
2815
+ "hits"
2816
+ ]
2817
+ }
2818
+ }
2819
+ }
2820
+ },
2821
+ "400": {
2822
+ "$ref": "#/components/responses/InvalidRequest"
2823
+ },
2824
+ "401": {
2825
+ "$ref": "#/components/responses/Unauthorized"
2826
+ },
2827
+ "403": {
2828
+ "$ref": "#/components/responses/Forbidden"
2829
+ },
2830
+ "500": {
2831
+ "$ref": "#/components/responses/InternalServerError"
2832
+ }
2833
+ }
2834
+ }
2835
+ },
2754
2836
  "/v2/portal/entity/identifiers/{slug}": {
2755
2837
  "get": {
2756
2838
  "operationId": "getEntityIdentifiers",
@@ -2822,7 +2904,8 @@
2822
2904
  "post": {
2823
2905
  "operationId": "getEntitiesByIdentifiers",
2824
2906
  "summary": "getEntitiesByIdentifiers",
2825
- "description": "Get entities by identifiers by portal user",
2907
+ "deprecated": true,
2908
+ "description": "Get entities (contract) by identifiers. Deprecated in favor of /contract/by-identifiers.",
2826
2909
  "tags": [
2827
2910
  "ECP"
2828
2911
  ],
@@ -2839,7 +2922,7 @@
2839
2922
  "$ref": "#/components/schemas/EntitySlug"
2840
2923
  },
2841
2924
  "required": true,
2842
- "description": "The slug of an entity"
2925
+ "description": "The slug of the entity to search by. Currently the only supported value is 'contract'."
2843
2926
  }
2844
2927
  ],
2845
2928
  "requestBody": {
@@ -3097,8 +3180,7 @@
3097
3180
  "name": "attribute",
3098
3181
  "description": "Get activities after this timestamp",
3099
3182
  "schema": {
3100
- "type": "string",
3101
- "format": "date-time"
3183
+ "type": "string"
3102
3184
  }
3103
3185
  }
3104
3186
  ],
@@ -3329,9 +3411,8 @@
3329
3411
  "deletedFiles": {
3330
3412
  "type": "array",
3331
3413
  "items": {
3332
- "type": "string",
3333
- "description": "File ID",
3334
- "example": "00250c75-afd4-4c94-ba7a-ba0df638eba5"
3414
+ "$ref": "#/components/schemas/EntityId",
3415
+ "description": "File ID"
3335
3416
  }
3336
3417
  }
3337
3418
  }
@@ -3522,7 +3603,7 @@
3522
3603
  "schema": {
3523
3604
  "type": "array",
3524
3605
  "items": {
3525
- "type": "string"
3606
+ "$ref": "#/components/schemas/EntityId"
3526
3607
  },
3527
3608
  "example": [
3528
3609
  "4910096f-000a-4504-bf5a-d3774ec3032a",
@@ -3766,7 +3847,7 @@
3766
3847
  "schema": {
3767
3848
  "type": "array",
3768
3849
  "items": {
3769
- "type": "string"
3850
+ "$ref": "#/components/schemas/EntityId"
3770
3851
  }
3771
3852
  }
3772
3853
  },
@@ -3939,8 +4020,7 @@
3939
4020
  "required": false,
3940
4021
  "description": "Entity ID",
3941
4022
  "schema": {
3942
- "type": "string",
3943
- "example": "1e3f0d58-69d2-4dbb-9a43-3ee63d862e8e"
4023
+ "$ref": "#/components/schemas/EntityId"
3944
4024
  }
3945
4025
  },
3946
4026
  {
@@ -4251,34 +4331,28 @@
4251
4331
  "description": "Email templates used for authentication and internal processes",
4252
4332
  "properties": {
4253
4333
  "confirmAccount": {
4254
- "type": "string",
4255
- "description": "ID of the confirmation email template upon registration",
4256
- "example": "701f089d-6953-48b5-ac35-442de7c59cd3"
4334
+ "$ref": "#/components/schemas/EntityId",
4335
+ "description": "ID of the confirmation email template upon registration"
4257
4336
  },
4258
4337
  "forgotPassword": {
4259
- "type": "string",
4260
- "description": "ID of the email template for forgot password",
4261
- "example": "6538fddb-f0e9-4f0f-af51-6e57891ff20a"
4338
+ "$ref": "#/components/schemas/EntityId",
4339
+ "description": "ID of the email template for forgot password"
4262
4340
  },
4263
4341
  "invitation": {
4264
- "type": "string",
4265
- "description": "ID of the email template for invitation",
4266
- "example": "14ae65fb-0dc1-4863-8743-6bc01da469f6"
4342
+ "$ref": "#/components/schemas/EntityId",
4343
+ "description": "ID of the email template for invitation"
4267
4344
  },
4268
4345
  "onNewQuote": {
4269
- "type": "string",
4270
- "description": "ID of the email template for new quote",
4271
- "example": "b03e2b88-8f3f-4a93-8118-1fb07e9198a1"
4346
+ "$ref": "#/components/schemas/EntityId",
4347
+ "description": "ID of the email template for new quote"
4272
4348
  },
4273
4349
  "onMapAPendingUser": {
4274
- "type": "string",
4275
- "description": "ID of the email template for mapping a pending portal user with a contact",
4276
- "example": "940134fa-50f2-4204-a08a-fd3afddbf39a"
4350
+ "$ref": "#/components/schemas/EntityId",
4351
+ "description": "ID of the email template for mapping a pending portal user with a contact"
4277
4352
  },
4278
4353
  "onDocUpload": {
4279
- "type": "string",
4280
- "description": "ID of the email template for document upload",
4281
- "example": "c8ee93c0-8158-4da7-82f3-114f0c7b20ff"
4354
+ "$ref": "#/components/schemas/EntityId",
4355
+ "description": "ID of the email template for document upload"
4282
4356
  }
4283
4357
  }
4284
4358
  },
@@ -4291,9 +4365,7 @@
4291
4365
  ],
4292
4366
  "properties": {
4293
4367
  "entity_id": {
4294
- "type": "string",
4295
- "example": 123456,
4296
- "description": "Entity ID"
4368
+ "$ref": "#/components/schemas/EntityId"
4297
4369
  },
4298
4370
  "entity_type": {
4299
4371
  "type": "string",
@@ -4303,8 +4375,7 @@
4303
4375
  "file_entity_ids": {
4304
4376
  "type": "array",
4305
4377
  "items": {
4306
- "type": "string",
4307
- "example": 12345
4378
+ "$ref": "#/components/schemas/EntityId"
4308
4379
  },
4309
4380
  "description": "Array of file entity IDs"
4310
4381
  }
@@ -4319,9 +4390,7 @@
4319
4390
  ],
4320
4391
  "properties": {
4321
4392
  "entity_id": {
4322
- "type": "string",
4323
- "example": 123456,
4324
- "description": "Entity ID"
4393
+ "$ref": "#/components/schemas/EntityId"
4325
4394
  },
4326
4395
  "entity_type": {
4327
4396
  "type": "string",
@@ -4343,9 +4412,7 @@
4343
4412
  "description": "File name"
4344
4413
  },
4345
4414
  "file_entity_id": {
4346
- "type": "string",
4347
- "example": 12345,
4348
- "description": "File entity ID"
4415
+ "$ref": "#/components/schemas/EntityId"
4349
4416
  },
4350
4417
  "document_type": {
4351
4418
  "type": "string",
@@ -4512,9 +4579,8 @@
4512
4579
  "description": "Mark true if the domain is an Epilot domain"
4513
4580
  },
4514
4581
  "design_id": {
4515
- "type": "string",
4516
- "description": "ID of the design used to build the portal",
4517
- "example": "9ba94f20-b872-4217-a259-2a90a8ee1a29"
4582
+ "$ref": "#/components/schemas/EntityId",
4583
+ "description": "ID of the design used to build the portal"
4518
4584
  },
4519
4585
  "default_user_to_notify": {
4520
4586
  "type": "object",
@@ -4673,7 +4739,7 @@
4673
4739
  "type": "object",
4674
4740
  "properties": {
4675
4741
  "journey_id": {
4676
- "type": "string"
4742
+ "$ref": "#/components/schemas/EntityId"
4677
4743
  },
4678
4744
  "slug": {
4679
4745
  "$ref": "#/components/schemas/EntitySlug"
@@ -5150,8 +5216,7 @@
5150
5216
  }
5151
5217
  },
5152
5218
  "contactId": {
5153
- "type": "string",
5154
- "example": 123456,
5219
+ "$ref": "#/components/schemas/EntityId",
5155
5220
  "description": "ID of the contact"
5156
5221
  },
5157
5222
  "registration_identifiers": {
@@ -5380,6 +5445,7 @@
5380
5445
  },
5381
5446
  "EntityId": {
5382
5447
  "type": "string",
5448
+ "format": "uuid",
5383
5449
  "description": "Entity ID",
5384
5450
  "example": "5da0a718-c822-403d-9f5d-20d4584e0528"
5385
5451
  },
@@ -5833,12 +5899,10 @@
5833
5899
  "example": "john@doe.com"
5834
5900
  },
5835
5901
  "custom:portal_user_id": {
5836
- "type": "string",
5837
- "example": "06c78f9d-af75-4483-893d-a3fad524400f"
5902
+ "$ref": "#/components/schemas/EntityId"
5838
5903
  },
5839
5904
  "custom:contact_entity_id": {
5840
- "type": "string",
5841
- "example": "7579d22f-9400-41d1-b460-04730239ee91"
5905
+ "$ref": "#/components/schemas/EntityId"
5842
5906
  }
5843
5907
  },
5844
5908
  "example": {
@@ -5955,7 +6019,7 @@
5955
6019
  "type": "object",
5956
6020
  "properties": {
5957
6021
  "id": {
5958
- "type": "string"
6022
+ "$ref": "#/components/schemas/EntityId"
5959
6023
  },
5960
6024
  "schema": {
5961
6025
  "type": "string"
@@ -6032,9 +6096,8 @@
6032
6096
  "type": "object",
6033
6097
  "properties": {
6034
6098
  "entity_id": {
6035
- "type": "string",
6036
- "description": "The ID of the parent entity",
6037
- "example": "d8dffa9a-6c90-4c4e-b8d1-032194b25526"
6099
+ "$ref": "#/components/schemas/EntityId",
6100
+ "description": "The ID of the parent entity"
6038
6101
  },
6039
6102
  "_schema": {
6040
6103
  "$ref": "#/components/schemas/EntitySlug"
@@ -6064,9 +6127,8 @@
6064
6127
  ],
6065
6128
  "properties": {
6066
6129
  "entity_id": {
6067
- "type": "string",
6068
- "description": "The ID of the parent entity",
6069
- "example": "d8dffa9a-6c90-4c4e-b8d1-032194b25526"
6130
+ "$ref": "#/components/schemas/EntityId",
6131
+ "description": "The ID of the parent entity"
6070
6132
  },
6071
6133
  "_schema": {
6072
6134
  "$ref": "#/components/schemas/EntitySlug"