repzo 1.0.82 → 1.0.83
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/changelog.md +12 -0
- package/lib/index.d.ts +199 -84
- package/lib/index.js +238 -0
- package/lib/types/index.d.ts +974 -11
- package/package.json +2 -2
- package/src/index.ts +316 -0
- package/src/types/index.ts +882 -0
package/lib/index.js
CHANGED
|
@@ -1888,6 +1888,237 @@ export default class Repzo {
|
|
|
1888
1888
|
return res;
|
|
1889
1889
|
},
|
|
1890
1890
|
};
|
|
1891
|
+
this.assetPartType = {
|
|
1892
|
+
_path: "/asset-part-type",
|
|
1893
|
+
find: async (params) => {
|
|
1894
|
+
let res = await this._fetch(
|
|
1895
|
+
this.svAPIEndpoint,
|
|
1896
|
+
this.assetPartType._path,
|
|
1897
|
+
params
|
|
1898
|
+
);
|
|
1899
|
+
return res;
|
|
1900
|
+
},
|
|
1901
|
+
get: async (id) => {
|
|
1902
|
+
return await this._fetch(
|
|
1903
|
+
this.svAPIEndpoint,
|
|
1904
|
+
this.assetPartType._path + `/${id}`
|
|
1905
|
+
);
|
|
1906
|
+
},
|
|
1907
|
+
create: async (body) => {
|
|
1908
|
+
let res = await this._create(
|
|
1909
|
+
this.svAPIEndpoint,
|
|
1910
|
+
this.assetPartType._path,
|
|
1911
|
+
body
|
|
1912
|
+
);
|
|
1913
|
+
return res;
|
|
1914
|
+
},
|
|
1915
|
+
update: async (id, body) => {
|
|
1916
|
+
let res = await this._update(
|
|
1917
|
+
this.svAPIEndpoint,
|
|
1918
|
+
this.assetPartType._path + `/${id}`,
|
|
1919
|
+
body
|
|
1920
|
+
);
|
|
1921
|
+
return res;
|
|
1922
|
+
},
|
|
1923
|
+
remove: async (id) => {
|
|
1924
|
+
let res = await this._delete(
|
|
1925
|
+
this.svAPIEndpoint,
|
|
1926
|
+
this.assetPartType._path + `/${id}`
|
|
1927
|
+
);
|
|
1928
|
+
return res;
|
|
1929
|
+
},
|
|
1930
|
+
};
|
|
1931
|
+
this.assetPart = {
|
|
1932
|
+
_path: "/asset-part",
|
|
1933
|
+
find: async (params) => {
|
|
1934
|
+
let res = await this._fetch(
|
|
1935
|
+
this.svAPIEndpoint,
|
|
1936
|
+
this.assetPart._path,
|
|
1937
|
+
params
|
|
1938
|
+
);
|
|
1939
|
+
return res;
|
|
1940
|
+
},
|
|
1941
|
+
get: async (id) => {
|
|
1942
|
+
return await this._fetch(
|
|
1943
|
+
this.svAPIEndpoint,
|
|
1944
|
+
this.assetPart._path + `/${id}`
|
|
1945
|
+
);
|
|
1946
|
+
},
|
|
1947
|
+
create: async (body) => {
|
|
1948
|
+
let res = await this._create(
|
|
1949
|
+
this.svAPIEndpoint,
|
|
1950
|
+
this.assetPart._path,
|
|
1951
|
+
body
|
|
1952
|
+
);
|
|
1953
|
+
return res;
|
|
1954
|
+
},
|
|
1955
|
+
update: async (id, body) => {
|
|
1956
|
+
let res = await this._update(
|
|
1957
|
+
this.svAPIEndpoint,
|
|
1958
|
+
this.assetPart._path + `/${id}`,
|
|
1959
|
+
body
|
|
1960
|
+
);
|
|
1961
|
+
return res;
|
|
1962
|
+
},
|
|
1963
|
+
remove: async (id) => {
|
|
1964
|
+
let res = await this._delete(
|
|
1965
|
+
this.svAPIEndpoint,
|
|
1966
|
+
this.assetPart._path + `/${id}`
|
|
1967
|
+
);
|
|
1968
|
+
return res;
|
|
1969
|
+
},
|
|
1970
|
+
};
|
|
1971
|
+
this.assetPartUnit = {
|
|
1972
|
+
_path: "/asset-part-unit",
|
|
1973
|
+
find: async (params) => {
|
|
1974
|
+
let res = await this._fetch(
|
|
1975
|
+
this.svAPIEndpoint,
|
|
1976
|
+
this.assetPartUnit._path,
|
|
1977
|
+
params
|
|
1978
|
+
);
|
|
1979
|
+
return res;
|
|
1980
|
+
},
|
|
1981
|
+
get: async (id) => {
|
|
1982
|
+
return await this._fetch(
|
|
1983
|
+
this.svAPIEndpoint,
|
|
1984
|
+
this.assetPartUnit._path + `/${id}`
|
|
1985
|
+
);
|
|
1986
|
+
},
|
|
1987
|
+
update: async (id, body) => {
|
|
1988
|
+
let res = await this._update(
|
|
1989
|
+
this.svAPIEndpoint,
|
|
1990
|
+
this.assetPartUnit._path + `/${id}`,
|
|
1991
|
+
body
|
|
1992
|
+
);
|
|
1993
|
+
return res;
|
|
1994
|
+
},
|
|
1995
|
+
};
|
|
1996
|
+
this.assetPartReceival = {
|
|
1997
|
+
_path: "/asset-part-receival",
|
|
1998
|
+
find: async (params) => {
|
|
1999
|
+
let res = await this._fetch(
|
|
2000
|
+
this.svAPIEndpoint,
|
|
2001
|
+
this.assetPartReceival._path,
|
|
2002
|
+
params
|
|
2003
|
+
);
|
|
2004
|
+
return res;
|
|
2005
|
+
},
|
|
2006
|
+
get: async (id) => {
|
|
2007
|
+
return await this._fetch(
|
|
2008
|
+
this.svAPIEndpoint,
|
|
2009
|
+
this.assetPartReceival._path + `/${id}`
|
|
2010
|
+
);
|
|
2011
|
+
},
|
|
2012
|
+
create: async (body) => {
|
|
2013
|
+
let res = await this._create(
|
|
2014
|
+
this.svAPIEndpoint,
|
|
2015
|
+
this.assetPartReceival._path,
|
|
2016
|
+
body
|
|
2017
|
+
);
|
|
2018
|
+
return res;
|
|
2019
|
+
},
|
|
2020
|
+
update: async (id, body) => {
|
|
2021
|
+
let res = await this._update(
|
|
2022
|
+
this.svAPIEndpoint,
|
|
2023
|
+
this.assetPartReceival._path + `/${id}`,
|
|
2024
|
+
body
|
|
2025
|
+
);
|
|
2026
|
+
return res;
|
|
2027
|
+
},
|
|
2028
|
+
patch: async (params, body) => {
|
|
2029
|
+
let res = await this._patch(
|
|
2030
|
+
this.svAPIEndpoint,
|
|
2031
|
+
this.assetPartReceival._path,
|
|
2032
|
+
body,
|
|
2033
|
+
params
|
|
2034
|
+
);
|
|
2035
|
+
return res;
|
|
2036
|
+
},
|
|
2037
|
+
};
|
|
2038
|
+
this.assetPartTransfer = {
|
|
2039
|
+
_path: "/asset-part-transfer",
|
|
2040
|
+
find: async (params) => {
|
|
2041
|
+
let res = await this._fetch(
|
|
2042
|
+
this.svAPIEndpoint,
|
|
2043
|
+
this.assetPartTransfer._path,
|
|
2044
|
+
params
|
|
2045
|
+
);
|
|
2046
|
+
return res;
|
|
2047
|
+
},
|
|
2048
|
+
get: async (id) => {
|
|
2049
|
+
return await this._fetch(
|
|
2050
|
+
this.svAPIEndpoint,
|
|
2051
|
+
this.assetPartTransfer._path + `/${id}`
|
|
2052
|
+
);
|
|
2053
|
+
},
|
|
2054
|
+
create: async (body) => {
|
|
2055
|
+
let res = await this._create(
|
|
2056
|
+
this.svAPIEndpoint,
|
|
2057
|
+
this.assetPartTransfer._path,
|
|
2058
|
+
body
|
|
2059
|
+
);
|
|
2060
|
+
return res;
|
|
2061
|
+
},
|
|
2062
|
+
update: async (id, body) => {
|
|
2063
|
+
let res = await this._update(
|
|
2064
|
+
this.svAPIEndpoint,
|
|
2065
|
+
this.assetPartTransfer._path + `/${id}`,
|
|
2066
|
+
body
|
|
2067
|
+
);
|
|
2068
|
+
return res;
|
|
2069
|
+
},
|
|
2070
|
+
patch: async (params, body) => {
|
|
2071
|
+
let res = await this._patch(
|
|
2072
|
+
this.svAPIEndpoint,
|
|
2073
|
+
this.assetPartTransfer._path,
|
|
2074
|
+
body,
|
|
2075
|
+
params
|
|
2076
|
+
);
|
|
2077
|
+
return res;
|
|
2078
|
+
},
|
|
2079
|
+
};
|
|
2080
|
+
this.returnStoreAssetPartUnit = {
|
|
2081
|
+
_path: "/return-store-asset-part-unit",
|
|
2082
|
+
find: async (params) => {
|
|
2083
|
+
let res = await this._fetch(
|
|
2084
|
+
this.svAPIEndpoint,
|
|
2085
|
+
this.returnStoreAssetPartUnit._path,
|
|
2086
|
+
params
|
|
2087
|
+
);
|
|
2088
|
+
return res;
|
|
2089
|
+
},
|
|
2090
|
+
get: async (id) => {
|
|
2091
|
+
return await this._fetch(
|
|
2092
|
+
this.svAPIEndpoint,
|
|
2093
|
+
this.returnStoreAssetPartUnit._path + `/${id}`
|
|
2094
|
+
);
|
|
2095
|
+
},
|
|
2096
|
+
create: async (body) => {
|
|
2097
|
+
let res = await this._create(
|
|
2098
|
+
this.svAPIEndpoint,
|
|
2099
|
+
this.returnStoreAssetPartUnit._path,
|
|
2100
|
+
body
|
|
2101
|
+
);
|
|
2102
|
+
return res;
|
|
2103
|
+
},
|
|
2104
|
+
update: async (id, body) => {
|
|
2105
|
+
let res = await this._update(
|
|
2106
|
+
this.svAPIEndpoint,
|
|
2107
|
+
this.returnStoreAssetPartUnit._path + `/${id}`,
|
|
2108
|
+
body
|
|
2109
|
+
);
|
|
2110
|
+
return res;
|
|
2111
|
+
},
|
|
2112
|
+
patch: async (params, body) => {
|
|
2113
|
+
let res = await this._patch(
|
|
2114
|
+
this.svAPIEndpoint,
|
|
2115
|
+
this.returnStoreAssetPartUnit._path,
|
|
2116
|
+
body,
|
|
2117
|
+
params
|
|
2118
|
+
);
|
|
2119
|
+
return res;
|
|
2120
|
+
},
|
|
2121
|
+
};
|
|
1891
2122
|
this.svAPIEndpoint =
|
|
1892
2123
|
!options?.env || options?.env == "production"
|
|
1893
2124
|
? "https://sv.api.repzo.me"
|
|
@@ -1924,6 +2155,13 @@ export default class Repzo {
|
|
|
1924
2155
|
});
|
|
1925
2156
|
return res.data;
|
|
1926
2157
|
}
|
|
2158
|
+
async _patch(baseUrl, path, body, params) {
|
|
2159
|
+
let res = await axios.put(baseUrl + path, body, {
|
|
2160
|
+
params,
|
|
2161
|
+
headers: this.headers,
|
|
2162
|
+
});
|
|
2163
|
+
return res.data;
|
|
2164
|
+
}
|
|
1927
2165
|
async _delete(baseUrl, path, params) {
|
|
1928
2166
|
let res = await axios.delete(baseUrl + path, {
|
|
1929
2167
|
params,
|