@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
1 lines • 2.63 kB
Source Map (JSON)
{"version":3,"sources":["../src/resources/event_stores.ts"],"names":["ApiResource"],"mappings":";;;;;AA+CA,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoBA,6BAAA,CAAwB;AAAA,EAEjD,OAAgB,IAAA,GAAuB,cAAA;AAAA,EAKvC,aAAa,QAAA,EAAuC;AACnD,IAAA,OAAO,QAAA,CAAS,IAAA,IAAS,QAAA,CAAS,IAAA,KAAS,YAAA,CAAY,IAAA;AAAA,EACxD;AAAA,EAGA,aAAa,EAAA,EAA+C;AAC3D,IAAA,OAAO,KAAA,CAAM,qBAAoC,EAAE,CAAA;AAAA,EACpD;AAAA,EAEA,sBAAsB,GAAA,EAAgC;AACrD,IAAA,OAAO,KAAA,CAAM,qBAAA,CAAqC,GAAG,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,IAAA,GAAuB;AACtB,IAAA,OAAO,YAAA,CAAY,IAAA;AAAA,EACpB;AAED,CAAA;AAGA,IAAM,QAAA,GAAW,IAAI,WAAA,EAAY;AACjC,IAAO,oBAAA,GAAQ","file":"chunk-QGFAOPJG.cjs","sourcesContent":["import { ApiResource } from '../resource'\nimport type { Resource, ResourceId, ResourceRel, ResourceSort, /* ResourceFilter */ } from '../resource'\n\n\n\n\ntype EventStoreType = 'event_stores'\ntype EventStoreRel = ResourceRel & { type: EventStoreType }\n\n\nexport type EventStoreSort = Pick<EventStore, 'id'> & ResourceSort\n// export type EventStoreFilter = Pick<EventStore, 'id'> & ResourceFilter\n\n\ninterface EventStore extends Resource {\n\t\n\treadonly type: EventStoreType\n\n\t/** \n\t * The type of the affected resource.\n\t * @example ```\"orders\"```\n\t */\n\tresource_type?: string | null\n\t/** \n\t * The ID of the affected resource.\n\t * @example ```\"PzdJhdLdYV\"```\n\t */\n\tresource_id?: string | null\n\t/** \n\t * The type of change (one of create or update).\n\t * @example ```\"update\"```\n\t */\n\tevent?: string | null\n\t/** \n\t * The object changes payload.\n\t * @example ```{\"status\":[\"draft\",\"placed\"]}```\n\t */\n\tpayload?: Record<string, any> | null\n\t/** \n\t * Information about who triggered the change.\n\t * @example ```{\"application\":{\"id\":\"DNOPYiZYpn\",\"kind\":\"sales_channel\",\"public\":true},\"owner\":{\"id\":\"yQQrBhLBmQ\",\"type\":\"Customer\"}}```\n\t */\n\twho?: Record<string, any> | null\n\t\n}\n\n\nclass EventStores extends ApiResource<EventStore> {\n\n\tstatic readonly TYPE: EventStoreType = 'event_stores' as const\n\n\t\n\n\n\tisEventStore(resource: any): resource is EventStore {\n\t\treturn resource.type && (resource.type === EventStores.TYPE)\n\t}\n\n\n\trelationship(id: string | ResourceId | null): EventStoreRel {\n\t\treturn super.relationshipOneToOne<EventStoreRel>(id)\n\t}\n\n\trelationshipToMany(...ids: string[]): EventStoreRel[] {\n\t\treturn super.relationshipOneToMany<EventStoreRel>(...ids)\n\t}\n\n\n\ttype(): EventStoreType {\n\t\treturn EventStores.TYPE\n\t}\n\n}\n\n\nconst instance = new EventStores()\nexport default instance\n\nexport type { EventStores, EventStore, EventStoreType }\n"]}