@common-grants/core 0.2.0-alpha.1 → 0.2.1

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.
@@ -8,6 +8,7 @@ namespace CommonGrants.Routes;
8
8
  // Expose the contents of the Http and Rest namespaces
9
9
  // these include the decorators @route, @get, etc.
10
10
  using TypeSpec.Http;
11
+ using TypeSpec.Versioning;
11
12
 
12
13
  /** A re-usable interface for an Opportunities router
13
14
  *
@@ -52,7 +53,7 @@ interface Opportunities {
52
53
  ): Responses.Paginated<T>;
53
54
 
54
55
  // ##############################
55
- // View an opportunity
56
+ // View an opportunity (v0.1.0)
56
57
  // ##############################
57
58
 
58
59
  /** `GET /opportunities/<id>` View opportunity details
@@ -60,12 +61,19 @@ interface Opportunities {
60
61
  * @template T Type of the response model.
61
62
  * Must be an extension of Schemas.OpportunityBase. Default is Schemas.OpportunityBase.
62
63
  */
63
- @summary("View opportunity")
64
- @doc("View additional details about an opportunity")
64
+ @summary("View opportunity details")
65
+ @doc("View details about an opportunity.")
65
66
  @get
66
- read<T extends Models.OpportunityBase = Models.OpportunityBase>(
67
+ read<T extends Models.OpportunityBase = Models.OpportunityDetails>(
67
68
  /** The ID of the opportunity to view */
68
- @path id: Types.uuid,
69
+ @path
70
+ @removed(Versions.v0_2)
71
+ id: Types.uuid,
72
+
73
+ /** The ID of the opportunity to view */
74
+ @path
75
+ @added(Versions.v0_2)
76
+ oppId: Types.uuid,
69
77
  ): Responses.Ok<T> | Responses.NotFound;
70
78
 
71
79
  // ###############################
@@ -78,7 +86,7 @@ interface Opportunities {
78
86
  * Must be an extension of Schemas.OpportunityBase. Default is Schemas.OpportunityBase.
79
87
  */
80
88
  @summary("Search opportunities")
81
- @doc("Search for opportunities based on the provided filters")
89
+ @doc("Search for opportunities based on the provided filters.")
82
90
  @post
83
91
  @route("/search")
84
92
  search<T extends Models.OpportunityBase = Models.OpportunityBase>(
@@ -33,22 +33,26 @@ scalar uuid extends string;
33
33
  /** An email address */
34
34
  @example("test@example.com")
35
35
  @format("email")
36
+ @Versioning.added(CommonGrants.Versions.v0_2)
36
37
  scalar email extends string;
37
38
 
38
39
  /** An Employer Identification Number (EIN) issued by the IRS */
39
40
  @example("12-3456789")
40
41
  @pattern("^[0-9]{2}-[0-9]{7}$")
42
+ @Versioning.added(CommonGrants.Versions.v0_2)
41
43
  scalar employerTaxId extends string;
42
44
 
43
45
  /** A Unique Entity Identifier (UEI) issued by SAM.gov */
44
46
  @example("12ABC34DEF56")
45
47
  @pattern("^[A-z0-9]{12}$")
48
+ @Versioning.added(CommonGrants.Versions.v0_2)
46
49
  scalar samUEI extends string;
47
50
 
48
51
  /** A Data Universal Numbering System (DUNS) number */
49
52
  @example("123456789")
50
53
  @example("12-345-6789")
51
54
  @example("123456789-1234")
55
+ @Versioning.added(CommonGrants.Versions.v0_2)
52
56
  scalar duns extends string;
53
57
 
54
58
  // ########################################
@@ -80,4 +84,5 @@ scalar isoDate extends plainDate;
80
84
  /** A calendar year */
81
85
  @example("2025")
82
86
  @pattern("^[0-9]{4}$")
87
+ @Versioning.added(CommonGrants.Versions.v0_2)
83
88
  scalar calendarYear extends string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-grants/core",
3
- "version": "0.2.0-alpha.1",
3
+ "version": "0.2.1",
4
4
  "description": "TypeSpec library for defining grant opportunity data models and APIs",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",