storemw-core-client 1.0.21 → 1.0.22

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.
@@ -64,7 +64,7 @@ const AuthService = (props) => {
64
64
  };
65
65
  const response = await makeCall({
66
66
  url,
67
- method: 'put',
67
+ method: 'post',
68
68
  payload: postData
69
69
  });
70
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../src/services/auth/AuthService.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ,EAAE,SAAS;IAC3B,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAA;AAEG,QAAA,eAAe,GAAG;IAC3B,KAAK,EAAE,eAAe;IACtB,sBAAsB;IACtB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,aAAa,EAAE,SAAS;IACrC,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAA;AAoCH,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAEnD,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,IAAI,EAAE,CAAA;IAEtC,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,UAAU,CAAA;IAErC,MAAM,SAAS,GAAG,MAAM,CAAC;IAEzB,MAAM,SAAS,GAAG,KAAK,EAAE,KAAqB,EAAE,EAAE;QAE9C,MAAM,EACF,cAAc,EAAE,sBAAsB,EACtC,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,EAAE,EACnB,GAAG,KAAK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const routeTypes = {\n admin: \"admin\",\n retail: \"retail\", // retail\n workstation: \"workstation\",\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\nexport const authTargetTypes = {\n admin: \"administrator\",\n // retail: \"retailer\",\n retailer: \"retail\",\n workstation: \"workstation\", // worker\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\n// Step 2: Infer the value type (e.g., \"administrator\" | \"retailer\" | ...)\nexport type AuthTargetType = typeof authTargetTypes[keyof typeof authTargetTypes]\n\n// Optional: keyof helper to get \"admin\" | \"retail\" | ...\n// export type AuthTargetKey = keyof typeof authTargetTypes\n\n// Step 3: Define route mapping\n// export const authTargetSystemRouteTypes: Record<AuthTargetType, string> = {\n// [authTargetTypes.admin]: routeTypes.admin,\n// [authTargetTypes.retail]: routeTypes.retail,\n// [authTargetTypes.workstation]: routeTypes.workstation,\n// [authTargetTypes.customer]: routeTypes.customer,\n// [authTargetTypes.member]: routeTypes.member,\n// [authTargetTypes.driver]: routeTypes.driver,\n// }\n\nexport type AuthServiceProps = DefaultServiceProps & {\n authTargetType: AuthTargetType\n}\n\nexport type AuthLoginProps = {\n authTargetType?: AuthTargetType,\n accountId?: string\n accountCode?: string\n username: string\n password: string\n};\n\ntype confirmPasswordProps = {\n current: string\n password: string\n confirm: string\n}\n\nexport const AuthService = (props: AuthServiceProps) => {\n\n const { authTargetType } = props ?? {}\n\n const { makeCall } = props.apiService\n\n const endpoint1 = \"auth\";\n\n const authLogin = async (props: AuthLoginProps) => {\n\n const {\n authTargetType: overrideAuthTargetType,\n username,\n password,\n accountId = \"\",\n accountCode = \"\"\n } = props\n\n const url = `${endpoint1}/token`;\n\n const postData = {\n scope: {\n target: overrideAuthTargetType || authTargetType,\n action: \"\",\n },\n payload: {\n ...(accountId ? { account_id: accountId } : {}),\n ...(accountCode ? { account_code: accountCode } : {}),\n username,\n password\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const changePassword = async ({ current, password, confirm }: confirmPasswordProps) => {\n\n\n const url = `${endpoint1}/change_password`;\n\n const postData = {\n scope: {\n target: \"change_password\"\n },\n payload: {\n auth: {\n current_password: current,\n new_password: password,\n confirm_password: confirm\n }\n }\n }\n\n const response = await makeCall({\n url,\n method: 'put',\n payload: postData\n });\n\n }\n\n return {\n authLogin,\n changePassword\n };\n}\n"]}
1
+ {"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../src/services/auth/AuthService.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ,EAAE,SAAS;IAC3B,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAA;AAEG,QAAA,eAAe,GAAG;IAC3B,KAAK,EAAE,eAAe;IACtB,sBAAsB;IACtB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,aAAa,EAAE,SAAS;IACrC,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAA;AAoCH,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAEnD,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,IAAI,EAAE,CAAA;IAEtC,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,UAAU,CAAA;IAErC,MAAM,SAAS,GAAG,MAAM,CAAC;IAEzB,MAAM,SAAS,GAAG,KAAK,EAAE,KAAqB,EAAE,EAAE;QAE9C,MAAM,EACF,cAAc,EAAE,sBAAsB,EACtC,QAAQ,EACR,QAAQ,EACR,SAAS,GAAG,EAAE,EAC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cesContent":["import { DefaultServiceProps } from '@/lib';\n\nexport const routeTypes = {\n admin: \"admin\",\n retail: \"retail\", // retail\n workstation: \"workstation\",\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\nexport const authTargetTypes = {\n admin: \"administrator\",\n // retail: \"retailer\",\n retailer: \"retail\",\n workstation: \"workstation\", // worker\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\n// Step 2: Infer the value type (e.g., \"administrator\" | \"retailer\" | ...)\nexport type AuthTargetType = typeof authTargetTypes[keyof typeof authTargetTypes]\n\n// Optional: keyof helper to get \"admin\" | \"retail\" | ...\n// export type AuthTargetKey = keyof typeof authTargetTypes\n\n// Step 3: Define route mapping\n// export const authTargetSystemRouteTypes: Record<AuthTargetType, string> = {\n// [authTargetTypes.admin]: routeTypes.admin,\n// [authTargetTypes.retail]: routeTypes.retail,\n// [authTargetTypes.workstation]: routeTypes.workstation,\n// [authTargetTypes.customer]: routeTypes.customer,\n// [authTargetTypes.member]: routeTypes.member,\n// [authTargetTypes.driver]: routeTypes.driver,\n// }\n\nexport type AuthServiceProps = DefaultServiceProps & {\n authTargetType: AuthTargetType\n}\n\nexport type AuthLoginProps = {\n authTargetType?: AuthTargetType,\n accountId?: string\n accountCode?: string\n username: string\n password: string\n};\n\ntype confirmPasswordProps = {\n current: string\n password: string\n confirm: string\n}\n\nexport const AuthService = (props: AuthServiceProps) => {\n\n const { authTargetType } = props ?? {}\n\n const { makeCall } = props.apiService\n\n const endpoint1 = \"auth\";\n\n const authLogin = async (props: AuthLoginProps) => {\n\n const {\n authTargetType: overrideAuthTargetType,\n username,\n password,\n accountId = \"\",\n accountCode = \"\"\n } = props\n\n const url = `${endpoint1}/token`;\n\n const postData = {\n scope: {\n target: overrideAuthTargetType || authTargetType,\n action: \"\",\n },\n payload: {\n ...(accountId ? { account_id: accountId } : {}),\n ...(accountCode ? { account_code: accountCode } : {}),\n username,\n password\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const changePassword = async ({ current, password, confirm }: confirmPasswordProps) => {\n\n\n const url = `${endpoint1}/change_password`;\n\n const postData = {\n scope: {\n target: \"change_password\"\n },\n payload: {\n auth: {\n current_password: current,\n new_password: password,\n confirm_password: confirm\n }\n }\n }\n\n const response = await makeCall({\n url,\n method: 'post',\n payload: postData\n });\n\n }\n\n return {\n authLogin,\n changePassword\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storemw-core-client",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {