Skip to content

Commit 63dd115

Browse files
committed
Updating spec to match code changes
Adding new fields available in the database record Adjusting auth.id call format to match the rest of the spec file
1 parent 8e8fabe commit 63dd115

3 files changed

Lines changed: 91 additions & 33 deletions

File tree

specs/Url-Shortener.json

Lines changed: 88 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,41 @@
3333
}
3434
},
3535
"schemas": {
36+
"Auth.Id": {
37+
"title": "Auth IDs required to authenticate",
38+
"description": "Object containing IDs necessary to perform user authentication in the EntraID.",
39+
"examples": [
40+
{
41+
"appId": "2a7e1b3c-4d5f-4a8b-9e6a-1c2b7f3d8e4a",
42+
"tenantId": "9c1e7a2b-5d3f-4a8b-2c6e-7f1a3d9e8b5c"
43+
}
44+
],
45+
"properties": {
46+
"appId": {
47+
"description": "Application ID that should be used in Access Tokens as the audience and the endpoint necessary for auth code flows.",
48+
"type": "string",
49+
"format": "uuid",
50+
"maxLength": 36,
51+
"minLength": 36,
52+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
53+
"readOnly": true
54+
},
55+
"tenantId": {
56+
"description": "Tenant ID necessary for authority host URL configuration and UI customization.",
57+
"type": "string",
58+
"format": "uuid",
59+
"maxLength": 36,
60+
"minLength": 36,
61+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
62+
"readOnly": true
63+
}
64+
},
65+
"type": "object",
66+
"required": [
67+
"appId",
68+
"tenantId"
69+
]
70+
},
3671
"Core.HealthReport": {
3772
"title": "Core System - Health Report",
3873
"description": "Health report that indicates if a service is down or not that the URL Shortener relies on.",
@@ -73,9 +108,14 @@
73108
"sourceUrl": "https://www.example.com/vanityUrl",
74109
"createdBy": "3c5a9b7e-2d4f-4c1b-8e6a-7f2b3d1c9e45",
75110
"customUserAgentMatcher": null,
111+
"expectedBrokenScanStatusCode": null,
76112
"domainConfigId": "9a1e7b2c-5d3f-4a8b-9c2e-6f1a3d7e8b54",
113+
"enabled": true,
114+
"enableLinkBrokenScan": false,
77115
"updatedBy": "3c5a9b7e-2d4f-4c1b-8e6a-7f2b3d1c9e45",
78116
"targetUrl": "https://www.example.com/very-long-and-complex-url-with_plenty-of-special-characters-and-non-repeated-words",
117+
"notEnabledAfter": "2025-12-31T23:59:59Z",
118+
"notEnabledBefore": null,
79119
"targetUrlCustom": null,
80120
"targetUrlMobile": null,
81121
"targetUrlNodeJs": null,
@@ -116,6 +156,13 @@
116156
],
117157
"maxLength": 512
118158
},
159+
"expectedBrokenScanStatusCode": {
160+
"description": "Status code expected by the scheduled scan results.",
161+
"type": [
162+
"integer",
163+
"null"
164+
]
165+
},
119166
"domainConfigId": {
120167
"description": "Object ID of the domain configuration that this redirect record is associated with.",
121168
"type": "string",
@@ -125,6 +172,14 @@
125172
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
126173
"readOnly": true
127174
},
175+
"enabled": {
176+
"description": " Flag that indicates if the created URL is enabled (`true`) or not (`false`).",
177+
"type": "boolean"
178+
},
179+
"enableLinkBrokenScan": {
180+
"description": "Flag that enables (`true`) or disables (`false`) scans happening against the target to check if broken.",
181+
"type": "boolean"
182+
},
128183
"updatedBy": {
129184
"description": "Object ID of the last user who updated this record.",
130185
"type": "string",
@@ -138,6 +193,22 @@
138193
"type": "string",
139194
"format": "uri"
140195
},
196+
"notEnabledAfter": {
197+
"description": "Date that when present, indicates when the link expires.",
198+
"type": [
199+
"string",
200+
"null"
201+
],
202+
"format": "date-time"
203+
},
204+
"notEnabledBefore": {
205+
"description": "Date that when present, indicates when the link goes live.",
206+
"type": [
207+
"string",
208+
"null"
209+
],
210+
"format": "date-time"
211+
},
141212
"targetUrlCustom": {
142213
"description": "Target URL for custom defined and matching user agent clients.",
143214
"type": [
@@ -193,9 +264,14 @@
193264
"sourceUrl",
194265
"createdBy",
195266
"customUserAgentMatcher",
267+
"expectedBrokenScanStatusCode",
196268
"domainConfigId",
269+
"enabled",
270+
"enableLinkBrokenScan",
197271
"updatedBy",
198272
"targetUrl",
273+
"notEnabledAfter",
274+
"notEnabledBefore",
199275
"targetUrlCustom",
200276
"targetUrlMobile",
201277
"targetUrlNodeJs",
@@ -410,48 +486,25 @@
410486
},
411487
"description": "Create vanity or numeric short version of your desired URL. Share it digitally, as QR code, or print it.",
412488
"title": "SHI URL Shortener",
413-
"version": "0.0.2"
489+
"version": "0.0.3"
414490
},
415491
"openapi": "3.1.1",
416492
"paths": {
417493
"/Api/Auth/Id": {
418494
"get": {
495+
"summary": "Retrieves the IDs required to authenticate.",
419496
"description": "Provides the Tenant ID and the Application ID of the service principal that access tokens need to be issued against. This is also useful for configuring public clients to be able to authenticate to for auth code flows.",
420497
"operationId": "/Api/Auth/Id/Get",
421498
"responses": {
422499
"200": {
500+
"description": "OK",
423501
"content": {
424502
"application/json": {
425503
"schema": {
426-
"properties": {
427-
"appId": {
428-
"description": "Application ID that should be used in Access Tokens as the audience and the endpoint necessary for auth code flows.",
429-
"type": "string",
430-
"format": "uuid",
431-
"maxLength": 36,
432-
"minLength": 36,
433-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
434-
"readOnly": true
435-
},
436-
"tenantId": {
437-
"description": "Tenant ID necessary for authority host URL configuration and UI customization.",
438-
"type": "string",
439-
"format": "uuid",
440-
"maxLength": 36,
441-
"minLength": 36,
442-
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
443-
"readOnly": true
444-
}
445-
},
446-
"type": "object",
447-
"required": [
448-
"appId",
449-
"tenantId"
450-
]
504+
"$ref": "#/components/schemas/Auth.Id"
451505
}
452506
}
453-
},
454-
"description": "OK"
507+
}
455508
},
456509
"500": {
457510
"$ref": "#/components/responses/500"
@@ -460,8 +513,7 @@
460513
"tags": [
461514
"Core"
462515
],
463-
"security": [],
464-
"summary": "Retrieves the IDs required to authenticate."
516+
"security": []
465517
}
466518
},
467519
"/Api/Core/Health": {
@@ -682,12 +734,18 @@
682734
"Complete and proper payload": {
683735
"description": "Request where all required fields are present and valid.",
684736
"value": {
737+
"id": "7e2b1c8a-4f3d-4e2a-9b1a-2c6e8d7f1a23",
685738
"sourceUrl": "https://www.example.com/long-and-complex-url",
686739
"createdBy": "3c5a9b7e-2d4f-4c1b-8e6a-7f2b3d1c9e45",
687740
"customUserAgentMatcher": null,
741+
"expectedBrokenScanStatusCode": null,
688742
"domainConfigId": "9a1e7b2c-5d3f-4a8b-9c2e-6f1a3d7e8b54",
743+
"enabled": true,
744+
"enableLinkBrokenScan": false,
689745
"updatedBy": "3c5a9b7e-2d4f-4c1b-8e6a-7f2b3d1c9e45",
690746
"targetUrl": "https://www.example.com/target",
747+
"notEnabledAfter": null,
748+
"notEnabledBefore": null,
691749
"targetUrlCustom": null,
692750
"targetUrlMobile": null,
693751
"targetUrlNodeJs": null,

src/urlShortener/TypeScript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/urlShortener/TypeScript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shi-corp/sdk-url-shortener",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"type": "module",
55
"main": "bin/index.js",
66
"description": "SDK client used to interface with the URL Shortener application.",

0 commit comments

Comments
 (0)