@haddowg/json-api-client 1.25.0 → 1.27.0
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/README.md +6 -0
- package/dist/ajv.cjs +20 -2
- package/dist/ajv.d.cts +5 -1
- package/dist/ajv.d.cts.map +1 -1
- package/dist/ajv.d.mts +5 -1
- package/dist/ajv.d.mts.map +1 -1
- package/dist/ajv.mjs +20 -2
- package/dist/ajv.mjs.map +1 -1
- package/dist/index.cjs +197 -243
- package/dist/index.d.cts +32 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +32 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +180 -231
- package/dist/index.mjs.map +1 -1
- package/dist/validate-BvO7NhkT.mjs +418 -0
- package/dist/validate-BvO7NhkT.mjs.map +1 -0
- package/dist/{validate-BPV_qwZb.d.cts → validate-CMy8mJD2.d.cts} +615 -71
- package/dist/validate-CMy8mJD2.d.cts.map +1 -0
- package/dist/{validate-BPV_qwZb.d.mts → validate-CMy8mJD2.d.mts} +615 -71
- package/dist/validate-CMy8mJD2.d.mts.map +1 -0
- package/dist/validate-DMRQn0XN.cjs +481 -0
- package/package.json +1 -1
- package/dist/validate-BPV_qwZb.d.cts.map +0 -1
- package/dist/validate-BPV_qwZb.d.mts.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DocumentMeta, $n as LinkObject, $r as PaginatorStrategy, $t as ResourceObjectView, A as TransportResponse, An as AtomicOperationArgs, Ar as ActionDescriptor, At as RelatedIncludedType, B as Client, Bn as runAtomic, Br as ClientIdPolicy, Bt as RelationPageParams, C as ClientOptions, Cn as ActionLocation, Cr as Accepted, Ct as NestedFieldsetMember, D as JsonApiTransport, Dn as AtomicCreateInput, Dr as parseRetryAfter, Dt as ReadResult, E as createClient, En as AtomicCreateHandle, Er as isAccepted, Et as PivotInput, F as ActionCallOptions, Fn as AtomicRelationshipRecorder, Fr as AdditionalMembersDescriptor, Ft as RelatedQueryRelation, G as CountedRelationName, Gn as MediaTypeParams, Gr as InputMedia, Gt as RelationshipAccessor, H as CollectionMeta, Hn as ATOMIC_MEDIA_TYPE, Hr as DocumentMetaDescriptor, Ht as RelationReadQuery, I as ActionsAccessor, In as AtomicResult, Ir as ApiDescriptor, It as RelatedReadRelatedQuery, J as DefaultActionTypes, Jn as ArrayEnvelope, Jr as MenuDescriptor, Jt as RequiresRequestMeta, K as CreateInput, Kn as ResourceIdentifier, Kr as InputMediaKind, Kt as RelationshipMembers, L as AtomicResultOf, Ln as AtomicResults, Lr as ApiExamples, Lt as RelationCollection, M as AcceptedJob, Mn as AtomicRef, Mr as ActionLocationDescriptor, Mt as RelatedQuery, N as AcceptedMeta, Nn as AtomicRelationshipArgs, Nr as ActionOutput, Nt as RelatedQueryEntry, O as TransportRawBody, On as AtomicDeleteHandle, Or as AcceptedDescriptor, Ot as ReadableRelationName, P as AcceptedOf, Pn as AtomicRelationshipHandle, Pr as ActionScope, Pt as RelatedQueryParam, Q as DeleteResult, Qn as Link, Qr as PaginatorRole, Qt as ResourceMetaOf, R as BinaryBody, Rn as AtomicUpdateHandle, Rr as AtomicDescriptor, Rt as RelationFilterQuery, S as serializeQuery, Sn as WriteResult, Sr as resolvePaginator, St as MutationVerb, T as HeadersInit, Tn as readActionLocation, Tr as PollTimeoutError, Tt as OptionsArg, U as CountAccessor, Un as JSON_API_MEDIA_TYPE, Ur as DocumentMetaOperation, Ut as RelationRequestMetaOf, V as Collection, Vn as ATOMIC_EXT, Vr as CountableDescriptor, Vt as RelationPaginator, W as CountToken, Wn as LocalIdentifier, Wr as FilterFamilyDescriptor, Wt as RelationSortQuery, X as DefaultWriteAttributes, Xn as Edge, Xr as PaginatorDescriptor, Xt as ResourceCountToken, Y as DefaultAttributes, Yn as DocumentEnvelope, Yr as OperationExamples, Yt as ResourceAccessors, Z as DeleteArgs, Zn as EdgeEnvelope, Zr as PaginatorKind, Zt as ResourceHandle, _ as RawResponseType, _n as WaitedWriteResult, _r as PageOf, _t as LooseRelatedQueryEntry, a as ValidationOption, ai as RelationDescriptor, an as SortQuery, ar as ResourceLinks, at as FilterQuery, b as executeRaw, bn as WritableRelationName, br as ResolvedPaginator, bt as MetaOption, c as assertJsonApiDocument, ci as ResourceCountOperation, cn as TypeAccessor, cr as relatedPaginatorKind, ct as IncludePath, d as sparseSchemas, di as ResourceMetaDescriptor, dn as TypedRelatedReadQuery, dr as CANONICAL_PAGE_KEYS, dt as IncludedType, ei as PivotDescriptor, en as ResourceWriteMeta, er as MaterialiseContext, et as EdgeMembers, f as validateDocument, fi as SortFamilyDescriptor, fn as TypedRelationReadQuery, fr as ExactPageParams, ft as IsSingleton, g as JsonApiRequest, gn as WaitValue, gr as PageMeta, gt as LooseRelatedQuery, h as JsonApiContext, hn as WaitOptions, hr as PageLinks, ht as ListPageParams, i as ValidationContext, ii as RelatedQueryOperation, in as SingletonUpdateInput, ir as ResourceEnvelope, it as FilterKey, j as fetchTransport, jn as AtomicRecorder, jr as ActionInput, jt as RelatedMeta, k as TransportRequest, kn as AtomicHandle, kr as AcceptedOperation, kt as RelatedIncludedResource, l as resolveValidator, li as ResourceDescriptor, ln as TypeName, lr as NestedFieldset, lt as IncludedRelations, m as ExecutedResponse, mi as isPolymorphic, mn as UpdateMethod, mr as PageKeys, mt as ListFilterMember, n as SchemaMap, ni as RawOutputMedia, nn as SingleReadQuery, nr as RelationArrayEnvelope, nt as FieldSelectionMap, o as Validator, oi as RelationMutations, on as SortToken, or as materialise, ot as HydratedMember, p as Document, pi as StrategyDescriptor, pn as UpdateInput, pr as Page, pt as LinkageRef, q as CreateMethod, qn as mediaType, qr as MediaExamples, qt as RequestMetaOf, r as ValidationConfig, ri as RelatedQueryDescriptor, rn as SingletonAccessor, rr as RelationView, rt as FieldsMap, s as WireResource, si as RequestMetaOperation, sn as TakesVerb, sr as relatedPaginator, st as IdentifierMember, t as ResolvedValidator, ti as RawMediaKind, tn as ResourceWriteOperation, tr as NavigateOptions, tt as ErrorCodeOf, u as sparseSchema, ui as ResourceExamples, un as TypedReadQuery, ur as nestedFieldset, ut as IncludedResource, v as ReadQuery, vn as WithDocumentMeta, vr as PageParams, vt as MemberName, w as HANDLE_RESERVED, wn as isActionLocation, wr as PollOptions, wt as OperationMeta, x as executeResponse, xn as WriteOptions, xr as TypedPage, xt as MutationMetaOf, y as execute, yn as WithLinks, yr as PageParamsOf, yt as MetaObject, z as BinaryResponseType, zn as AtomicUpdateInput, zr as Cardinality, zt as RelationName } from "./validate-CMy8mJD2.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
/**
|
|
@@ -171,7 +171,10 @@ interface WriteDocument {
|
|
|
171
171
|
id?: string;
|
|
172
172
|
attributes?: Record<string, unknown>;
|
|
173
173
|
relationships?: Record<string, RelationshipDocument>;
|
|
174
|
+
meta?: Record<string, unknown>;
|
|
174
175
|
};
|
|
176
|
+
/** The document's top-level `meta`, which a write takes in its options. */
|
|
177
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
175
178
|
}
|
|
176
179
|
/** Options for {@link toDocument}. */
|
|
177
180
|
interface ToDocumentOptions {
|
|
@@ -194,9 +197,17 @@ interface ToDocumentOptions {
|
|
|
194
197
|
*
|
|
195
198
|
* `data.type` is always the accessor `type`. `data.id` is written from `opts.id` (an update),
|
|
196
199
|
* else from `input.id` only when the type's `clientId` policy allows it (omitted when
|
|
197
|
-
* `forbidden`, passed through when `optional`/`required`).
|
|
200
|
+
* `forbidden`, passed through when `optional`/`required`). A `$meta` object is the resource
|
|
201
|
+
* object's `meta`.
|
|
198
202
|
*/
|
|
199
203
|
declare function toDocument(descriptor: ApiDescriptor, type: string, input: Record<string, unknown>, opts?: ToDocumentOptions): WriteDocument;
|
|
204
|
+
/**
|
|
205
|
+
* A write document with the top-level `meta` a call's options carry, or the document as it is
|
|
206
|
+
* when they carry none.
|
|
207
|
+
*/
|
|
208
|
+
declare function withTopLevelMeta<Doc extends object>(doc: Doc, meta: Readonly<Record<string, unknown>> | undefined): Doc & {
|
|
209
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
210
|
+
};
|
|
200
211
|
/**
|
|
201
212
|
* Build a relationship-mutation document `{ data: <linkage> }` for the
|
|
202
213
|
* `/{type}/{id}/relationships/{rel}` endpoints, coercing the caller's refs by cardinality:
|
|
@@ -218,6 +229,8 @@ declare function toRelationshipDocument(refs: unknown, cardinality: 'one' | 'man
|
|
|
218
229
|
* - `/data/id` -> `id` (client-id create conflict)
|
|
219
230
|
* - `/data/attributes/releaseInfo/label` -> `releaseInfo.label` (nested map)
|
|
220
231
|
* - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
|
|
232
|
+
* - `/data/meta/source` -> `$meta.source`
|
|
233
|
+
* - `/meta/idempotencyKey` -> `$documentMeta.idempotencyKey`
|
|
221
234
|
*
|
|
222
235
|
* Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
|
|
223
236
|
* `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
|
|
@@ -244,7 +257,8 @@ declare function remapPointer(descriptor: ApiDescriptor, type: string, pointer:
|
|
|
244
257
|
* to the relation name (drop the `relationships/<name>` prefix) rather than treating
|
|
245
258
|
* `relationships` as a linkage sub-segment.
|
|
246
259
|
*
|
|
247
|
-
* A
|
|
260
|
+
* A pointer into the top-level `meta` becomes `$documentMeta.<member>`, and any other non-`data`
|
|
261
|
+
* pointer is returned verbatim.
|
|
248
262
|
*/
|
|
249
263
|
declare function remapRelationshipPointer(rel: string, hasPivot: boolean, pointer: string): string;
|
|
250
264
|
/**
|
|
@@ -262,16 +276,28 @@ declare function withRemappedPaths(error: JsonApiError, descriptor: ApiDescripto
|
|
|
262
276
|
* `$pivot`. The original error is not mutated.
|
|
263
277
|
*/
|
|
264
278
|
declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string, hasPivot: boolean): JsonApiError;
|
|
279
|
+
/**
|
|
280
|
+
* Give each error on the request document's top-level `meta` its `$documentMeta.<member>` path,
|
|
281
|
+
* for a request whose other members the client didn't build, such as a bespoke action document or
|
|
282
|
+
* a meta-only one. Every other error is passed through unchanged. The original error is not
|
|
283
|
+
* mutated.
|
|
284
|
+
*/
|
|
285
|
+
declare function withRemappedDocumentMetaPaths(error: JsonApiError): JsonApiError;
|
|
265
286
|
/**
|
|
266
287
|
* Invert an atomic-batch error's `source.pointer` to `(opIndex, flatPath)`: an atomic 422
|
|
267
288
|
* points at `/atomic:operations/{n}/data/...`, so strip the `atomic:operations/{n}` prefix to
|
|
268
289
|
* the op index, resolve that op's wire type (`typeForOp`), and delegate the remaining `/data`
|
|
269
290
|
* tail to the same {@link remapPointer} a standalone write uses (so the flat path is identical
|
|
270
|
-
* — `title`, `releaseInfo.label`, `artist`, …). A
|
|
291
|
+
* — `title`, `releaseInfo.label`, `artist`, …). A relationship op's tail is remapped under its
|
|
292
|
+
* relation, as a standalone relationship write's is, when `relationForOp` names one. A pointer
|
|
293
|
+
* without the atomic prefix is remapped
|
|
271
294
|
* verbatim under the (whole-batch) document at op index `undefined`. The original error is not
|
|
272
295
|
* mutated.
|
|
273
296
|
*/
|
|
274
|
-
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined
|
|
297
|
+
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined, relationForOp?: (opIndex: number) => {
|
|
298
|
+
rel: string;
|
|
299
|
+
hasPivot: boolean;
|
|
300
|
+
} | undefined): JsonApiError;
|
|
275
301
|
//#endregion
|
|
276
|
-
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListFilterMember, ListPageParams, LoadAllOptions, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, loadAll, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
302
|
+
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedMeta, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, AdditionalMembersDescriptor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicOperationArgs, AtomicRecorder, AtomicRef, AtomicRelationshipArgs, AtomicRelationshipHandle, AtomicRelationshipRecorder, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CollectionMeta, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, DeleteArgs, DeleteResult, Document, DocumentEnvelope, DocumentMeta, DocumentMetaDescriptor, DocumentMetaOperation, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListFilterMember, ListPageParams, LoadAllOptions, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, MetaObject, MetaOption, MutationMetaOf, MutationVerb, NavigateOptions, type NestedFieldset, NestedFieldsetMember, OperationExamples, OperationMeta, OptionsArg, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedMeta, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationRequestMetaOf, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, RelationshipMembers, RequestMetaOf, RequestMetaOperation, RequiresRequestMeta, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceMetaDescriptor, ResourceMetaOf, ResourceObjectView, ResourceWriteMeta, ResourceWriteOperation, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, TakesVerb, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationContext, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithDocumentMeta, WithLinks, WritableRelationName, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, loadAll, materialise, mediaType, nestedFieldset, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, sparseSchema, sparseSchemas, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedDocumentMetaPaths, withRemappedPaths, withRemappedRelationshipPaths, withTopLevelMeta };
|
|
277
303
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/errors.ts","../src/filters.ts","../src/load-all.ts","../src/serialize-write.ts"],"mappings":";;;;;;AAOA;;;;UAAiB,kBAAA;EACf,EAAA;EACA,MAAA;EACA,IAAA,GAAO,CAAA;EACP,KAAA;EACA,MAAA;EACA,MAAA;IAAW,OAAA;IAAkB,SAAA;IAAoB,MAAA;EAAA;EACjD,IAAA,GAAO,MAAM;EAAN;;;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CAAS,MAAA,iCACd,GAAA;EAAQ,IAAA,GAAO,QAAA,CAAS,MAAA;AAAA;;;;AH3BoB;AAgB/C;;;;;;;;iBG2BgB,sBAAA,CACd,IAAA,WACA,WAAA,mBACC,oBAAoB;AH9BsD;AAS7E;;;;;;;;;;;;;;;;AAA+F;AAO/F;;AAhB6E,iBG2H7D,YAAA,CAAa,UAAA,EAAY,aAAa,EAAE,IAAA,UAAc,OAAA;;;;;;;;;;;;;;;;;;;iBAoFtD,wBAAA,CAAyB,GAAA,UAAa,QAAA,WAAmB,OAAA;;;AH7LrC;AAOpC;;;iBGwMgB,iBAAA,CACd,KAAA,EAAO,YAAA,EACP,UAAA,EAAY,aAAA,EACZ,IAAA,WACC,YAAA;;;;;AH5MsE;AASzE;;iBG8MgB,6BAAA,CACd,KAAA,EAAO,YAAA,EACP,GAAA,UACA,QAAA,YACC,YAAY;;;;;;;iBAUC,6BAAA,CAA8B,KAAA,EAAO,YAAA,GAAe,YAAY;;;;;;;;;;;;iBAsBhE,uBAAA,CACd,KAAA,EAAO,YAAA,EACP,UAAA,EAAY,aAAA,EACZ,SAAA,GAAY,OAAA,iCACZ,aAAA,IAAiB,OAAA;EAAsB,GAAA;EAAa,QAAA;AAAA,gBACnD,YAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DocumentMeta, $n as LinkObject, $r as PaginatorStrategy, $t as ResourceObjectView, A as TransportResponse, An as AtomicOperationArgs, Ar as ActionDescriptor, At as RelatedIncludedType, B as Client, Bn as runAtomic, Br as ClientIdPolicy, Bt as RelationPageParams, C as ClientOptions, Cn as ActionLocation, Cr as Accepted, Ct as NestedFieldsetMember, D as JsonApiTransport, Dn as AtomicCreateInput, Dr as parseRetryAfter, Dt as ReadResult, E as createClient, En as AtomicCreateHandle, Er as isAccepted, Et as PivotInput, F as ActionCallOptions, Fn as AtomicRelationshipRecorder, Fr as AdditionalMembersDescriptor, Ft as RelatedQueryRelation, G as CountedRelationName, Gn as MediaTypeParams, Gr as InputMedia, Gt as RelationshipAccessor, H as CollectionMeta, Hn as ATOMIC_MEDIA_TYPE, Hr as DocumentMetaDescriptor, Ht as RelationReadQuery, I as ActionsAccessor, In as AtomicResult, Ir as ApiDescriptor, It as RelatedReadRelatedQuery, J as DefaultActionTypes, Jn as ArrayEnvelope, Jr as MenuDescriptor, Jt as RequiresRequestMeta, K as CreateInput, Kn as ResourceIdentifier, Kr as InputMediaKind, Kt as RelationshipMembers, L as AtomicResultOf, Ln as AtomicResults, Lr as ApiExamples, Lt as RelationCollection, M as AcceptedJob, Mn as AtomicRef, Mr as ActionLocationDescriptor, Mt as RelatedQuery, N as AcceptedMeta, Nn as AtomicRelationshipArgs, Nr as ActionOutput, Nt as RelatedQueryEntry, O as TransportRawBody, On as AtomicDeleteHandle, Or as AcceptedDescriptor, Ot as ReadableRelationName, P as AcceptedOf, Pn as AtomicRelationshipHandle, Pr as ActionScope, Pt as RelatedQueryParam, Q as DeleteResult, Qn as Link, Qr as PaginatorRole, Qt as ResourceMetaOf, R as BinaryBody, Rn as AtomicUpdateHandle, Rr as AtomicDescriptor, Rt as RelationFilterQuery, S as serializeQuery, Sn as WriteResult, Sr as resolvePaginator, St as MutationVerb, T as HeadersInit, Tn as readActionLocation, Tr as PollTimeoutError, Tt as OptionsArg, U as CountAccessor, Un as JSON_API_MEDIA_TYPE, Ur as DocumentMetaOperation, Ut as RelationRequestMetaOf, V as Collection, Vn as ATOMIC_EXT, Vr as CountableDescriptor, Vt as RelationPaginator, W as CountToken, Wn as LocalIdentifier, Wr as FilterFamilyDescriptor, Wt as RelationSortQuery, X as DefaultWriteAttributes, Xn as Edge, Xr as PaginatorDescriptor, Xt as ResourceCountToken, Y as DefaultAttributes, Yn as DocumentEnvelope, Yr as OperationExamples, Yt as ResourceAccessors, Z as DeleteArgs, Zn as EdgeEnvelope, Zr as PaginatorKind, Zt as ResourceHandle, _ as RawResponseType, _n as WaitedWriteResult, _r as PageOf, _t as LooseRelatedQueryEntry, a as ValidationOption, ai as RelationDescriptor, an as SortQuery, ar as ResourceLinks, at as FilterQuery, b as executeRaw, bn as WritableRelationName, br as ResolvedPaginator, bt as MetaOption, c as assertJsonApiDocument, ci as ResourceCountOperation, cn as TypeAccessor, cr as relatedPaginatorKind, ct as IncludePath, d as sparseSchemas, di as ResourceMetaDescriptor, dn as TypedRelatedReadQuery, dr as CANONICAL_PAGE_KEYS, dt as IncludedType, ei as PivotDescriptor, en as ResourceWriteMeta, er as MaterialiseContext, et as EdgeMembers, f as validateDocument, fi as SortFamilyDescriptor, fn as TypedRelationReadQuery, fr as ExactPageParams, ft as IsSingleton, g as JsonApiRequest, gn as WaitValue, gr as PageMeta, gt as LooseRelatedQuery, h as JsonApiContext, hn as WaitOptions, hr as PageLinks, ht as ListPageParams, i as ValidationContext, ii as RelatedQueryOperation, in as SingletonUpdateInput, ir as ResourceEnvelope, it as FilterKey, j as fetchTransport, jn as AtomicRecorder, jr as ActionInput, jt as RelatedMeta, k as TransportRequest, kn as AtomicHandle, kr as AcceptedOperation, kt as RelatedIncludedResource, l as resolveValidator, li as ResourceDescriptor, ln as TypeName, lr as NestedFieldset, lt as IncludedRelations, m as ExecutedResponse, mi as isPolymorphic, mn as UpdateMethod, mr as PageKeys, mt as ListFilterMember, n as SchemaMap, ni as RawOutputMedia, nn as SingleReadQuery, nr as RelationArrayEnvelope, nt as FieldSelectionMap, o as Validator, oi as RelationMutations, on as SortToken, or as materialise, ot as HydratedMember, p as Document, pi as StrategyDescriptor, pn as UpdateInput, pr as Page, pt as LinkageRef, q as CreateMethod, qn as mediaType, qr as MediaExamples, qt as RequestMetaOf, r as ValidationConfig, ri as RelatedQueryDescriptor, rn as SingletonAccessor, rr as RelationView, rt as FieldsMap, s as WireResource, si as RequestMetaOperation, sn as TakesVerb, sr as relatedPaginator, st as IdentifierMember, t as ResolvedValidator, ti as RawMediaKind, tn as ResourceWriteOperation, tr as NavigateOptions, tt as ErrorCodeOf, u as sparseSchema, ui as ResourceExamples, un as TypedReadQuery, ur as nestedFieldset, ut as IncludedResource, v as ReadQuery, vn as WithDocumentMeta, vr as PageParams, vt as MemberName, w as HANDLE_RESERVED, wn as isActionLocation, wr as PollOptions, wt as OperationMeta, x as executeResponse, xn as WriteOptions, xr as TypedPage, xt as MutationMetaOf, y as execute, yn as WithLinks, yr as PageParamsOf, yt as MetaObject, z as BinaryResponseType, zn as AtomicUpdateInput, zr as Cardinality, zt as RelationName } from "./validate-CMy8mJD2.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
/**
|
|
@@ -171,7 +171,10 @@ interface WriteDocument {
|
|
|
171
171
|
id?: string;
|
|
172
172
|
attributes?: Record<string, unknown>;
|
|
173
173
|
relationships?: Record<string, RelationshipDocument>;
|
|
174
|
+
meta?: Record<string, unknown>;
|
|
174
175
|
};
|
|
176
|
+
/** The document's top-level `meta`, which a write takes in its options. */
|
|
177
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
175
178
|
}
|
|
176
179
|
/** Options for {@link toDocument}. */
|
|
177
180
|
interface ToDocumentOptions {
|
|
@@ -194,9 +197,17 @@ interface ToDocumentOptions {
|
|
|
194
197
|
*
|
|
195
198
|
* `data.type` is always the accessor `type`. `data.id` is written from `opts.id` (an update),
|
|
196
199
|
* else from `input.id` only when the type's `clientId` policy allows it (omitted when
|
|
197
|
-
* `forbidden`, passed through when `optional`/`required`).
|
|
200
|
+
* `forbidden`, passed through when `optional`/`required`). A `$meta` object is the resource
|
|
201
|
+
* object's `meta`.
|
|
198
202
|
*/
|
|
199
203
|
declare function toDocument(descriptor: ApiDescriptor, type: string, input: Record<string, unknown>, opts?: ToDocumentOptions): WriteDocument;
|
|
204
|
+
/**
|
|
205
|
+
* A write document with the top-level `meta` a call's options carry, or the document as it is
|
|
206
|
+
* when they carry none.
|
|
207
|
+
*/
|
|
208
|
+
declare function withTopLevelMeta<Doc extends object>(doc: Doc, meta: Readonly<Record<string, unknown>> | undefined): Doc & {
|
|
209
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
210
|
+
};
|
|
200
211
|
/**
|
|
201
212
|
* Build a relationship-mutation document `{ data: <linkage> }` for the
|
|
202
213
|
* `/{type}/{id}/relationships/{rel}` endpoints, coercing the caller's refs by cardinality:
|
|
@@ -218,6 +229,8 @@ declare function toRelationshipDocument(refs: unknown, cardinality: 'one' | 'man
|
|
|
218
229
|
* - `/data/id` -> `id` (client-id create conflict)
|
|
219
230
|
* - `/data/attributes/releaseInfo/label` -> `releaseInfo.label` (nested map)
|
|
220
231
|
* - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
|
|
232
|
+
* - `/data/meta/source` -> `$meta.source`
|
|
233
|
+
* - `/meta/idempotencyKey` -> `$documentMeta.idempotencyKey`
|
|
221
234
|
*
|
|
222
235
|
* Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
|
|
223
236
|
* `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
|
|
@@ -244,7 +257,8 @@ declare function remapPointer(descriptor: ApiDescriptor, type: string, pointer:
|
|
|
244
257
|
* to the relation name (drop the `relationships/<name>` prefix) rather than treating
|
|
245
258
|
* `relationships` as a linkage sub-segment.
|
|
246
259
|
*
|
|
247
|
-
* A
|
|
260
|
+
* A pointer into the top-level `meta` becomes `$documentMeta.<member>`, and any other non-`data`
|
|
261
|
+
* pointer is returned verbatim.
|
|
248
262
|
*/
|
|
249
263
|
declare function remapRelationshipPointer(rel: string, hasPivot: boolean, pointer: string): string;
|
|
250
264
|
/**
|
|
@@ -262,16 +276,28 @@ declare function withRemappedPaths(error: JsonApiError, descriptor: ApiDescripto
|
|
|
262
276
|
* `$pivot`. The original error is not mutated.
|
|
263
277
|
*/
|
|
264
278
|
declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string, hasPivot: boolean): JsonApiError;
|
|
279
|
+
/**
|
|
280
|
+
* Give each error on the request document's top-level `meta` its `$documentMeta.<member>` path,
|
|
281
|
+
* for a request whose other members the client didn't build, such as a bespoke action document or
|
|
282
|
+
* a meta-only one. Every other error is passed through unchanged. The original error is not
|
|
283
|
+
* mutated.
|
|
284
|
+
*/
|
|
285
|
+
declare function withRemappedDocumentMetaPaths(error: JsonApiError): JsonApiError;
|
|
265
286
|
/**
|
|
266
287
|
* Invert an atomic-batch error's `source.pointer` to `(opIndex, flatPath)`: an atomic 422
|
|
267
288
|
* points at `/atomic:operations/{n}/data/...`, so strip the `atomic:operations/{n}` prefix to
|
|
268
289
|
* the op index, resolve that op's wire type (`typeForOp`), and delegate the remaining `/data`
|
|
269
290
|
* tail to the same {@link remapPointer} a standalone write uses (so the flat path is identical
|
|
270
|
-
* — `title`, `releaseInfo.label`, `artist`, …). A
|
|
291
|
+
* — `title`, `releaseInfo.label`, `artist`, …). A relationship op's tail is remapped under its
|
|
292
|
+
* relation, as a standalone relationship write's is, when `relationForOp` names one. A pointer
|
|
293
|
+
* without the atomic prefix is remapped
|
|
271
294
|
* verbatim under the (whole-batch) document at op index `undefined`. The original error is not
|
|
272
295
|
* mutated.
|
|
273
296
|
*/
|
|
274
|
-
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined
|
|
297
|
+
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined, relationForOp?: (opIndex: number) => {
|
|
298
|
+
rel: string;
|
|
299
|
+
hasPivot: boolean;
|
|
300
|
+
} | undefined): JsonApiError;
|
|
275
301
|
//#endregion
|
|
276
|
-
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListFilterMember, ListPageParams, LoadAllOptions, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, loadAll, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
302
|
+
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedMeta, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, AdditionalMembersDescriptor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicOperationArgs, AtomicRecorder, AtomicRef, AtomicRelationshipArgs, AtomicRelationshipHandle, AtomicRelationshipRecorder, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CollectionMeta, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, DeleteArgs, DeleteResult, Document, DocumentEnvelope, DocumentMeta, DocumentMetaDescriptor, DocumentMetaOperation, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListFilterMember, ListPageParams, LoadAllOptions, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, MetaObject, MetaOption, MutationMetaOf, MutationVerb, NavigateOptions, type NestedFieldset, NestedFieldsetMember, OperationExamples, OperationMeta, OptionsArg, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedMeta, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationRequestMetaOf, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, RelationshipMembers, RequestMetaOf, RequestMetaOperation, RequiresRequestMeta, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceMetaDescriptor, ResourceMetaOf, ResourceObjectView, ResourceWriteMeta, ResourceWriteOperation, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, TakesVerb, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationContext, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithDocumentMeta, WithLinks, WritableRelationName, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, loadAll, materialise, mediaType, nestedFieldset, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, sparseSchema, sparseSchemas, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedDocumentMetaPaths, withRemappedPaths, withRemappedRelationshipPaths, withTopLevelMeta };
|
|
277
303
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/errors.ts","../src/filters.ts","../src/load-all.ts","../src/serialize-write.ts"],"mappings":";;;;;;AAOA;;;;UAAiB,kBAAA;EACf,EAAA;EACA,MAAA;EACA,IAAA,GAAO,CAAA;EACP,KAAA;EACA,MAAA;EACA,MAAA;IAAW,OAAA;IAAkB,SAAA;IAAoB,MAAA;EAAA;EACjD,IAAA,GAAO,MAAM;EAAN;;;;AAYA;EANP,IAAA;EAgBgC;;;;;EAVhC,OAAA;AA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