UNPKG

@commercelayer/sdk

Version:
39 lines (36 loc) 1.42 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/notifications.ts var Notifications = class _Notifications extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "notifications"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _Notifications.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _Notifications.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _Notifications.TYPE } : id, options); } async event_stores(notificationId, params, options) { const _notificationId = notificationId.id || notificationId; return this.resources.fetch({ type: "event_stores" }, `notifications/${_notificationId}/event_stores`, params, options); } isNotification(resource) { return resource.type && resource.type === _Notifications.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _Notifications.TYPE; } }; var instance = new Notifications(); var notifications_default = instance; exports.notifications_default = notifications_default; //# sourceMappingURL=chunk-4B4WZM22.cjs.map //# sourceMappingURL=chunk-4B4WZM22.cjs.map