{"version":3,"file":"SubscriptionApiService.CL4laaME.mjs","names":[],"sources":["https:/asset.29cm.co.kr/contents/framer/apis/subscription/SubscriptionApiService.js"],"sourcesContent":["import { throwFailError } from \"../@middlewares/throwFailError.js\";\nimport { APIService } from \"../APIService.js\";\nimport { env } from \"../../config/index.js\";\nclass SubscriptionApiService extends APIService {\n  constructor() {\n    super();\n    this.setBaseUrl(env.api.content);\n    this.setMiddleware(throwFailError);\n  }\n  async getSubscriptionsByGroupKey(groupKey) {\n    var _a;\n    const response = await this.get(`/api/v4/framers/proxy/activation-api/api/v4/event-notification/events/${groupKey}/subscriptions`, void 0, {\n      credentials: \"include\"\n    });\n    return ((_a = response.data) == null ? void 0 : _a.eventKeys) ?? [];\n  }\n  async getSubscription(eventKey) {\n    const response = await this.get(`/api/v4/framers/proxy/activation-api/api/v4/event-notification/events/${eventKey}/subscription`, void 0, {\n      credentials: \"include\"\n    });\n    const isSubscribed = response.data ?? false;\n    return isSubscribed ? [eventKey] : [];\n  }\n  async subscribe(eventKeys) {\n    await this.post(\"/api/v4/framers/proxy/activation-api/api/v4/event-notification/events/subscription:on\", {\n      eventKeys\n    }, {\n      credentials: \"include\"\n    });\n    return eventKeys;\n  }\n  async unsubscribe(eventKey) {\n    await this.post(`/api/v4/framers/proxy/activation-api/v4/event-notification/events/${eventKey}/subscription:off`, void 0, {\n      credentials: \"include\"\n    });\n    return eventKey;\n  }\n}\nconst subscriptionApi = new SubscriptionApiService();\nexport {\n  subscriptionApi\n};\n"],"mappings":"gKAAmE,IACrB,IACF,CACtC,EAAN,cAAqC,CAAW,CAC9C,aAAc,CACZ,OAAO,CACP,KAAK,WAAW,EAAI,IAAI,QAAQ,CAChC,KAAK,cAAc,EAAe,CAEpC,MAAM,2BAA2B,EAAU,CAKzC,OAHiB,MAAM,KAAK,IAAI,yEAAyE,EAAS,gBAAiB,IAAK,GAAG,CACzI,YAAa,UACd,CAAC,EACqB,MAA4B,WAAc,EAAE,CAErE,MAAM,gBAAgB,EAAU,CAK9B,OAJiB,MAAM,KAAK,IAAI,yEAAyE,EAAS,eAAgB,IAAK,GAAG,CACxI,YAAa,UACd,CAAC,EAC4B,MAAQ,GAChB,CAAC,EAAS,CAAG,EAAE,CAEvC,MAAM,UAAU,EAAW,CAMzB,OALA,MAAM,KAAK,KAAK,wFAAyF,CACvG,YACD,CAAE,CACD,YAAa,UACd,CAAC,CACK,EAET,MAAM,YAAY,EAAU,CAI1B,OAHA,MAAM,KAAK,KAAK,qEAAqE,EAAS,mBAAoB,IAAK,GAAG,CACxH,YAAa,UACd,CAAC,CACK,IAGL,EAAkB,IAAI"}