@bzbs/react-api-client 1.4.8 → 1.4.9
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.
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -44,6 +44,11 @@ type RequestOptions = {
|
|
|
44
44
|
data?: any;
|
|
45
45
|
baseUrl?: string;
|
|
46
46
|
};
|
|
47
|
+
type CrossPlatformFile = File | {
|
|
48
|
+
uri: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
} | object;
|
|
47
52
|
declare class BaseService {
|
|
48
53
|
private client;
|
|
49
54
|
private baseUrl;
|
|
@@ -63,6 +68,7 @@ declare class BaseService {
|
|
|
63
68
|
[key: string]: string;
|
|
64
69
|
};
|
|
65
70
|
setBaseUrl(baseUrl: string): this;
|
|
71
|
+
static createFormData(data: Record<string, any>, fileKey?: string, file?: CrossPlatformFile): FormData;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
interface LoginResponse {
|
|
@@ -3109,4 +3115,4 @@ declare class BzbsService {
|
|
|
3109
3115
|
setLineUrl(lineUrl: string): this;
|
|
3110
3116
|
}
|
|
3111
3117
|
|
|
3112
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3118
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ type RequestOptions = {
|
|
|
44
44
|
data?: any;
|
|
45
45
|
baseUrl?: string;
|
|
46
46
|
};
|
|
47
|
+
type CrossPlatformFile = File | {
|
|
48
|
+
uri: string;
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
} | object;
|
|
47
52
|
declare class BaseService {
|
|
48
53
|
private client;
|
|
49
54
|
private baseUrl;
|
|
@@ -63,6 +68,7 @@ declare class BaseService {
|
|
|
63
68
|
[key: string]: string;
|
|
64
69
|
};
|
|
65
70
|
setBaseUrl(baseUrl: string): this;
|
|
71
|
+
static createFormData(data: Record<string, any>, fileKey?: string, file?: CrossPlatformFile): FormData;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
interface LoginResponse {
|
|
@@ -3109,4 +3115,4 @@ declare class BzbsService {
|
|
|
3109
3115
|
setLineUrl(lineUrl: string): this;
|
|
3110
3116
|
}
|
|
3111
3117
|
|
|
3112
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3118
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.js
CHANGED
|
@@ -200,6 +200,16 @@ var BaseService = class {
|
|
|
200
200
|
this.baseUrl = baseUrl;
|
|
201
201
|
return this;
|
|
202
202
|
}
|
|
203
|
+
static createFormData(data, fileKey, file) {
|
|
204
|
+
const formData = new FormData();
|
|
205
|
+
for (const key in data) {
|
|
206
|
+
formData.append(key, data[key]);
|
|
207
|
+
}
|
|
208
|
+
if (file) {
|
|
209
|
+
formData.append(fileKey != null ? fileKey : "data", file);
|
|
210
|
+
}
|
|
211
|
+
return formData;
|
|
212
|
+
}
|
|
203
213
|
};
|
|
204
214
|
|
|
205
215
|
// src/api/auth/auth-api.ts
|
|
@@ -1809,8 +1819,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1809
1819
|
return __async(this, null, function* () {
|
|
1810
1820
|
return yield this.post(
|
|
1811
1821
|
"profile/me",
|
|
1812
|
-
__spreadValues({
|
|
1813
|
-
data: params.profileImage,
|
|
1822
|
+
BaseService.createFormData(__spreadValues({
|
|
1814
1823
|
firstname: params.firstName,
|
|
1815
1824
|
lastname: params.lastName,
|
|
1816
1825
|
contact_number: params.contactNumber,
|
|
@@ -1858,7 +1867,7 @@ var ProfileApi = class extends BaseService {
|
|
|
1858
1867
|
occupation: params.occupation,
|
|
1859
1868
|
remark: params.remark,
|
|
1860
1869
|
displayname: params.displayName
|
|
1861
|
-
}, params.options),
|
|
1870
|
+
}, params.options), "profileImage", params.profileImage),
|
|
1862
1871
|
{
|
|
1863
1872
|
headers: __spreadValues({
|
|
1864
1873
|
"Content-Type": "multipart/form-data"
|