gdc-common-utils-ts 1.4.7 → 1.4.8

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.
@@ -17,10 +17,9 @@
17
17
  * such as registering one organization or creating one employee. It has a strict
18
18
  * structure:
19
19
  * - `type`: A string that defines the business action (e.g., 'Organization-registration-offer-v1.0').
20
- * - `meta`: A **TOP-LEVEL** property containing the original `claims` for the operation.
21
- * This is crucial for both processing and error reporting.
22
- * - `resource`: A FHIR-like resource object that is the subject of the action. It
23
- * contains the structured data derived from the claims.
20
+ * - `resource.meta.claims`: Canonical location for claims in request entries.
21
+ * - `meta.claims`: Legacy compatibility location accepted during migration.
22
+ * - `resource`: A FHIR-like resource object that is the subject of the action.
24
23
  * - `request`/`response`: Contextual objects indicating the operation's details or result.
25
24
  */
26
25
  import { OperationOutcome } from "./operation-outcome";
@@ -50,6 +49,22 @@ export interface BundleEntryMeta {
50
49
  /** The original, flattened claims record for this specific entry. */
51
50
  claims?: Record<string, any>;
52
51
  }
52
+ /**
53
+ * Canonical resource shape for batch-style entries.
54
+ * Claims should be authored in `resource.meta.claims`.
55
+ */
56
+ /**
57
+ * Agnostic resource shape for batch-style entries.
58
+ * Canonical claims location: resource.meta.claims
59
+ * Allows any resource structure, but meta.claims is always present for business logic.
60
+ */
61
+ export interface BundleEntryResource {
62
+ meta?: {
63
+ claims?: Record<string, any>;
64
+ [key: string]: any;
65
+ };
66
+ resourceType?: string;
67
+ }
53
68
  /**
54
69
  * @deprecated Use `BundleEntry` instead. This will be removed in a future version.
55
70
  * Represents a single entry in an INCOMING request Bundle.
@@ -58,7 +73,8 @@ export interface BundleEntryRequest {
58
73
  id?: string;
59
74
  type: string;
60
75
  request: BundleRequest;
61
- resource?: Record<string, any>;
76
+ resource?: BundleEntryResource;
77
+ /** @deprecated Legacy claims location. Prefer resource.meta.claims. */
62
78
  meta?: BundleEntryMeta;
63
79
  }
64
80
  /**
@@ -69,7 +85,8 @@ export interface BundleEntryResponse {
69
85
  id?: string;
70
86
  type: string;
71
87
  response: BundleResponse;
72
- resource?: Record<string, any>;
88
+ resource?: BundleEntryResource;
89
+ /** @deprecated Legacy claims location. Prefer resource.meta.claims. */
73
90
  meta?: BundleEntryMeta;
74
91
  }
75
92
  /**
@@ -100,16 +117,18 @@ export interface ErrorEntry {
100
117
  * This structure is used for both requests and successful responses.
101
118
  *
102
119
  * @property {string} type - A string identifying the business action of the entry.
103
- * @property {BundleEntryMeta} meta - **(TOP-LEVEL PROPERTY)** Contains the original, unprocessed claims.
104
120
  * @property {object} resource - The primary FHIR-like resource that is the subject of the action.
121
+ * Canonical claims location is `resource.meta.claims`.
122
+ * @property {BundleEntryMeta} [meta] - Legacy top-level claims location for backward compatibility.
105
123
  * @property {BundleRequest} [request] - Details of the requested operation (for request bundles).
106
124
  * @property {BundleResponse} [response] - Details of the operation outcome (for response bundles).
107
125
  */
108
126
  export type BundleEntry = {
109
127
  id?: string;
110
128
  type: string;
129
+ /** @deprecated Legacy claims location. Prefer resource.meta.claims. */
111
130
  meta?: BundleEntryMeta;
112
- resource?: Record<string, any>;
131
+ resource?: BundleEntryResource;
113
132
  request?: BundleRequest;
114
133
  response?: BundleResponse;
115
134
  };
@@ -17,10 +17,9 @@
17
17
  * such as registering one organization or creating one employee. It has a strict
18
18
  * structure:
19
19
  * - `type`: A string that defines the business action (e.g., 'Organization-registration-offer-v1.0').
20
- * - `meta`: A **TOP-LEVEL** property containing the original `claims` for the operation.
21
- * This is crucial for both processing and error reporting.
22
- * - `resource`: A FHIR-like resource object that is the subject of the action. It
23
- * contains the structured data derived from the claims.
20
+ * - `resource.meta.claims`: Canonical location for claims in request entries.
21
+ * - `meta.claims`: Legacy compatibility location accepted during migration.
22
+ * - `resource`: A FHIR-like resource object that is the subject of the action.
24
23
  * - `request`/`response`: Contextual objects indicating the operation's details or result.
25
24
  */
26
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },