@blux.ai/web-sdk 2.1.4-dev4 → 2.2.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"APIs.js","sourceRoot":"/","sources":["src/apis/APIs.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,6BAA6B,EAC7B,cAAc,EACd,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAK7B,IAAK,UAKJ;AALD,WAAK,UAAU;IACb,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AACnB,CAAC,EALI,UAAU,KAAV,UAAU,QAKd;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,gBAAgB,GAAG,gCAAgC,CAAC;AAC1D,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAE/D,MAAM,KAAW,IAAI,CAyOpB;AAzOD,WAAiB,IAAI;IACnB,IAAiB,mBAAmB,CA6BnC;IA7BD,WAAiB,mBAAmB;QACrB,wBAAI,GAAG,qBAAqB,CAAC;QAC7B,wBAAI,GAAG,GAAG,gBAAgB,wBAAwB,CAAC;QACnD,0BAAM,GAAG,UAAU,CAAC,IAAI,CAAC;QAEzB,8BAAU,GAAG,CAAC,CAAC,MAAM,CAAC;YACjC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE;YACpC,YAAY,EAAE,8BAA8B,CAAC,QAAQ,EAAE;YACvD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;YACxB,aAAa,EAAE,CAAC,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namespace */\nimport { z } from \"zod\";\n\nimport {\n countryCodeWithLowerCaseSchema,\n customPropertiesRequestSchema,\n customPropertiesSchema,\n dateSchema,\n eventPropertiesSchema,\n internalEventPropertiesSchema,\n objectIdSchema,\n recommendationRequestSchema,\n} from \"../utils/zodSchemas\";\n\nimport type { Serialize } from \"../utils/Base\";\nimport type { RecResponse } from \"../utils/zodSchemas\";\n\nenum HttpMethod {\n GET = \"get\",\n POST = \"post\",\n PUT = \"put\",\n DELETE = \"delete\",\n}\n\nexport enum DevicePlatform {\n ios = \"ios\",\n android = \"android\",\n browser = \"browser\",\n}\n\nconst applicationsRoot = \"/applications/{application_id}\";\nconst applicationsRootV2 = \"/v2/applications/{application_id}\";\n\nexport namespace APIs {\n export namespace bluxUsersInitialize {\n export const name = \"bluxUsersInitialize\";\n export const path = `${applicationsRoot}/blux-users/initialize`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n country_code: countryCodeWithLowerCaseSchema.optional(),\n device_model: z.string(),\n language_code: z.string(),\n os_version: z.string(),\n platform: z.nativeEnum(DevicePlatform),\n sdk_type: z.string(),\n sdk_version: z.string(),\n timezone: z.string(),\n isVisitHandlingInSdk: z.boolean().default(false), // sdk 업데이트 후 삭제\n blux_user_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n device_id?: string;\n };\n }\n\n export namespace bluxUsersSignIn {\n export const name = \"bluxUsersSignIn\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-in`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n user_id: z.string(),\n device_id: z.string().optional(), // TODO: @all sdk update 후 필수로 변경\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersSignOut {\n export const name = \"bluxUsersSignOut\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-out`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(), // TODO: @all objectIdSchema 로 변경\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersCollectEvents {\n export const name = \"bluxUsersCollectEvents\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/collect-events`;\n export const method = HttpMethod.POST;\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n events: z.array(\n z.object({\n device_id: objectIdSchema.optional(),\n event_type: z.string(),\n event_properties: eventPropertiesSchema.optional(),\n custom_event_properties: customPropertiesSchema.optional(),\n internal_event_properties: internalEventPropertiesSchema.optional(),\n captured_at: dateSchema,\n }),\n ),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData = boolean;\n }\n\n export namespace bluxUsersUpdateUserProperties {\n export const name = \"bluxUsersUpdateUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: z.object({\n phone_number: z.string().nullable().optional(),\n email_address: z.string().nullable().optional(),\n nighttime_notification_consent: z.boolean().nullable().optional(),\n marketing_notification_consent: z.boolean().nullable().optional(),\n\n // TODO: @luna 김캐디 연동 수정 이후 삭제\n sms_consent: z.boolean().nullable().optional(),\n email_consent: z.boolean().nullable().optional(),\n\n marketing_notification_sms_consent: z.boolean().nullable().optional(),\n marketing_notification_email_consent: z.boolean().nullable().optional(),\n marketing_notification_kakao_consent: z.boolean().nullable().optional(),\n marketing_notification_push_consent: z.boolean().nullable().optional(),\n }),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersUpdateCustomUserProperties {\n export const name = \"bluxUsersUpdateCustomUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-custom-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: customPropertiesRequestSchema,\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersGetItemRecommendationsV2 {\n export const name = \"bluxUsersGetItemRecommendationsV2\";\n export const path = `${applicationsRootV2}/blux-users/{blux_user_id}/item-recommendations`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = recommendationRequestSchema;\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = RecResponse;\n }\n\n export namespace crmEventsCreate {\n export const name = \"crmEventsCreate\";\n export const path = `${applicationsRoot}/crm-events`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n notification_id: objectIdSchema,\n crm_event_type: z.union([\n z.literal(\"push_opened\"),\n z.literal(\"button_clicked\"),\n z.literal(\"landing_clicked\"),\n z.literal(\"inapp_opened\"),\n ]),\n captured_at: dateSchema,\n item_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = boolean;\n }\n export namespace inappsDispatcher {\n export const name = \"inappsDispatcher\";\n export const path = `${applicationsRoot}/inapps/dispatch`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n blux_user_id: objectIdSchema,\n device_id: objectIdSchema,\n platform: z.union([\n z.literal(DevicePlatform.android),\n z.literal(DevicePlatform.ios),\n z.literal(DevicePlatform.browser),\n ]),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData =\n | ({\n notificationId: string;\n inappId: string;\n htmlString: string;\n baseUrl: string;\n } & { shouldDisplay: true; nextPollDelay: number })\n | {\n shouldDisplay: false;\n nextPollDelay: number;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"APIs.js","sourceRoot":"/","sources":["src/apis/APIs.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,6BAA6B,EAC7B,cAAc,EACd,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAK7B,IAAK,UAKJ;AALD,WAAK,UAAU;IACb,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AACnB,CAAC,EALI,UAAU,KAAV,UAAU,QAKd;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,gBAAgB,GAAG,gCAAg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AAC;QAGU,2BAAU,GAAG,CAAC,CAAC,MAAM,CAAC;YACjC,YAAY,EAAE,cAAc;YAC5B,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;gBAChB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;gBACjC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC;gBAC7B,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;aAClC,CAAC;SACH,CAAC,CAAC;IAcL,CAAC,EAhCgB,gBAAgB,GAAhB,qBAAgB,KAAhB,qBAAgB,QAgChC;IAED,IAAiB,mBAAmB,CAgBnC;IAhBD,WAAiB,mBAAmB;QACrB,wBAAI,GAAG,qBAAqB,CAAC;QAC7B,wBAAI,GAAG,GAAG,gBAAgB,kCAAkC,CAAC;QAC7D,0BAAM,GAAG,UAAU,CAAC,IAAI,CAAC;QAEzB,8BAAU,GAAG,CAAC,CAAC,MAAM,CAAC;YACjC,cAAc,EAAE,cAAc;YAC9B,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;QAGU,8BAAU,GAAG,CAAC,CAAC,MAAM,CAAC;YACjC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;SAC9B,CAAC,CAAC;IAGL,CAAC,EAhBgB,mBAAmB,GAAnB,wBAAmB,KAAnB,wBAAmB,QAgBnC;AACH,CAAC,EA3PgB,IAAI,KAAJ,IAAI,QA2PpB","sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\nimport { z } from \"zod\";\n\nimport {\n countryCodeWithLowerCaseSchema,\n customPropertiesRequestSchema,\n customPropertiesSchema,\n dateSchema,\n eventPropertiesSchema,\n internalEventPropertiesSchema,\n objectIdSchema,\n recommendationRequestSchema,\n} from \"../utils/zodSchemas\";\n\nimport type { Serialize } from \"../utils/Base\";\nimport type { RecResponse } from \"../utils/zodSchemas\";\n\nenum HttpMethod {\n GET = \"get\",\n POST = \"post\",\n PUT = \"put\",\n DELETE = \"delete\",\n}\n\nexport enum DevicePlatform {\n ios = \"ios\",\n android = \"android\",\n browser = \"browser\",\n}\n\nconst applicationsRoot = \"/applications/{application_id}\";\nconst applicationsRootV2 = \"/v2/applications/{application_id}\";\n\nexport namespace APIs {\n export namespace bluxUsersInitialize {\n export const name = \"bluxUsersInitialize\";\n export const path = `${applicationsRoot}/blux-users/initialize`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n country_code: countryCodeWithLowerCaseSchema.optional(),\n device_model: z.string(),\n language_code: z.string(),\n os_version: z.string(),\n platform: z.nativeEnum(DevicePlatform),\n sdk_type: z.string(),\n sdk_version: z.string(),\n timezone: z.string(),\n isVisitHandlingInSdk: z.boolean().default(false), // sdk 업데이트 후 삭제\n blux_user_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n device_id?: string;\n };\n }\n\n export namespace bluxUsersSignIn {\n export const name = \"bluxUsersSignIn\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-in`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n user_id: z.string(),\n device_id: z.string().optional(), // TODO: @all sdk update 후 필수로 변경\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersSignOut {\n export const name = \"bluxUsersSignOut\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/sign-out`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n device_id: objectIdSchema.optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(), // TODO: @all objectIdSchema 로 변경\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersCollectEvents {\n export const name = \"bluxUsersCollectEvents\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/collect-events`;\n export const method = HttpMethod.POST;\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n events: z.array(\n z.object({\n device_id: objectIdSchema.optional(),\n event_type: z.string(),\n event_properties: eventPropertiesSchema.optional(),\n custom_event_properties: customPropertiesSchema.optional(),\n internal_event_properties: internalEventPropertiesSchema.optional(),\n captured_at: dateSchema,\n }),\n ),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData = boolean;\n }\n\n export namespace bluxUsersUpdateUserProperties {\n export const name = \"bluxUsersUpdateUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: z.object({\n phone_number: z.string().nullable().optional(),\n email_address: z.string().nullable().optional(),\n nighttime_notification_consent: z.boolean().nullable().optional(),\n marketing_notification_consent: z.boolean().nullable().optional(),\n\n // TODO: @luna 김캐디 연동 수정 이후 삭제\n sms_consent: z.boolean().nullable().optional(),\n email_consent: z.boolean().nullable().optional(),\n\n marketing_notification_sms_consent: z.boolean().nullable().optional(),\n marketing_notification_email_consent: z.boolean().nullable().optional(),\n marketing_notification_kakao_consent: z.boolean().nullable().optional(),\n marketing_notification_push_consent: z.boolean().nullable().optional(),\n }),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersUpdateCustomUserProperties {\n export const name = \"bluxUsersUpdateCustomUserProperties\";\n export const path = `${applicationsRoot}/blux-users/{blux_user_id}/update-custom-user-properties`;\n export const method = HttpMethod.PUT;\n\n export const bodySchema = z.object({\n properties: customPropertiesRequestSchema,\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string().optional(),\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = {\n blux_user_id: string;\n };\n }\n\n export namespace bluxUsersGetItemRecommendationsV2 {\n export const name = \"bluxUsersGetItemRecommendationsV2\";\n export const path = `${applicationsRootV2}/blux-users/{blux_user_id}/item-recommendations`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = recommendationRequestSchema;\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n blux_user_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = RecResponse;\n }\n\n export namespace crmEventsCreate {\n export const name = \"crmEventsCreate\";\n export const path = `${applicationsRoot}/crm-events`;\n export const method = HttpMethod.POST;\n\n export const bodySchema = z.object({\n notification_id: objectIdSchema,\n crm_event_type: z.union([\n z.literal(\"push_opened\"),\n z.literal(\"button_clicked\"),\n z.literal(\"landing_clicked\"),\n z.literal(\"inapp_opened\"),\n ]),\n captured_at: dateSchema,\n item_id: z.string().optional(),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export const pathSchema = z.object({\n application_id: z.string(),\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export type ResponseData = boolean;\n }\n export namespace inappsDispatcher {\n export const name = \"inappsDispatcher\";\n export const path = `${applicationsRoot}/inapps/dispatch`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n blux_user_id: objectIdSchema,\n device_id: objectIdSchema,\n platform: z.union([\n z.literal(DevicePlatform.android),\n z.literal(DevicePlatform.ios),\n z.literal(DevicePlatform.browser),\n ]),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n\n export type ResponseData =\n | ({\n notificationId: string;\n inappId: string;\n htmlString: string;\n baseUrl: string;\n } & { shouldDisplay: true; nextPollDelay: number })\n | {\n shouldDisplay: false;\n nextPollDelay: number;\n };\n }\n\n export namespace notificationsUpdate {\n export const name = \"notificationsUpdate\";\n export const path = `${applicationsRoot}/notifications/{notification_id}`;\n export const method = HttpMethod.POST;\n\n export const pathSchema = z.object({\n application_id: objectIdSchema,\n notification_id: objectIdSchema,\n });\n export type PathParam = Serialize<z.input<typeof pathSchema>>;\n\n export const bodySchema = z.object({\n status: z.literal(\"received\"),\n });\n export type Body = Serialize<z.input<typeof bodySchema>>;\n export type ResponseData = boolean;\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { APIs } from "./APIs";
2
+ import type { AxiosInstance } from "axios";
3
+ import API = APIs.notificationsUpdate;
4
+ export declare const notificationsUpdate: (instance: AxiosInstance, pathParams: API.PathParam, body: API.Body, headers: Record<string, string>) => Promise<import("axios").AxiosResponse<boolean, any>>;
@@ -0,0 +1,7 @@
1
+ import { APIs } from "./APIs";
2
+ import { getPath } from "../utils/getPath";
3
+ var API = APIs.notificationsUpdate;
4
+ export const notificationsUpdate = (instance, pathParams, body, headers) => instance[API.method](getPath(API.path, pathParams), body, {
5
+ headers,
6
+ });
7
+ //# sourceMappingURL=notificationsUpdate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notificationsUpdate.js","sourceRoot":"/","sources":["src/apis/notificationsUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,IAAO,GAAG,GAAG,IAAI,CAAC,mBAAmB,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAuB,EACvB,UAAyB,EACzB,IAAc,EACd,OAA+B,EAC/B,EAAE,CACF,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAmB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE;IAC1E,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { APIs } from \"./APIs\";\nimport { getPath } from \"../utils/getPath\";\n\nimport type { AxiosInstance } from \"axios\";\n\nimport API = APIs.notificationsUpdate;\n\nexport const notificationsUpdate = (\n instance: AxiosInstance,\n pathParams: API.PathParam,\n body: API.Body,\n headers: Record<string, string>,\n) =>\n instance[API.method]<API.ResponseData>(getPath(API.path, pathParams), body, {\n headers,\n });\n"]}
@@ -0,0 +1,30 @@
1
+ import { BluxClient } from "../BluxClient";
2
+ import { EventRequest } from "../events/types";
3
+ export type BridgePlatform = "none" | "react-native" | "flutter";
4
+ export type BridgeAction = "initialize" | "signIn" | "signOut" | "setUserProperties" | "setCustomUserProperties" | "sendEvent";
5
+ declare const _bridgePayloadMap: {
6
+ initialize: {
7
+ bluxApplicationId: string;
8
+ bluxAPIKey: string;
9
+ };
10
+ signIn: Parameters<BluxClient["signIn"]>[0];
11
+ signOut: {};
12
+ setUserProperties: Parameters<BluxClient["setUserProperties"]>[0]["userProperties"];
13
+ setCustomUserProperties: Parameters<BluxClient["setCustomUserProperties"]>[0]["customUserProperties"];
14
+ sendEvent: {
15
+ requests: EventRequest[];
16
+ };
17
+ };
18
+ export type BridgePayloadMap = typeof _bridgePayloadMap;
19
+ export type BridgePayload = BridgePayloadMap[keyof BridgePayloadMap];
20
+ export declare abstract class Bridge {
21
+ abstract readonly platform: BridgePlatform;
22
+ protected abstract postMessage(action: BridgeAction, payload?: BridgePayload): void;
23
+ abstract initialize(payload: BridgePayloadMap["initialize"]): void;
24
+ abstract signIn(payload: BridgePayloadMap["signIn"]): void;
25
+ abstract signOut(): void;
26
+ abstract setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
27
+ abstract setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
28
+ abstract sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
29
+ }
30
+ export {};
@@ -0,0 +1,11 @@
1
+ const _bridgePayloadMap = {
2
+ initialize: { bluxApplicationId: "", bluxAPIKey: "" },
3
+ signIn: {},
4
+ signOut: {},
5
+ setUserProperties: {},
6
+ setCustomUserProperties: {},
7
+ sendEvent: { requests: [] },
8
+ };
9
+ export class Bridge {
10
+ }
11
+ //# sourceMappingURL=Bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bridge.js","sourceRoot":"/","sources":["src/bridges/Bridge.ts"],"names":[],"mappings":"AAaA,MAAM,iBAAiB,GAAG;IACxB,UAAU,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,EAAyC;IACjD,OAAO,EAAE,EAAE;IACX,iBAAiB,EAAE,EAEG;IACtB,uBAAuB,EAAE,EAEG;IAC5B,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAoB,EAAE;CACN,CAAC;AAM1C,MAAM,OAAgB,MAAM;CAuB3B","sourcesContent":["import { BluxClient } from \"../BluxClient\";\nimport { EventRequest } from \"../events/types\";\n\nexport type BridgePlatform = \"none\" | \"react-native\" | \"flutter\";\n\nexport type BridgeAction =\n | \"initialize\"\n | \"signIn\"\n | \"signOut\"\n | \"setUserProperties\"\n | \"setCustomUserProperties\"\n | \"sendEvent\";\n\nconst _bridgePayloadMap = {\n initialize: { bluxApplicationId: \"\", bluxAPIKey: \"\" },\n signIn: {} as Parameters<BluxClient[\"signIn\"]>[0],\n signOut: {},\n setUserProperties: {} as Parameters<\n BluxClient[\"setUserProperties\"]\n >[0][\"userProperties\"],\n setCustomUserProperties: {} as Parameters<\n BluxClient[\"setCustomUserProperties\"]\n >[0][\"customUserProperties\"],\n sendEvent: { requests: [] as EventRequest[] },\n} satisfies Record<BridgeAction, unknown>;\n\nexport type BridgePayloadMap = typeof _bridgePayloadMap;\n\nexport type BridgePayload = BridgePayloadMap[keyof BridgePayloadMap];\n\nexport abstract class Bridge {\n abstract readonly platform: BridgePlatform;\n\n protected abstract postMessage(\n action: BridgeAction,\n payload?: BridgePayload,\n ): void;\n\n abstract initialize(payload: BridgePayloadMap[\"initialize\"]): void;\n\n abstract signIn(payload: BridgePayloadMap[\"signIn\"]): void;\n\n abstract signOut(): void;\n\n abstract setUserProperties(\n payload: BridgePayloadMap[\"setUserProperties\"],\n ): void;\n\n abstract setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ): void;\n\n abstract sendEvent(payload: BridgePayloadMap[\"sendEvent\"]): void;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { Bridge, BridgeAction, BridgePayload, BridgePayloadMap } from "./Bridge";
2
+ export declare class FlutterBridge extends Bridge {
3
+ readonly platform = "flutter";
4
+ protected postMessage(action: BridgeAction, payload?: BridgePayload): void;
5
+ initialize(payload: BridgePayloadMap["initialize"]): void;
6
+ signIn(payload: BridgePayloadMap["signIn"]): void;
7
+ signOut(): void;
8
+ setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
9
+ setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
10
+ sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
11
+ }
@@ -0,0 +1,45 @@
1
+ import { Bridge, } from "./Bridge";
2
+ import { Logger } from "../utils/Logger";
3
+ export class FlutterBridge extends Bridge {
4
+ platform = "flutter";
5
+ postMessage(action, payload) {
6
+ if (typeof window === "undefined") {
7
+ Logger.error("window is undefined", {
8
+ tags: { from: "FlutterBridge.postMessage" },
9
+ });
10
+ return;
11
+ }
12
+ if (window.Blux?.postMessage) {
13
+ window.Blux.postMessage(JSON.stringify({ action, payload }));
14
+ return;
15
+ }
16
+ if (window.flutter_inappwebview?.callHandler) {
17
+ window.flutter_inappwebview
18
+ .callHandler("Blux", JSON.stringify({ action, payload }))
19
+ .catch((err) => Logger.error(err, { tags: { from: "FlutterBridge.postMessage" } }));
20
+ return;
21
+ }
22
+ Logger.error("No Flutter WebView available", {
23
+ tags: { from: "FlutterBridge.postMessage" },
24
+ });
25
+ }
26
+ initialize(payload) {
27
+ this.postMessage("initialize", payload);
28
+ }
29
+ signIn(payload) {
30
+ this.postMessage("signIn", payload);
31
+ }
32
+ signOut() {
33
+ this.postMessage("signOut");
34
+ }
35
+ setUserProperties(payload) {
36
+ this.postMessage("setUserProperties", payload);
37
+ }
38
+ setCustomUserProperties(payload) {
39
+ this.postMessage("setCustomUserProperties", payload);
40
+ }
41
+ sendEvent(payload) {
42
+ this.postMessage("sendEvent", payload);
43
+ }
44
+ }
45
+ //# sourceMappingURL=FlutterBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlutterBridge.js","sourceRoot":"/","sources":["src/bridges/FlutterBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAIP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,OAAO,aAAc,SAAQ,MAAM;IAC9B,QAAQ,GAAG,SAAS,CAAC;IAEpB,WAAW,CAAC,MAAoB,EAAE,OAAuB;QACjE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE;gBAClC,IAAI,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;aAC5C,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAC7D,OAAO;QACT,CAAC;QAED,IAAI,MAAM,CAAC,oBAAoB,EAAE,WAAW,EAAE,CAAC;YAC7C,MAAM,CAAC,oBAAoB;iBACxB,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;iBACxD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACb,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE,EAAE,CAAC,CACnE,CAAC;YACJ,OAAO;QACT,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE;YAC3C,IAAI,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;IAED,UAAU,CAAC,OAAuC;QAChD,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,OAAmC;QACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,iBAAiB,CAAC,OAA8C;QAC9D,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,uBAAuB,CACrB,OAAoD;QAEpD,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,SAAS,CAAC,OAAsC;QAC9C,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["import {\n Bridge,\n BridgeAction,\n BridgePayload,\n BridgePayloadMap,\n} from \"./Bridge\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class FlutterBridge extends Bridge {\n readonly platform = \"flutter\";\n\n protected postMessage(action: BridgeAction, payload?: BridgePayload) {\n if (typeof window === \"undefined\") {\n Logger.error(\"window is undefined\", {\n tags: { from: \"FlutterBridge.postMessage\" },\n });\n return;\n }\n\n if (window.Blux?.postMessage) {\n window.Blux.postMessage(JSON.stringify({ action, payload }));\n return;\n }\n\n if (window.flutter_inappwebview?.callHandler) {\n window.flutter_inappwebview\n .callHandler(\"Blux\", JSON.stringify({ action, payload }))\n .catch((err) =>\n Logger.error(err, { tags: { from: \"FlutterBridge.postMessage\" } }),\n );\n return;\n }\n\n Logger.error(\"No Flutter WebView available\", {\n tags: { from: \"FlutterBridge.postMessage\" },\n });\n }\n\n initialize(payload: BridgePayloadMap[\"initialize\"]) {\n this.postMessage(\"initialize\", payload);\n }\n\n signIn(payload: BridgePayloadMap[\"signIn\"]) {\n this.postMessage(\"signIn\", payload);\n }\n\n signOut() {\n this.postMessage(\"signOut\");\n }\n\n setUserProperties(payload: BridgePayloadMap[\"setUserProperties\"]) {\n this.postMessage(\"setUserProperties\", payload);\n }\n\n setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ) {\n this.postMessage(\"setCustomUserProperties\", payload);\n }\n\n sendEvent(payload: BridgePayloadMap[\"sendEvent\"]) {\n this.postMessage(\"sendEvent\", payload);\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { Bridge, BridgeAction, BridgePayload, BridgePayloadMap } from "./Bridge";
2
+ export declare class RNBridge extends Bridge {
3
+ readonly platform = "react-native";
4
+ protected postMessage(action: BridgeAction, payload?: BridgePayload): void;
5
+ initialize(payload: BridgePayloadMap["initialize"]): void;
6
+ signIn(payload: BridgePayloadMap["signIn"]): void;
7
+ signOut(): void;
8
+ setUserProperties(payload: BridgePayloadMap["setUserProperties"]): void;
9
+ setCustomUserProperties(payload: BridgePayloadMap["setCustomUserProperties"]): void;
10
+ sendEvent(payload: BridgePayloadMap["sendEvent"]): void;
11
+ }
@@ -0,0 +1,39 @@
1
+ import { Bridge, } from "./Bridge";
2
+ import { Logger } from "../utils/Logger";
3
+ export class RNBridge extends Bridge {
4
+ platform = "react-native";
5
+ postMessage(action, payload) {
6
+ if (typeof window === "undefined") {
7
+ Logger.error("window is undefined", {
8
+ tags: { from: "RNBridge.postMessage" },
9
+ });
10
+ return;
11
+ }
12
+ if (!window.ReactNativeWebView?.postMessage) {
13
+ Logger.error("No React Native WebView available", {
14
+ tags: { from: "RNBridge.postMessage" },
15
+ });
16
+ return;
17
+ }
18
+ window.ReactNativeWebView.postMessage(JSON.stringify({ action, payload }));
19
+ }
20
+ initialize(payload) {
21
+ this.postMessage("initialize", payload);
22
+ }
23
+ signIn(payload) {
24
+ this.postMessage("signIn", payload);
25
+ }
26
+ signOut() {
27
+ this.postMessage("signOut");
28
+ }
29
+ setUserProperties(payload) {
30
+ this.postMessage("setUserProperties", payload);
31
+ }
32
+ setCustomUserProperties(payload) {
33
+ this.postMessage("setCustomUserProperties", payload);
34
+ }
35
+ sendEvent(payload) {
36
+ this.postMessage("sendEvent", payload);
37
+ }
38
+ }
39
+ //# sourceMappingURL=RNBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNBridge.js","sourceRoot":"/","sources":["src/bridges/RNBridge.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,GAIP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,OAAO,QAAS,SAAQ,MAAM;IACzB,QAAQ,GAAG,cAAc,CAAC;IAEzB,WAAW,CAAC,MAAoB,EAAE,OAAuB;QACjE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE;gBAClC,IAAI,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;aACvC,CAAC,CAAC;YAEH,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE;gBAChD,IAAI,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;aACvC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,UAAU,CAAC,OAAuC;QAChD,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,OAAmC;QACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,iBAAiB,CAAC,OAA8C;QAC9D,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,uBAAuB,CACrB,OAAoD;QAEpD,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,SAAS,CAAC,OAAsC;QAC9C,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["import {} from \"../BluxClient\";\nimport {\n Bridge,\n BridgeAction,\n BridgePayload,\n BridgePayloadMap,\n} from \"./Bridge\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class RNBridge extends Bridge {\n readonly platform = \"react-native\";\n\n protected postMessage(action: BridgeAction, payload?: BridgePayload) {\n if (typeof window === \"undefined\") {\n Logger.error(\"window is undefined\", {\n tags: { from: \"RNBridge.postMessage\" },\n });\n\n return;\n }\n\n if (!window.ReactNativeWebView?.postMessage) {\n Logger.error(\"No React Native WebView available\", {\n tags: { from: \"RNBridge.postMessage\" },\n });\n return;\n }\n\n window.ReactNativeWebView.postMessage(JSON.stringify({ action, payload }));\n }\n\n initialize(payload: BridgePayloadMap[\"initialize\"]) {\n this.postMessage(\"initialize\", payload);\n }\n\n signIn(payload: BridgePayloadMap[\"signIn\"]) {\n this.postMessage(\"signIn\", payload);\n }\n\n signOut() {\n this.postMessage(\"signOut\");\n }\n\n setUserProperties(payload: BridgePayloadMap[\"setUserProperties\"]) {\n this.postMessage(\"setUserProperties\", payload);\n }\n\n setCustomUserProperties(\n payload: BridgePayloadMap[\"setCustomUserProperties\"],\n ) {\n this.postMessage(\"setCustomUserProperties\", payload);\n }\n\n sendEvent(payload: BridgePayloadMap[\"sendEvent\"]) {\n this.postMessage(\"sendEvent\", payload);\n }\n}\n"]}