gdc-common-utils-ts 2.7.4 → 2.7.6

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.
Files changed (55) hide show
  1. package/dist/constants/Schemas.d.ts +2 -0
  2. package/dist/constants/Schemas.js +2 -0
  3. package/dist/constants/composition.d.ts +13 -0
  4. package/dist/constants/composition.js +15 -0
  5. package/dist/constants/data-capabilities.d.ts +7 -7
  6. package/dist/constants/didcomm.d.ts +4 -0
  7. package/dist/constants/didcomm.js +4 -0
  8. package/dist/constants/fhir-resource-types.d.ts +55 -0
  9. package/dist/constants/fhir-resource-types.js +14 -0
  10. package/dist/constants/gateway-response.d.ts +100 -0
  11. package/dist/constants/gateway-response.js +104 -0
  12. package/dist/constants/http.d.ts +14 -0
  13. package/dist/constants/http.js +14 -0
  14. package/dist/constants/index.d.ts +3 -0
  15. package/dist/constants/index.js +3 -0
  16. package/dist/constants/jsonld.d.ts +5 -0
  17. package/dist/constants/jsonld.js +5 -0
  18. package/dist/constants/schemaorg.d.ts +5 -0
  19. package/dist/constants/schemaorg.js +5 -0
  20. package/dist/constants/urn.d.ts +2 -0
  21. package/dist/constants/urn.js +2 -0
  22. package/dist/examples/communication-bundle-document-request.d.ts +0 -6
  23. package/dist/examples/index.d.ts +1 -0
  24. package/dist/examples/index.js +1 -0
  25. package/dist/examples/individual-controller.d.ts +15 -13
  26. package/dist/examples/individual-controller.js +16 -12
  27. package/dist/examples/license.d.ts +67 -65
  28. package/dist/examples/license.js +37 -39
  29. package/dist/examples/lifecycle.d.ts +0 -6
  30. package/dist/examples/related-person.d.ts +0 -36
  31. package/dist/examples/related-person.js +0 -2
  32. package/dist/examples/researcher-working-selection.d.ts +68 -0
  33. package/dist/examples/researcher-working-selection.js +59 -0
  34. package/dist/examples/shared.d.ts +1 -0
  35. package/dist/examples/shared.js +1 -0
  36. package/dist/models/bundle-editor-types.d.ts +3 -0
  37. package/dist/models/bundle-editor-types.js +3 -0
  38. package/dist/models/interoperable-claims/index.d.ts +1 -0
  39. package/dist/models/interoperable-claims/index.js +1 -0
  40. package/dist/models/interoperable-claims/research-subject-claims.d.ts +4 -0
  41. package/dist/models/interoperable-claims/research-subject-claims.js +4 -0
  42. package/dist/utils/communication-bundle-document-request.d.ts +0 -3
  43. package/dist/utils/communication-bundle-document-request.js +0 -2
  44. package/dist/utils/communication-didcomm-payload.js +0 -3
  45. package/dist/utils/individual-organization-lifecycle.d.ts +1 -4
  46. package/dist/utils/individual-organization-lifecycle.js +1 -2
  47. package/dist/utils/license-commercial-search.d.ts +0 -2
  48. package/dist/utils/license-commercial-search.js +5 -17
  49. package/dist/utils/license-list-search.js +1 -1
  50. package/dist/utils/license-offer-order.js +1 -1
  51. package/dist/utils/license.d.ts +16 -4
  52. package/dist/utils/license.js +19 -13
  53. package/dist/utils/organization-lifecycle.d.ts +0 -3
  54. package/dist/utils/organization-lifecycle.js +0 -1
  55. package/package.json +1 -1
@@ -31,9 +31,6 @@ export type IndividualOrganizationLifecycleDataEntry = Readonly<{
31
31
  request: {
32
32
  method: typeof IndividualOrganizationLifecycleRequestMethods.Post;
33
33
  };
34
- meta: {
35
- claims: IndividualOrganizationLifecycleClaims;
36
- };
37
34
  resource: {
38
35
  id?: string;
39
36
  meta: {
@@ -63,7 +60,7 @@ export type IndividualOrganizationLifecycleEditorState = Readonly<{
63
60
  * - `purge` still goes through the explicit `/_purge` route
64
61
  * - both current routes expect `request.method = POST`
65
62
  * - both use canonical flat `org.schema.Organization.*` claims in
66
- * `meta.claims` and `resource.meta.claims`
63
+ * `resource.meta.claims`
67
64
  */
68
65
  export declare function buildCurrentIndividualOrganizationLifecycleDataEntry(input: IndividualOrganizationLifecycleDataEntryInput): IndividualOrganizationLifecycleDataEntry;
69
66
  /**
@@ -45,7 +45,7 @@ function createLifecycleThreadId(operation) {
45
45
  * - `purge` still goes through the explicit `/_purge` route
46
46
  * - both current routes expect `request.method = POST`
47
47
  * - both use canonical flat `org.schema.Organization.*` claims in
48
- * `meta.claims` and `resource.meta.claims`
48
+ * `resource.meta.claims`
49
49
  */
50
50
  export function buildCurrentIndividualOrganizationLifecycleDataEntry(input) {
51
51
  const claims = cloneClaims(input.claims);
@@ -54,7 +54,6 @@ export function buildCurrentIndividualOrganizationLifecycleDataEntry(input) {
54
54
  request: {
55
55
  method: input.requestMethod || IndividualOrganizationLifecycleRequestMethods.Post,
56
56
  },
57
- meta: { claims },
58
57
  resource: {
59
58
  ...(normalizeText(input.resourceId) ? { id: normalizeText(input.resourceId) } : {}),
60
59
  meta: { claims },
@@ -56,7 +56,6 @@ export declare class LicenseOfferSearchEditor {
56
56
  method: 'POST';
57
57
  };
58
58
  meta: {
59
- claims: LicenseClaims;
60
59
  status?: string;
61
60
  };
62
61
  resource: {
@@ -85,7 +84,6 @@ export declare class LicenseOrderSearchEditor {
85
84
  method: 'POST';
86
85
  };
87
86
  meta: {
88
- claims: LicenseClaims;
89
87
  status?: string;
90
88
  };
91
89
  resource: {
@@ -81,13 +81,7 @@ export class LicenseOfferSearchEditor {
81
81
  return {
82
82
  type: LicenseCommercialSearchEntryType.Offer,
83
83
  request: { method: 'POST' },
84
- meta: {
85
- claims: {
86
- ...claims,
87
- '@type': LicenseCommercialSearchOperation.Offer,
88
- },
89
- ...(this.draft.status ? { status: this.draft.status } : {}),
90
- },
84
+ meta: { ...(this.draft.status ? { status: this.draft.status } : {}) },
91
85
  resource: {
92
86
  meta: {
93
87
  claims: {
@@ -144,13 +138,7 @@ export class LicenseOrderSearchEditor {
144
138
  return {
145
139
  type: LicenseCommercialSearchEntryType.Order,
146
140
  request: { method: 'POST' },
147
- meta: {
148
- claims: {
149
- ...claims,
150
- '@type': LicenseCommercialSearchOperation.Order,
151
- },
152
- ...(this.draft.status ? { status: this.draft.status } : {}),
153
- },
141
+ meta: { ...(this.draft.status ? { status: this.draft.status } : {}) },
154
142
  resource: {
155
143
  meta: {
156
144
  claims: {
@@ -177,7 +165,7 @@ function extractClaims(entry) {
177
165
  const resourceMeta = resource.meta && typeof resource.meta === 'object' ? resource.meta : {};
178
166
  const metaClaims = meta.claims && typeof meta.claims === 'object' ? meta.claims : undefined;
179
167
  const resourceClaims = resourceMeta.claims && typeof resourceMeta.claims === 'object' ? resourceMeta.claims : undefined;
180
- return { ...(resourceClaims || {}), ...(metaClaims || {}) };
168
+ return { ...(metaClaims || {}), ...(resourceClaims || {}) };
181
169
  }
182
170
  /**
183
171
  * Reads normalized offer rows from one GW-style search/list response body.
@@ -188,7 +176,7 @@ export function readLicenseOfferRecords(body) {
188
176
  return {
189
177
  id: normalizeText(entry.id) || normalizeText(claims[ClaimsOfferSchemaorg.identifier]),
190
178
  status: normalizeText(entry.meta?.status),
191
- offer: readLicenseOfferPreviewFromResponseBody({ data: [{ meta: { claims } }] }),
179
+ offer: readLicenseOfferPreviewFromResponseBody({ data: [{ resource: { meta: { claims } } }] }),
192
180
  claims,
193
181
  };
194
182
  });
@@ -203,7 +191,7 @@ export function readLicenseOrderRecords(body) {
203
191
  return {
204
192
  id: normalizeText(entry.id) || normalizeText(claims[ClaimsOrderSchemaorg.acceptedOfferIdentifier]),
205
193
  status: normalizeText(entry.meta?.status),
206
- order: readLicenseOrderSummaryFromResponseBody({ data: [{ meta: { claims } }] }),
194
+ order: readLicenseOrderSummaryFromResponseBody({ data: [{ resource: { meta: { claims } } }] }),
207
195
  claims,
208
196
  };
209
197
  });
@@ -137,7 +137,7 @@ function extractClaims(entry) {
137
137
  const resourceMeta = resource.meta && typeof resource.meta === 'object' ? resource.meta : {};
138
138
  const metaClaims = meta.claims && typeof meta.claims === 'object' ? meta.claims : undefined;
139
139
  const resourceClaims = resourceMeta.claims && typeof resourceMeta.claims === 'object' ? resourceMeta.claims : undefined;
140
- return { ...(resourceClaims || {}), ...(metaClaims || {}) };
140
+ return { ...(metaClaims || {}), ...(resourceClaims || {}) };
141
141
  }
142
142
  function isLicenseListEntry(entry) {
143
143
  const meta = entry.meta && typeof entry.meta === 'object'
@@ -65,7 +65,7 @@ export function extractPrimaryClaims(body) {
65
65
  const firstMeta = asRecord(first.meta) || {};
66
66
  const resource = asRecord(first.resource) || {};
67
67
  const resourceMeta = asRecord(resource.meta) || {};
68
- return asRecord(firstMeta.claims) || asRecord(resourceMeta.claims) || {};
68
+ return asRecord(resourceMeta.claims) || asRecord(firstMeta.claims) || {};
69
69
  }
70
70
  /**
71
71
  * Reads the current public/persisted `Offer.*` claim family from one GW poll
@@ -157,13 +157,17 @@ export declare function buildLicenseIssueEntry(input: LicenseIssueInput): {
157
157
  method: 'POST';
158
158
  };
159
159
  meta: {
160
- claims: LicenseClaims;
161
160
  ownerOrganizationId?: string;
162
161
  subjectDid?: string;
163
162
  subjectId?: string;
164
163
  relatedPersonId?: string;
165
164
  invitationId?: string;
166
165
  };
166
+ resource: {
167
+ meta: {
168
+ claims: LicenseClaims;
169
+ };
170
+ };
167
171
  };
168
172
  /**
169
173
  * Builds canonical schema.org claims for a license purchase / seat-creation
@@ -186,15 +190,19 @@ export declare function buildLicensePurchaseEntry(input: LicensePurchaseInput):
186
190
  method: 'POST';
187
191
  };
188
192
  meta: {
189
- claims: LicenseClaims;
190
193
  ownerOrganizationId?: string;
191
194
  };
195
+ resource: {
196
+ meta: {
197
+ claims: LicenseClaims;
198
+ };
199
+ };
192
200
  };
193
201
  /**
194
202
  * Builds the canonical search envelope for license listing.
195
203
  *
196
204
  * Split of concerns:
197
- * - schema.org-compatible selectors stay in `meta.claims`
205
+ * - schema.org-compatible selectors stay in `resource.meta.claims`
198
206
  * - document lifecycle stays in `meta.status`, mirroring the current
199
207
  * `ConfidentialStorageDoc.status` usage
200
208
  * - `subjectId` remains an explicit side-field until a canonical indexed claim
@@ -206,9 +214,13 @@ export declare function buildLicenseSearchEntry(input: LicenseSearchInput): {
206
214
  method: 'POST';
207
215
  };
208
216
  meta: {
209
- claims: LicenseClaims;
210
217
  status?: LicenseStatus;
211
218
  subjectId?: string;
212
219
  ownerOrganizationId?: string;
213
220
  };
221
+ resource: {
222
+ meta: {
223
+ claims: LicenseClaims;
224
+ };
225
+ };
214
226
  };
@@ -191,14 +191,14 @@ export function buildLicenseIssueClaims(input) {
191
191
  * Builds the canonical batch entry for `License/_issue`.
192
192
  */
193
193
  export function buildLicenseIssueEntry(input) {
194
+ const claims = {
195
+ ...buildLicenseIssueClaims(input),
196
+ '@type': LicenseEntryOperations.Issue,
197
+ };
194
198
  return {
195
199
  type: LicenseEntryTypes.Issue,
196
200
  request: { method: LicenseRequestMethods.Post },
197
201
  meta: {
198
- claims: {
199
- ...buildLicenseIssueClaims(input),
200
- '@type': LicenseEntryOperations.Issue,
201
- },
202
202
  ...(String(input.ownerOrganizationId || '').trim()
203
203
  ? { ownerOrganizationId: String(input.ownerOrganizationId).trim() }
204
204
  : {}),
@@ -215,6 +215,7 @@ export function buildLicenseIssueEntry(input) {
215
215
  ? { invitationId: String(input.invitationId).trim() }
216
216
  : {}),
217
217
  },
218
+ resource: { meta: { claims } },
218
219
  };
219
220
  }
220
221
  /**
@@ -252,25 +253,26 @@ export function buildLicensePurchaseClaims(input) {
252
253
  * request.
253
254
  */
254
255
  export function buildLicensePurchaseEntry(input) {
256
+ const claims = {
257
+ ...buildLicensePurchaseClaims(input),
258
+ '@type': LicenseEntryOperations.Purchase,
259
+ };
255
260
  return {
256
261
  type: LicenseEntryTypes.Purchase,
257
262
  request: { method: LicenseRequestMethods.Post },
258
263
  meta: {
259
- claims: {
260
- ...buildLicensePurchaseClaims(input),
261
- '@type': LicenseEntryOperations.Purchase,
262
- },
263
264
  ...(String(input.ownerOrganizationId || '').trim()
264
265
  ? { ownerOrganizationId: String(input.ownerOrganizationId).trim() }
265
266
  : {}),
266
267
  },
268
+ resource: { meta: { claims } },
267
269
  };
268
270
  }
269
271
  /**
270
272
  * Builds the canonical search envelope for license listing.
271
273
  *
272
274
  * Split of concerns:
273
- * - schema.org-compatible selectors stay in `meta.claims`
275
+ * - schema.org-compatible selectors stay in `resource.meta.claims`
274
276
  * - document lifecycle stays in `meta.status`, mirroring the current
275
277
  * `ConfidentialStorageDoc.status` usage
276
278
  * - `subjectId` remains an explicit side-field until a canonical indexed claim
@@ -300,10 +302,6 @@ export function buildLicenseSearchEntry(input) {
300
302
  type: LicenseEntryTypes.Search,
301
303
  request: { method: LicenseRequestMethods.Post },
302
304
  meta: {
303
- claims: {
304
- ...claims,
305
- '@type': LicenseEntryOperations.Search,
306
- },
307
305
  ...(input.status ? { status: input.status } : {}),
308
306
  ...(typeof input.subjectId === 'string' && input.subjectId.trim()
309
307
  ? { subjectId: input.subjectId.trim() }
@@ -312,5 +310,13 @@ export function buildLicenseSearchEntry(input) {
312
310
  ? { ownerOrganizationId: input.ownerOrganizationId.trim() }
313
311
  : {}),
314
312
  },
313
+ resource: {
314
+ meta: {
315
+ claims: {
316
+ ...claims,
317
+ '@type': LicenseEntryOperations.Search,
318
+ },
319
+ },
320
+ },
315
321
  };
316
322
  }
@@ -16,9 +16,6 @@ export type OrganizationLifecycleDataEntry = Readonly<{
16
16
  request: {
17
17
  method: 'POST';
18
18
  };
19
- meta: {
20
- claims: OrganizationLifecycleClaims;
21
- };
22
19
  resource: {
23
20
  resourceType: 'Organization';
24
21
  meta: {
@@ -147,7 +147,6 @@ export class OrganizationLifecycleEditor {
147
147
  return {
148
148
  type: requestType,
149
149
  request: { method: 'POST' },
150
- meta: { claims },
151
150
  resource: {
152
151
  resourceType: 'Organization',
153
152
  meta: { claims },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },