@blazeo.com/calendar-client 1.0.44 → 1.0.46

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.ts CHANGED
@@ -216,7 +216,7 @@ export const CompanyModel: {
216
216
  get(companyKey: string): Promise<unknown>;
217
217
  getAll(): Promise<unknown[] | null>;
218
218
  save(payload: object): Promise<unknown>;
219
- purchasePhoneNumber(companyId: string): Promise<{
219
+ purchasePhoneNumber(companyKey: string, companyId: string): Promise<{
220
220
  status: string;
221
221
  data?: PhoneNumberPurchaseResult;
222
222
  message?: string;
package/dist/index.js CHANGED
@@ -1924,6 +1924,8 @@ var CompanyModel = import_mobx_state_tree15.types.model("Company", {
1924
1924
  id: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.maybeNull(import_mobx_state_tree15.types.number), null),
1925
1925
  companyKey: import_mobx_state_tree15.types.identifier,
1926
1926
  companyName: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.string, ""),
1927
+ purchasedPhone: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.string, ""),
1928
+ purchasedPhoneStatus: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.number, 0),
1927
1929
  createdOn: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.maybeNull(import_mobx_state_tree15.types.string), null),
1928
1930
  modifiedOn: import_mobx_state_tree15.types.optional(import_mobx_state_tree15.types.maybeNull(import_mobx_state_tree15.types.string), null)
1929
1931
  }).actions((self) => {
@@ -1948,8 +1950,11 @@ function mapFromApi4(d) {
1948
1950
  if (!d) return d;
1949
1951
  const pick2 = (...keys) => keys.reduce((v, k) => v ?? d[k], void 0);
1950
1952
  return {
1953
+ id: pick2("id", "Id") ?? null,
1951
1954
  companyKey: String(pick2("companyKey", "CompanyKey", "company_key") ?? ""),
1952
1955
  companyName: pick2("companyName", "CompanyName", "company_name") ?? "",
1956
+ purchasedPhone: pick2("purchasedPhone", "PurchasedPhone", "purchased_phone") ?? "",
1957
+ purchasedPhoneStatus: pick2("purchasedPhoneStatus", "PurchasedPhoneStatus", "purchased_phone_status") ?? 0,
1953
1958
  createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
1954
1959
  modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null
1955
1960
  };
@@ -1984,9 +1989,9 @@ CompanyModel.save = async (payload) => {
1984
1989
  }
1985
1990
  return null;
1986
1991
  };
1987
- CompanyModel.purchasePhoneNumber = async (companyId) => {
1992
+ CompanyModel.purchasePhoneNumber = async (companyKey, companyId) => {
1988
1993
  const { reqGet } = createRequestHelpersFromEnv(getConfig());
1989
- return reqGet("/Company/PhoneNumber/Purchase", { company_id: companyId });
1994
+ return reqGet("/Company/PhoneNumber/Purchase", { company_key: companyKey, company_id: companyId });
1990
1995
  };
1991
1996
  var Company_default = CompanyModel;
1992
1997
 
package/dist/index.mjs CHANGED
@@ -1849,6 +1849,8 @@ var CompanyModel = types15.model("Company", {
1849
1849
  id: types15.optional(types15.maybeNull(types15.number), null),
1850
1850
  companyKey: types15.identifier,
1851
1851
  companyName: types15.optional(types15.string, ""),
1852
+ purchasedPhone: types15.optional(types15.string, ""),
1853
+ purchasedPhoneStatus: types15.optional(types15.number, 0),
1852
1854
  createdOn: types15.optional(types15.maybeNull(types15.string), null),
1853
1855
  modifiedOn: types15.optional(types15.maybeNull(types15.string), null)
1854
1856
  }).actions((self) => {
@@ -1873,8 +1875,11 @@ function mapFromApi4(d) {
1873
1875
  if (!d) return d;
1874
1876
  const pick2 = (...keys) => keys.reduce((v, k) => v ?? d[k], void 0);
1875
1877
  return {
1878
+ id: pick2("id", "Id") ?? null,
1876
1879
  companyKey: String(pick2("companyKey", "CompanyKey", "company_key") ?? ""),
1877
1880
  companyName: pick2("companyName", "CompanyName", "company_name") ?? "",
1881
+ purchasedPhone: pick2("purchasedPhone", "PurchasedPhone", "purchased_phone") ?? "",
1882
+ purchasedPhoneStatus: pick2("purchasedPhoneStatus", "PurchasedPhoneStatus", "purchased_phone_status") ?? 0,
1878
1883
  createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
1879
1884
  modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null
1880
1885
  };
@@ -1909,9 +1914,9 @@ CompanyModel.save = async (payload) => {
1909
1914
  }
1910
1915
  return null;
1911
1916
  };
1912
- CompanyModel.purchasePhoneNumber = async (companyId) => {
1917
+ CompanyModel.purchasePhoneNumber = async (companyKey, companyId) => {
1913
1918
  const { reqGet } = createRequestHelpersFromEnv(getConfig());
1914
- return reqGet("/Company/PhoneNumber/Purchase", { company_id: companyId });
1919
+ return reqGet("/Company/PhoneNumber/Purchase", { company_key: companyKey, company_id: companyId });
1915
1920
  };
1916
1921
  var Company_default = CompanyModel;
1917
1922
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazeo.com/calendar-client",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "Blazeo Calendar / Appointment API client with MobX State Tree models",
5
5
  "exports": {
6
6
  ".": {