@bzbs/react-api-client 0.0.21 → 0.1.0
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 +510 -1
- package/dist/index.d.ts +510 -1
- package/dist/index.js +382 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +382 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1657,6 +1657,385 @@ var RegistrationApi = class extends BaseService {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
};
|
|
1659
1659
|
|
|
1660
|
+
// src/api/address/address-api.ts
|
|
1661
|
+
var AddressApi = class extends BaseService {
|
|
1662
|
+
constructor(client, baseUrl) {
|
|
1663
|
+
super(client, baseUrl);
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Get information of zip code
|
|
1667
|
+
*
|
|
1668
|
+
* @param zipCode - Zip code
|
|
1669
|
+
* @param requestOptions - Optional request options
|
|
1670
|
+
* @returns A promise that resolves to a service response containing an array of ZipCode objects
|
|
1671
|
+
*/
|
|
1672
|
+
zipCodes(params, requestOptions) {
|
|
1673
|
+
return __async(this, null, function* () {
|
|
1674
|
+
return yield this.get("main/postcode", { zip_code: params.zipCode }, requestOptions);
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Get list of Thailand province
|
|
1679
|
+
*
|
|
1680
|
+
* @param requestOptions - Optional request options
|
|
1681
|
+
* @returns A promise that resolves to a service response containing an array of ZipCode objects
|
|
1682
|
+
*/
|
|
1683
|
+
provinces(requestOptions) {
|
|
1684
|
+
return __async(this, null, function* () {
|
|
1685
|
+
return yield this.get("main/province", {}, requestOptions);
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Get list of Thailand district
|
|
1690
|
+
*
|
|
1691
|
+
* @param provinceCode - Province code
|
|
1692
|
+
* @param requestOptions - Optional request options
|
|
1693
|
+
* @returns A promise that resolves to a service response containing an array of ZipCode objects
|
|
1694
|
+
*/
|
|
1695
|
+
districts(params, requestOptions) {
|
|
1696
|
+
return __async(this, null, function* () {
|
|
1697
|
+
return yield this.get("main/district", { province_code: params.provinceCode }, requestOptions);
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Get list of Thailand sub district
|
|
1702
|
+
*
|
|
1703
|
+
* @param provinceCode - Province code
|
|
1704
|
+
* @param districtCode - District code
|
|
1705
|
+
* @param requestOptions - Optional request options
|
|
1706
|
+
* @returns A promise that resolves to a service response containing an array of ZipCode objects
|
|
1707
|
+
*/
|
|
1708
|
+
subDistricts(params, requestOptions) {
|
|
1709
|
+
return __async(this, null, function* () {
|
|
1710
|
+
return yield this.get(
|
|
1711
|
+
"main/subdistrict",
|
|
1712
|
+
{
|
|
1713
|
+
province_code: params.provinceCode,
|
|
1714
|
+
district_code: params.districtCode
|
|
1715
|
+
},
|
|
1716
|
+
requestOptions
|
|
1717
|
+
);
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* Get user addresses
|
|
1722
|
+
*
|
|
1723
|
+
* @param requestOptions - Optional request options
|
|
1724
|
+
* @returns A promise that resolves to a service response containing an array of Address objects
|
|
1725
|
+
*/
|
|
1726
|
+
userAddresses(requestOptions) {
|
|
1727
|
+
return __async(this, null, function* () {
|
|
1728
|
+
return yield this.get("profile/me/addresses", {}, requestOptions);
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* Update user address
|
|
1733
|
+
*
|
|
1734
|
+
* @param params - The parameters for updating the address
|
|
1735
|
+
* @param requestOptions - Optional request options
|
|
1736
|
+
* @returns A promise that resolves to a service response containing the updated Address object
|
|
1737
|
+
*/
|
|
1738
|
+
updateAddress(params, requestOptions) {
|
|
1739
|
+
return __async(this, null, function* () {
|
|
1740
|
+
return yield this.post(
|
|
1741
|
+
"profile/me/address",
|
|
1742
|
+
{
|
|
1743
|
+
addressName: params.addressName,
|
|
1744
|
+
firstname: params.firstName,
|
|
1745
|
+
lastname: params.lastName,
|
|
1746
|
+
address: params.address,
|
|
1747
|
+
zipcode: params.zipcode,
|
|
1748
|
+
province_code: params.provinceCode,
|
|
1749
|
+
province_name: params.provinceName,
|
|
1750
|
+
district_code: params.districtCode,
|
|
1751
|
+
district_name: params.districtName,
|
|
1752
|
+
subdistrict_code: params.subDistrictCode,
|
|
1753
|
+
subdistrict_name: params.subDistrictName,
|
|
1754
|
+
contact_number: params.contactNumber,
|
|
1755
|
+
country_code: params.countryCode,
|
|
1756
|
+
country_name: params.countryName,
|
|
1757
|
+
isDefault: params.isDefault,
|
|
1758
|
+
key: params.rowKey
|
|
1759
|
+
},
|
|
1760
|
+
requestOptions
|
|
1761
|
+
);
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Delete user address
|
|
1766
|
+
*
|
|
1767
|
+
* @param rowKey - Row key
|
|
1768
|
+
* @param requestOptions - Optional request options
|
|
1769
|
+
* @returns A promise that resolves to a service response containing the result of the deletion
|
|
1770
|
+
*/
|
|
1771
|
+
deleteAddress(params, requestOptions) {
|
|
1772
|
+
return __async(this, null, function* () {
|
|
1773
|
+
var _a;
|
|
1774
|
+
return yield this.delete("profile/me/address", __spreadValues({
|
|
1775
|
+
params: { key: (_a = params.rowKey) != null ? _a : "" }
|
|
1776
|
+
}, requestOptions));
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* Get user tax addresses
|
|
1781
|
+
*
|
|
1782
|
+
* @param requestOptions - Optional request options
|
|
1783
|
+
* @returns A promise that resolves to a service response containing an array of Address objects
|
|
1784
|
+
*/
|
|
1785
|
+
userTaxAddresses(requestOptions) {
|
|
1786
|
+
return __async(this, null, function* () {
|
|
1787
|
+
return yield this.get("profile/me/taxes", {}, requestOptions);
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Update user tax address
|
|
1792
|
+
*
|
|
1793
|
+
* @param params - The parameters for updating the tax address
|
|
1794
|
+
* @param requestOptions - Optional request options
|
|
1795
|
+
* @returns A promise that resolves to a service response containing the updated Address object
|
|
1796
|
+
*/
|
|
1797
|
+
updateTaxAddress(params, requestOptions) {
|
|
1798
|
+
return __async(this, null, function* () {
|
|
1799
|
+
return yield this.post(
|
|
1800
|
+
"profile/me/tax",
|
|
1801
|
+
{
|
|
1802
|
+
key: params.rowKey,
|
|
1803
|
+
taxId: params.taxId,
|
|
1804
|
+
isdefault: params.isDefault,
|
|
1805
|
+
personType: params.personType,
|
|
1806
|
+
title: params.title,
|
|
1807
|
+
firstname: params.firstName,
|
|
1808
|
+
lastname: params.lastName,
|
|
1809
|
+
email: params.email,
|
|
1810
|
+
contact_number: params.contactNumber,
|
|
1811
|
+
companyName: params.companyName,
|
|
1812
|
+
address: params.address,
|
|
1813
|
+
addressName: params.addressName,
|
|
1814
|
+
floor: params.floor,
|
|
1815
|
+
building: params.building,
|
|
1816
|
+
moo: params.moo,
|
|
1817
|
+
road: params.road,
|
|
1818
|
+
room: params.room,
|
|
1819
|
+
soi: params.soi,
|
|
1820
|
+
village: params.village,
|
|
1821
|
+
district_code: params.districtCode,
|
|
1822
|
+
district_name: params.districtName,
|
|
1823
|
+
province_code: params.provinceCode,
|
|
1824
|
+
province_name: params.provinceName,
|
|
1825
|
+
subdistrict_code: params.subDistrictCode,
|
|
1826
|
+
subdistrict_name: params.subDistrictName,
|
|
1827
|
+
zipcode: params.zipCode
|
|
1828
|
+
},
|
|
1829
|
+
requestOptions
|
|
1830
|
+
);
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Delete user tax address
|
|
1835
|
+
*
|
|
1836
|
+
* @param rowKey - Row key
|
|
1837
|
+
* @param requestOptions - Optional request options
|
|
1838
|
+
* @returns A promise that resolves to a service response containing the result of the deletion
|
|
1839
|
+
*/
|
|
1840
|
+
deleteTaxAddress(params, requestOptions) {
|
|
1841
|
+
return __async(this, null, function* () {
|
|
1842
|
+
var _a;
|
|
1843
|
+
return yield this.delete("profile/me/tax", __spreadValues({
|
|
1844
|
+
params: { key: (_a = params.rowKey) != null ? _a : "" }
|
|
1845
|
+
}, requestOptions));
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1850
|
+
// src/api/stamp/stamp-api.ts
|
|
1851
|
+
var StampApi = class extends BaseService {
|
|
1852
|
+
constructor(client, baseUrl) {
|
|
1853
|
+
super(client, baseUrl);
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* Create stamp
|
|
1857
|
+
*
|
|
1858
|
+
* @param params - The parameters for creating the stamp
|
|
1859
|
+
* @param requestOptions - Optional request options
|
|
1860
|
+
* @returns A promise that resolves to a service response containing the created stamp response
|
|
1861
|
+
*/
|
|
1862
|
+
createStamp(params, requestOptions) {
|
|
1863
|
+
return __async(this, null, function* () {
|
|
1864
|
+
return yield this.post(
|
|
1865
|
+
"stamp/create",
|
|
1866
|
+
{
|
|
1867
|
+
imei: params.imei,
|
|
1868
|
+
issuer: params.issuer,
|
|
1869
|
+
os: params.os,
|
|
1870
|
+
platform: params.platform
|
|
1871
|
+
},
|
|
1872
|
+
requestOptions
|
|
1873
|
+
);
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* Get list of stamps
|
|
1878
|
+
*
|
|
1879
|
+
* @param requestOptions - Optional request options
|
|
1880
|
+
* @returns A promise that resolves to a service response containing an array of stamps
|
|
1881
|
+
*/
|
|
1882
|
+
stamps(requestOptions) {
|
|
1883
|
+
return __async(this, null, function* () {
|
|
1884
|
+
return yield this.get("stamp", {}, requestOptions);
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Get stamp info
|
|
1889
|
+
*
|
|
1890
|
+
* @param id - Stamp id
|
|
1891
|
+
* @param cardId - Card Id
|
|
1892
|
+
* @param requestOptions - Optional request options
|
|
1893
|
+
* @returns A promise that resolves to a service response containing the stamp profile response
|
|
1894
|
+
*/
|
|
1895
|
+
stampProfile(params, requestOptions) {
|
|
1896
|
+
return __async(this, null, function* () {
|
|
1897
|
+
return yield this.get(`stamp/${params.id}/profile`, { cardId: params.cardId }, requestOptions);
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
// src/api/forum/forum-api.ts
|
|
1903
|
+
var ForumApi = class extends BaseService {
|
|
1904
|
+
constructor(client, baseUrl) {
|
|
1905
|
+
super(client, baseUrl);
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* Get help code
|
|
1909
|
+
*
|
|
1910
|
+
* @param params - The parameters for getting the help code
|
|
1911
|
+
* @param requestOptions - Optional request options
|
|
1912
|
+
* @returns A promise that resolves to a service response containing the help code
|
|
1913
|
+
*/
|
|
1914
|
+
helpCode(params, requestOptions) {
|
|
1915
|
+
return __async(this, null, function* () {
|
|
1916
|
+
return yield this.post(
|
|
1917
|
+
"profile/me/help",
|
|
1918
|
+
{
|
|
1919
|
+
os: params.os,
|
|
1920
|
+
platform: params.platform,
|
|
1921
|
+
client_version: params.clientVersion
|
|
1922
|
+
},
|
|
1923
|
+
requestOptions
|
|
1924
|
+
);
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Get request help list
|
|
1929
|
+
*
|
|
1930
|
+
* @param params - The parameters for getting the request help list
|
|
1931
|
+
* @param requestOptions - Optional request options
|
|
1932
|
+
* @returns A promise that resolves to a service response containing a list of chat messages
|
|
1933
|
+
*/
|
|
1934
|
+
requestHelpList(params, requestOptions) {
|
|
1935
|
+
return __async(this, null, function* () {
|
|
1936
|
+
return yield this.get(`buzz/${params.requestId}/list`, {}, requestOptions);
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
/**
|
|
1940
|
+
* Get request help detail
|
|
1941
|
+
*
|
|
1942
|
+
* @param params - The parameters for getting the request help detail
|
|
1943
|
+
* @param requestOptions - Optional request options
|
|
1944
|
+
* @returns A promise that resolves to a service response containing a chat message
|
|
1945
|
+
*/
|
|
1946
|
+
requestDetail(params, requestOptions) {
|
|
1947
|
+
return __async(this, null, function* () {
|
|
1948
|
+
return yield this.get(`buzz/${params.buzzKey}`, {}, requestOptions);
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Create request help
|
|
1953
|
+
*
|
|
1954
|
+
* @param params - The parameters for creating the request help
|
|
1955
|
+
* @param requestOptions - Optional request options
|
|
1956
|
+
* @returns A promise that resolves to a service response containing a chat message
|
|
1957
|
+
*/
|
|
1958
|
+
postRequestHelp(params, requestOptions) {
|
|
1959
|
+
return __async(this, null, function* () {
|
|
1960
|
+
return yield this.post(
|
|
1961
|
+
`buzz/${params.requestId}/buzz`,
|
|
1962
|
+
{
|
|
1963
|
+
message: params.message,
|
|
1964
|
+
source: params.image
|
|
1965
|
+
},
|
|
1966
|
+
__spreadValues({
|
|
1967
|
+
headers: __spreadValues({
|
|
1968
|
+
"Content-Type": "multipart/form-data"
|
|
1969
|
+
}, requestOptions == null ? void 0 : requestOptions.headers)
|
|
1970
|
+
}, requestOptions)
|
|
1971
|
+
);
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
/**
|
|
1975
|
+
* Get comment list
|
|
1976
|
+
*
|
|
1977
|
+
* @param params - The parameters for getting the comment list
|
|
1978
|
+
* @param requestOptions - Optional request options
|
|
1979
|
+
* @returns A promise that resolves to a service response containing a list of chat messages
|
|
1980
|
+
*/
|
|
1981
|
+
comments(params, requestOptions) {
|
|
1982
|
+
return __async(this, null, function* () {
|
|
1983
|
+
return yield this.get(
|
|
1984
|
+
`buzz/${params.buzzKey}/comments`,
|
|
1985
|
+
{ lastRowKey: params.lastRowKey },
|
|
1986
|
+
requestOptions
|
|
1987
|
+
);
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
/**
|
|
1991
|
+
* Create comment
|
|
1992
|
+
*
|
|
1993
|
+
* @param params - The parameters for creating the comment
|
|
1994
|
+
* @param requestOptions - Optional request options
|
|
1995
|
+
* @returns A promise that resolves to a service response containing a chat message
|
|
1996
|
+
*/
|
|
1997
|
+
postComment(params, requestOptions) {
|
|
1998
|
+
return __async(this, null, function* () {
|
|
1999
|
+
return yield this.post(
|
|
2000
|
+
`buzz/${params.buzzKey}/comments`,
|
|
2001
|
+
{
|
|
2002
|
+
message: params.message,
|
|
2003
|
+
source: params.image
|
|
2004
|
+
},
|
|
2005
|
+
__spreadValues({
|
|
2006
|
+
headers: __spreadValues({
|
|
2007
|
+
"Content-Type": "multipart/form-data"
|
|
2008
|
+
}, requestOptions == null ? void 0 : requestOptions.headers)
|
|
2009
|
+
}, requestOptions)
|
|
2010
|
+
);
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Like/Unlike forum
|
|
2015
|
+
*
|
|
2016
|
+
* @param params - The parameters for liking the forum
|
|
2017
|
+
* @param requestOptions - Optional request options
|
|
2018
|
+
* @returns A promise that resolves to a service response containing the like forum response
|
|
2019
|
+
*/
|
|
2020
|
+
likeForum(params, requestOptions) {
|
|
2021
|
+
return __async(this, null, function* () {
|
|
2022
|
+
return yield this.post(`buzz/${params.buzzKey}/like`, {}, requestOptions);
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* Unlike forum
|
|
2027
|
+
*
|
|
2028
|
+
* @param params - The parameters for unliking the forum
|
|
2029
|
+
* @param requestOptions - Optional request options
|
|
2030
|
+
* @returns A promise that resolves to a service response containing the like forum response
|
|
2031
|
+
*/
|
|
2032
|
+
unlikeForum(params, requestOptions) {
|
|
2033
|
+
return __async(this, null, function* () {
|
|
2034
|
+
return yield this.delete(`buzz/${params.buzzKey}/like`, requestOptions);
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
|
|
1660
2039
|
// src/api/bzbs-service.ts
|
|
1661
2040
|
var BzbsService = class {
|
|
1662
2041
|
constructor(client, baseUrl, baseLineUrl) {
|
|
@@ -1679,6 +2058,9 @@ var BzbsService = class {
|
|
|
1679
2058
|
this.pointLogApi = new PointLogApi(this.client, this.baseUrl);
|
|
1680
2059
|
this.profileApi = new ProfileApi(this.client, this.baseUrl);
|
|
1681
2060
|
this.registerApi = new RegistrationApi(this.client, this.baseUrl);
|
|
2061
|
+
this.addressApi = new AddressApi(this.client, this.baseUrl);
|
|
2062
|
+
this.stampApi = new StampApi(this.client, this.baseUrl);
|
|
2063
|
+
this.forumApi = new ForumApi(this.client, this.baseUrl);
|
|
1682
2064
|
}
|
|
1683
2065
|
};
|
|
1684
2066
|
// Annotate the CommonJS export names for ESM import in node:
|