@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
48 lines (46 loc) • 2.36 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/customer_password_resets.ts
var CustomerPasswordResets = class _CustomerPasswordResets extends ApiResource {
static TYPE = "customer_password_resets";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _CustomerPasswordResets.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _CustomerPasswordResets.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _CustomerPasswordResets.TYPE } : id, options);
}
async customer(customerPasswordResetId, params, options) {
const _customerPasswordResetId = customerPasswordResetId.id || customerPasswordResetId;
return this.resources.fetch({ type: "customers" }, `customer_password_resets/${_customerPasswordResetId}/customer`, params, options);
}
async events(customerPasswordResetId, params, options) {
const _customerPasswordResetId = customerPasswordResetId.id || customerPasswordResetId;
return this.resources.fetch({ type: "events" }, `customer_password_resets/${_customerPasswordResetId}/events`, params, options);
}
async event_stores(customerPasswordResetId, params, options) {
const _customerPasswordResetId = customerPasswordResetId.id || customerPasswordResetId;
return this.resources.fetch({ type: "event_stores" }, `customer_password_resets/${_customerPasswordResetId}/event_stores`, params, options);
}
async _reset_password_token(id, triggerValue, params, options) {
return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _CustomerPasswordResets.TYPE, _reset_password_token: triggerValue }, params, options);
}
isCustomerPasswordReset(resource) {
return resource.type && resource.type === _CustomerPasswordResets.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _CustomerPasswordResets.TYPE;
}
};
var instance = new CustomerPasswordResets();
var customer_password_resets_default = instance;
export { customer_password_resets_default };
//# sourceMappingURL=chunk-C47UWH7R.js.map
//# sourceMappingURL=chunk-C47UWH7R.js.map