@common-grants/core 0.2.0 → 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.
package/lib/api.tsp CHANGED
@@ -61,6 +61,10 @@ namespace Opportunities {
61
61
  op list is Router.list;
62
62
 
63
63
  @tag("required")
64
+ @returnTypeChangedFrom(
65
+ CommonGrants.Versions.v0_2,
66
+ Responses.Ok<Models.OpportunityBase> | Responses.NotFound
67
+ )
64
68
  op read is Router.read;
65
69
 
66
70
  @tag("optional")
@@ -77,6 +81,7 @@ namespace Opportunities {
77
81
  namespace Competitions {
78
82
  alias Router = Routes.Competitions;
79
83
 
84
+ @added(Versions.v0_2)
80
85
  op read is Router.read;
81
86
  }
82
87
 
@@ -124,13 +129,14 @@ namespace Applications {
124
129
  // #########################################################
125
130
 
126
131
  @tag("Forms")
132
+ @tag("experimental")
127
133
  @route("/forms")
128
134
  namespace Forms {
129
135
  alias Router = Routes.Forms;
130
136
 
131
- @tag("optional")
137
+ @added(Versions.v0_2)
132
138
  op list is Router.list;
133
139
 
134
- @tag("optional")
140
+ @added(Versions.v0_2)
135
141
  op read is Router.read;
136
142
  }
@@ -2,6 +2,7 @@ namespace CommonGrants.Fields;
2
2
 
3
3
  /** A mailing address. */
4
4
  @example(Examples.Address.apartment)
5
+ @Versioning.added(CommonGrants.Versions.v0_2)
5
6
  model Address {
6
7
  /** The primary street address line. */
7
8
  street1: string;
@@ -34,6 +35,7 @@ model Address {
34
35
  /** A collection of addresses. */
35
36
  @example(Examples.Address.personalCollection)
36
37
  @example(Examples.Address.orgCollection)
38
+ @Versioning.added(CommonGrants.Versions.v0_2)
37
39
  model AddressCollection {
38
40
  /** The primary address for a person or organization. */
39
41
  primary: Address;
@@ -7,6 +7,7 @@ alias Email = Types.email; // Exposes Email from CommonGrants.Fields
7
7
 
8
8
  /** A collection of email addresses. */
9
9
  @example(Examples.Email.personalCollection)
10
+ @Versioning.added(CommonGrants.Versions.v0_2)
10
11
  model EmailCollection {
11
12
  /** The primary email address for a person or organization. */
12
13
  primary: Types.email;
@@ -3,6 +3,7 @@ namespace CommonGrants.Fields;
3
3
  /** A field representing a downloadable file. */
4
4
  @example(Examples.File.imageFile, #{ title: "An image file" })
5
5
  @example(Examples.File.pdfFile, #{ title: "A PDF file" })
6
+ @Versioning.added(CommonGrants.Versions.v0_2)
6
7
  model File {
7
8
  /** The file's download URL. */
8
9
  downloadUrl: url;
@@ -2,6 +2,7 @@ namespace CommonGrants.Fields;
2
2
 
3
3
  /** A person's name. */
4
4
  @example(Examples.Name.janeDoe)
5
+ @Versioning.added(CommonGrants.Versions.v0_2)
5
6
  model Name {
6
7
  /** Honorific prefix (e.g., Mr., Mrs., Dr., Prof.). */
7
8
  prefix?: string;
@@ -13,6 +13,7 @@ namespace CommonGrants.Fields;
13
13
  * See https://taxonomy.candid.org/ for more information.
14
14
  */
15
15
  @example(Examples.PCS.orgTypeTerm)
16
+ @Versioning.added(CommonGrants.Versions.v0_2)
16
17
  model PCSTerm {
17
18
  /** The plain language PCS term. */
18
19
  term: string;
@@ -34,6 +35,7 @@ model PCSTerm {
34
35
  // #########################################################
35
36
 
36
37
  /** The class to which the PCS term belongs. */
38
+ @Versioning.added(CommonGrants.Versions.v0_2)
37
39
  enum PCSClass {
38
40
  orgTypes: "Organization types",
39
41
  subjects: "Subjects",
@@ -50,6 +52,7 @@ enum PCSClass {
50
52
  *
51
53
  * See https://taxonomy.candid.org/organization-type for more information.
52
54
  */
55
+ @Versioning.added(CommonGrants.Versions.v0_2)
53
56
  model PCSOrgType extends PCSTerm {
54
57
  /** The PCS term for the organization type. */
55
58
  class: PCSClass.orgTypes;
@@ -59,6 +62,7 @@ model PCSOrgType extends PCSTerm {
59
62
  *
60
63
  * See https://taxonomy.candid.org/subjects for more information.
61
64
  */
65
+ @Versioning.added(CommonGrants.Versions.v0_2)
62
66
  model PCSSubject extends PCSTerm {
63
67
  /** The PCS term for the subject. */
64
68
  class: PCSClass.subjects;
@@ -68,6 +72,7 @@ model PCSSubject extends PCSTerm {
68
72
  *
69
73
  * See https://taxonomy.candid.org/populations for more information.
70
74
  */
75
+ @Versioning.added(CommonGrants.Versions.v0_2)
71
76
  model PCSPopulation extends PCSTerm {
72
77
  /** The PCS term for the population. */
73
78
  class: PCSClass.populationGroups;
@@ -77,6 +82,7 @@ model PCSPopulation extends PCSTerm {
77
82
  *
78
83
  * See https://taxonomy.candid.org/support-strategies for more information.
79
84
  */
85
+ @Versioning.added(CommonGrants.Versions.v0_2)
80
86
  model PCSSupportStrategy extends PCSTerm {
81
87
  /** The PCS term for the support strategy. */
82
88
  class: PCSClass.supportStrategies;
@@ -86,6 +92,7 @@ model PCSSupportStrategy extends PCSTerm {
86
92
  *
87
93
  * See https://taxonomy.candid.org/transaction-types for more information.
88
94
  */
95
+ @Versioning.added(CommonGrants.Versions.v0_2)
89
96
  model PCSTransactionType extends PCSTerm {
90
97
  /** The PCS term for the transaction type. */
91
98
  class: PCSClass.transactionTypes;
@@ -7,6 +7,7 @@ namespace CommonGrants.Models;
7
7
  /** The type of applicant eligible to apply for funding */
8
8
  @example(Examples.ApplicantType.organization)
9
9
  @example(Examples.ApplicantType.individual)
10
+ @Versioning.added(CommonGrants.Versions.v0_2)
10
11
  model ApplicantType {
11
12
  /** The type of applicant */
12
13
  value: ApplicantTypeOptions;
@@ -23,6 +24,7 @@ model ApplicantType {
23
24
  // #########################################################
24
25
 
25
26
  /** The set of possible applicant types */
27
+ @Versioning.added(CommonGrants.Versions.v0_2)
26
28
  enum ApplicantTypeOptions {
27
29
  /** The applicant is an individual */
28
30
  individual,
@@ -2,6 +2,7 @@ namespace CommonGrants.Models;
2
2
 
3
3
  /** The base model for an application to a competition for a funding opportunity */
4
4
  @example(Examples.Application.applicationBase)
5
+ @Versioning.added(CommonGrants.Versions.v0_2)
5
6
  model ApplicationBase {
6
7
  /** The unique identifier for the application */
7
8
  id: Types.uuid;
@@ -37,6 +38,7 @@ model ApplicationBase {
37
38
 
38
39
  /** The status of the application */
39
40
  @example(Examples.Application.submittedStatus)
41
+ @Versioning.added(CommonGrants.Versions.v0_2)
40
42
  model AppStatus {
41
43
  /** The status of the application, from a predefined set of options */
42
44
  value: AppStatusOptions;
@@ -73,6 +75,7 @@ enum AppStatusOptions {
73
75
 
74
76
  /** The model for a form response included in an application */
75
77
  @example(Examples.Application.formResponse)
78
+ @Versioning.added(CommonGrants.Versions.v0_2)
76
79
  model AppFormResponse {
77
80
  /** The unique identifier for the application */
78
81
  applicationId: Types.uuid;
@@ -7,6 +7,7 @@ namespace CommonGrants.Models;
7
7
  * distinct application period and set of application forms.
8
8
  */
9
9
  @example(Examples.Competition.competition)
10
+ @Versioning.added(CommonGrants.Versions.v0_2)
10
11
  model CompetitionBase {
11
12
  /** Globally unique id for the competition */
12
13
  id: Types.uuid;
@@ -2,6 +2,7 @@ namespace CommonGrants.Models;
2
2
 
3
3
  /** The base model for a form response */
4
4
  @example(Examples.FormResponse.formResponse)
5
+ @Versioning.added(CommonGrants.Versions.v0_2)
5
6
  model FormResponseBase {
6
7
  /** The unique identifier for the form response */
7
8
  id: Types.uuid;
@@ -31,6 +32,7 @@ model FormResponseBase {
31
32
 
32
33
  /** The status of the form response */
33
34
  @example(Examples.FormResponse.inProgressStatus)
35
+ @Versioning.added(CommonGrants.Versions.v0_2)
34
36
  model FormResponseStatus {
35
37
  /** The status of the form response, from a predefined set of options */
36
38
  value: FormResponseStatusOptions;
@@ -52,6 +54,7 @@ model FormResponseStatus {
52
54
  * - `complete`: The form response is complete, meaning all required fields have been filled out and there are no validation errors
53
55
  * - `custom`: A custom status
54
56
  */
57
+ @Versioning.added(CommonGrants.Versions.v0_2)
55
58
  enum FormResponseStatusOptions {
56
59
  notStarted,
57
60
  inProgress,
@@ -8,6 +8,7 @@ namespace CommonGrants.Models;
8
8
 
9
9
  /** A form for collecting data from a user. */
10
10
  @example(Examples.Form.form)
11
+ @Versioning.added(CommonGrants.Versions.v0_2)
11
12
  model Form {
12
13
  /** The form's unique identifier. */
13
14
  id: Types.uuid;
@@ -43,6 +44,7 @@ model Form {
43
44
 
44
45
  /** A JSON schema used to validate form responses. */
45
46
  @example(Examples.Form.formSchema)
47
+ @Versioning.added(CommonGrants.Versions.v0_2)
46
48
  model FormJsonSchema {
47
49
  ...Record<unknown>;
48
50
  }
@@ -53,6 +55,7 @@ model FormJsonSchema {
53
55
 
54
56
  /** A UI schema used to render the form in the browser. */
55
57
  @example(Examples.Form.uiSchema)
58
+ @Versioning.added(CommonGrants.Versions.v0_2)
56
59
  model FormUISchema {
57
60
  ...Record<unknown>;
58
61
  }
@@ -52,6 +52,7 @@ namespace CommonGrants.Models;
52
52
  @example(Examples.Mapping.simpleSwitch)
53
53
  @example(Examples.Mapping.nestedSwitch)
54
54
  @example(Examples.Mapping.withLiteralValues)
55
+ @Versioning.added(CommonGrants.Versions.v0_2)
55
56
  model MappingSchema {
56
57
  ...Record<MappingFunction | MappingSchema>;
57
58
  }
@@ -64,6 +65,7 @@ model MappingSchema {
64
65
  @example(Examples.Mapping.constId)
65
66
  @example(Examples.Mapping.amountField)
66
67
  @example(Examples.Mapping.statusSwitch)
68
+ @Versioning.added(CommonGrants.Versions.v0_2)
67
69
  union MappingFunction {
68
70
  `const`: MappingConstantFunction,
69
71
  field: MappingFieldFunction,
@@ -76,6 +78,7 @@ union MappingFunction {
76
78
 
77
79
  /** Returns a constant value. */
78
80
  @example(Examples.Mapping.constId)
81
+ @Versioning.added(CommonGrants.Versions.v0_2)
79
82
  model MappingConstantFunction {
80
83
  `const`: unknown;
81
84
  }
@@ -86,6 +89,7 @@ model MappingConstantFunction {
86
89
 
87
90
  /** Returns the value of a field in the source data. */
88
91
  @example(Examples.Mapping.amountField)
92
+ @Versioning.added(CommonGrants.Versions.v0_2)
89
93
  model MappingFieldFunction {
90
94
  field: string;
91
95
  }
@@ -96,6 +100,7 @@ model MappingFieldFunction {
96
100
 
97
101
  /** Returns a new value based on the value of a field in the source data using a switch statement. */
98
102
  @example(Examples.Mapping.statusSwitch)
103
+ @Versioning.added(CommonGrants.Versions.v0_2)
99
104
  model MappingSwitchFunction {
100
105
  switch: {
101
106
  /** The field in the source data to switch on. */
@@ -63,6 +63,7 @@ model OpportunityBase {
63
63
  keyDates?: OppTimeline;
64
64
 
65
65
  /** The type of applicant for the opportunity */
66
+ @Versioning.added(CommonGrants.Versions.v0_2)
66
67
  acceptedApplicantTypes?: ApplicantType[];
67
68
 
68
69
  /** URL for the original source of the opportunity */
@@ -80,6 +81,7 @@ model OpportunityBase {
80
81
  // ########################################
81
82
 
82
83
  /** A funding opportunity with additional details, like available competitions. */
84
+ @Versioning.added(CommonGrants.Versions.v0_2)
83
85
  model OpportunityDetails extends OpportunityBase {
84
86
  /** The competitions associated with the opportunity */
85
87
  competitions?: CompetitionBase[];
@@ -4,6 +4,7 @@ namespace CommonGrants.Models;
4
4
 
5
5
  /** An organization that can apply for grants. */
6
6
  @example(Examples.Organization.exampleOrg)
7
+ @Versioning.added(CommonGrants.Versions.v0_2)
7
8
  model OrganizationBase {
8
9
  /** The organization's unique identifier. */
9
10
  id: Types.uuid;
@@ -51,6 +52,7 @@ model OrganizationBase {
51
52
 
52
53
  /** A collection of social media and web presence links for an organization. */
53
54
  @example(Examples.Organization.exampleSocials)
55
+ @Versioning.added(CommonGrants.Versions.v0_2)
54
56
  model OrgSocialLinks {
55
57
  /** The organization's primary website URL. */
56
58
  website?: url;
@@ -5,6 +5,7 @@ namespace CommonGrants.Models;
5
5
 
6
6
  /** A person affiliated with an organization or grant application. */
7
7
  @example(Examples.Person.examplePerson)
8
+ @Versioning.added(CommonGrants.Versions.v0_2)
8
9
  model PersonBase {
9
10
  /** The person's full name, including all relevant components (first, middle, last, etc.). */
10
11
  name: Fields.Name;
@@ -6,6 +6,7 @@ namespace CommonGrants.Models;
6
6
 
7
7
  /** A proposal for funding. */
8
8
  @example(Examples.Proposal.exampleProposal)
9
+ @Versioning.added(CommonGrants.Versions.v0_2)
9
10
  model ProposalBase {
10
11
  /** The title of the proposal and/or the project requesting funding. */
11
12
  title?: string;
@@ -37,6 +38,7 @@ model ProposalBase {
37
38
  // #########################################################
38
39
 
39
40
  /** The opportunity to which this proposal is related */
41
+ @Versioning.added(CommonGrants.Versions.v0_2)
40
42
  model ProposalOpportunity {
41
43
  /** The opportunity's unique identifier. */
42
44
  id: Types.uuid;
@@ -52,6 +54,7 @@ model ProposalOpportunity {
52
54
  // ProjectTimeline
53
55
  // #########################################################
54
56
 
57
+ @Versioning.added(CommonGrants.Versions.v0_2)
55
58
  model ProjectTimeline {
56
59
  /** The start date of the period for which the funding is requested. */
57
60
  startDate?: Fields.Event;
@@ -70,6 +73,7 @@ model ProjectTimeline {
70
73
  // ProjectContacts
71
74
  // #########################################################
72
75
 
76
+ @Versioning.added(CommonGrants.Versions.v0_2)
73
77
  model ProposalContacts {
74
78
  /** The primary point of contact for the proposal. */
75
79
  primary: PersonBase;
@@ -82,6 +86,7 @@ model ProposalContacts {
82
86
  // ProposalOrgs
83
87
  // #########################################################
84
88
 
89
+ @Versioning.added(CommonGrants.Versions.v0_2)
85
90
  model ProposalOrgs {
86
91
  /** The primary organization that is requesting funding. */
87
92
  primary: OrganizationBase;
@@ -34,6 +34,7 @@ alias NotFound = Error & Http.NotFoundResponse;
34
34
  message: "Application submission failed due to validation errors",
35
35
  errors: #[#{ field: "formA.name", message: "Name is required" }],
36
36
  })
37
+ @Versioning.added(CommonGrants.Versions.v0_2)
37
38
  @doc("A failure to submit an application due to validation errors")
38
39
  model ApplicationSubmissionError extends Error {
39
40
  @example(400)
@@ -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",
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",