@syncfy/authentication-widget 1.2.0 → 1.3.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.
@@ -153,6 +153,26 @@ const resource$1 = {
153
153
  return t(["Requests Rate Limit Exceeded"]);
154
154
  }
155
155
  },
156
+ 449: {
157
+ long_description: (e) => {
158
+ const { normalize: t } = e;
159
+ return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."]);
160
+ },
161
+ real: {
162
+ long_description: (e) => {
163
+ const { normalize: t } = e;
164
+ return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."]);
165
+ },
166
+ short_description: (e) => {
167
+ const { normalize: t } = e;
168
+ return t(["Invalid credential"]);
169
+ }
170
+ },
171
+ short_description: (e) => {
172
+ const { normalize: t } = e;
173
+ return t(["Invalid credential"]);
174
+ }
175
+ },
156
176
  500: {
157
177
  long_description: (e) => {
158
178
  const { normalize: t } = e;
@@ -1292,6 +1312,26 @@ const resource$1 = {
1292
1312
  return t(["Límite de peticiones excedido"]);
1293
1313
  }
1294
1314
  },
1315
+ 449: {
1316
+ long_description: (e) => {
1317
+ const { normalize: t } = e;
1318
+ return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."]);
1319
+ },
1320
+ real: {
1321
+ long_description: (e) => {
1322
+ const { normalize: t } = e;
1323
+ return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."]);
1324
+ },
1325
+ short_description: (e) => {
1326
+ const { normalize: t } = e;
1327
+ return t(["Credencial inválida"]);
1328
+ }
1329
+ },
1330
+ short_description: (e) => {
1331
+ const { normalize: t } = e;
1332
+ return t(["Credencial inválida"]);
1333
+ }
1334
+ },
1295
1335
  500: {
1296
1336
  long_description: (e) => {
1297
1337
  const { normalize: t } = e;
@@ -7264,9 +7304,9 @@ const configValidator = create$3().noUnknown().shape({
7264
7304
  }).strict().noUnknown();
7265
7305
  let __VERSION__ = {
7266
7306
  git: {
7267
- hash: "gb72999f",
7307
+ hash: "ged753f6",
7268
7308
  distance: 0,
7269
- tag: "v1.2.0"
7309
+ tag: "v1.3.0"
7270
7310
  }
7271
7311
  };
7272
7312
  function getVersion() {
@@ -77698,7 +77738,6 @@ const _hoisted_1$b = {
77698
77738
  credential: {},
77699
77739
  disableFormAutocomplete: { type: Boolean, default: !1 },
77700
77740
  getSelectedAccounts: { type: Function, default: void 0 },
77701
- selectClass: { default: "" },
77702
77741
  sync: {}
77703
77742
  },
77704
77743
  emits: ["done"],
@@ -78311,7 +78350,7 @@ const _hoisted_1$4 = { key: 1 }, _hoisted_2$4 = ["alt", "src"], _hoisted_3$2 = [
78311
78350
  __name: "SiteForm",
78312
78351
  props: {
78313
78352
  assetsPath: { default: "https://s.paybook.com" },
78314
- backUpConnection: { type: Boolean },
78353
+ backUpConnection: { type: Boolean, default: !1 },
78315
78354
  buttonDisabledStyle: { type: Boolean, default: !1 },
78316
78355
  credentialService: { default: null },
78317
78356
  disableFormAutocomplete: { type: Boolean, default: !1 },
@@ -78921,8 +78960,9 @@ const _hoisted_1$4 = { key: 1 }, _hoisted_2$4 = ["alt", "src"], _hoisted_3$2 = [
78921
78960
  });
78922
78961
  }
78923
78962
  function v(Y, ae) {
78924
- Y && (he[Y] = ae), ie = Object.getOwnPropertyNames(n.twofa.rules).reduce(
78925
- (xe, Ve) => Ve === "__ob__" || n.twofa.rules[Ve].length === 0 ? xe : xe || !he[Ve],
78963
+ const xe = toRaw(n.twofa.rules);
78964
+ Y && (he[Y] = ae), ie = Object.getOwnPropertyNames(xe).reduce(
78965
+ (Ve, Ue) => Ue === "__ob__" || xe[Ue].length === 0 ? Ve : Ve || !he[Ue],
78926
78966
  !1
78927
78967
  );
78928
78968
  }
@@ -78962,7 +79002,7 @@ const _hoisted_1$4 = { key: 1 }, _hoisted_2$4 = ["alt", "src"], _hoisted_3$2 = [
78962
79002
  "label-position": "top",
78963
79003
  disabled: g.value,
78964
79004
  model: f.value,
78965
- rules: n.twofa.rules,
79005
+ rules: toRaw(n.twofa.rules),
78966
79006
  name: `twofa-${n.twofa.config.id_site}`,
78967
79007
  autocomplete: n.disableFormAutocomplete ? "off" : "on",
78968
79008
  onSubmit: withModifiers(u, ["prevent"]),
@@ -84774,11 +84814,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
84774
84814
  Ce.value = c("credential.loading.title"), pe.value = c("credential.loading.message");
84775
84815
  }
84776
84816
  return dr(), t({
84817
+ /**
84818
+ * Function to close the modal
84819
+ */
84777
84820
  close: Ir,
84821
+ /**
84822
+ * Function to get the last request ID, primarily for debugging purposes
84823
+ */
84778
84824
  getLastRid: Er,
84825
+ /**
84826
+ * Function to open the modal
84827
+ */
84779
84828
  open: Ar,
84829
+ /**
84830
+ * Function to set the credential
84831
+ */
84780
84832
  setCredential: hr,
84833
+ /**
84834
+ * Function to set the token
84835
+ */
84781
84836
  setToken: Wr,
84837
+ /**
84838
+ * Function to launch the update the credential flow
84839
+ */
84782
84840
  updateCredential: Hr
84783
84841
  }), (Gr, Lt) => (openBlock(), createElementBlock(Fragment, null, [
84784
84842
  createVNode(TheModal, {
@@ -84956,10 +85014,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
84956
85014
  credential: unref(Fe).response.id_credential,
84957
85015
  "disable-form-autocomplete": a.navigation.disableFormAutocomplete,
84958
85016
  "get-selected-accounts": a.navigation.getSelectedAccounts,
84959
- "select-class": a.navigation.selectClass,
84960
85017
  sync: unref(er),
84961
85018
  onDone: Ir
84962
- }, null, 8, ["avatar", "button-disabled-style", "client", "credential", "disable-form-autocomplete", "get-selected-accounts", "select-class", "sync"])) : (openBlock(), createBlock(FinalResponse, {
85019
+ }, null, 8, ["avatar", "button-disabled-style", "client", "credential", "disable-form-autocomplete", "get-selected-accounts", "sync"])) : (openBlock(), createBlock(FinalResponse, {
84963
85020
  key: 1,
84964
85021
  avatar: `${unref(Y)}${unref(Fe).config.avatar}`,
84965
85022
  "display-accounts-selection": a.navigation.displayAccountsSelection,
@@ -85062,7 +85119,52 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
85062
85119
  "widget-version": "pb-w-sync_widget-version"
85063
85120
  }, cssModules = {
85064
85121
  $style: style0
85065
- }, DataWidget = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules]]), _sfc_main = /* @__PURE__ */ defineComponent({
85122
+ }, DataWidget = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules]]), defaultConfig = {
85123
+ client: {},
85124
+ locale: "en",
85125
+ entrypoint: {
85126
+ country: "MX"
85127
+ },
85128
+ navigation: {
85129
+ disableFormAutocomplete: !1,
85130
+ displayAccountsSelection: !1,
85131
+ displayBusinessSites: !0,
85132
+ displayCredentialInModal: !1,
85133
+ displayErrorsInToast: !0,
85134
+ displayLogoImages: !0,
85135
+ displayLongDescription: !1,
85136
+ displayPersonalSites: !0,
85137
+ displayPrivacyScreen: !0,
85138
+ displaySiteOrganizations: [],
85139
+ displaySiteOrganizationTypes: [],
85140
+ displaySites: [],
85141
+ displayStatusInToast: !1,
85142
+ enableBackNavigation: !0,
85143
+ enableTwofaBackNavigation: !1,
85144
+ formButtonsDisabledStyle: !1,
85145
+ formShowPasswordStyle: "icon",
85146
+ getSelectedAccounts: void 0,
85147
+ hideSelectCountry: !1,
85148
+ hideSiteOrganizations: [],
85149
+ hideSiteOrganizationTypes: [],
85150
+ hideSites: [],
85151
+ oneSiteFlow: !1,
85152
+ quickAnswer: !1,
85153
+ returnToSiteFormOnUserError: !1,
85154
+ saveCredential: !0,
85155
+ selectClass: "",
85156
+ socketTimeout: 24e4,
85157
+ toastDuration: 5e3,
85158
+ toastPosition: "top-right"
85159
+ },
85160
+ __internal__: {
85161
+ apiBaseUrl: null,
85162
+ apiEnv: null,
85163
+ assetsBaseUrl: null,
85164
+ plaidSites: !1,
85165
+ defaultHttpParams: {}
85166
+ }
85167
+ }, _sfc_main = /* @__PURE__ */ defineComponent({
85066
85168
  __name: "App",
85067
85169
  props: {
85068
85170
  config: { default: () => ({}) },
@@ -85074,163 +85176,145 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
85074
85176
  setup(e, { expose: t }) {
85075
85177
  const n = e, a = ref(null), { t: s } = useI18n();
85076
85178
  provide(translateFunction, s);
85077
- const o = {
85078
- client: {},
85079
- locale: "en",
85080
- entrypoint: {
85081
- country: "MX"
85082
- },
85083
- navigation: {
85084
- disableFormAutocomplete: !1,
85085
- displayAccountsSelection: !1,
85086
- displayBusinessSites: !0,
85087
- displayCredentialInModal: !1,
85088
- displayErrorsInToast: !0,
85089
- displayLogoImages: !0,
85090
- displayLongDescription: !1,
85091
- displayPersonalSites: !0,
85092
- displayPrivacyScreen: !0,
85093
- displaySiteOrganizations: [],
85094
- displaySiteOrganizationTypes: [],
85095
- displaySites: [],
85096
- displayStatusInToast: !1,
85097
- enableBackNavigation: !0,
85098
- enableTwofaBackNavigation: !1,
85099
- formButtonsDisabledStyle: !1,
85100
- formShowPasswordStyle: "icon",
85101
- getSelectedAccounts: void 0,
85102
- hideSelectCountry: !1,
85103
- hideSiteOrganizations: [],
85104
- hideSiteOrganizationTypes: [],
85105
- hideSites: [],
85106
- oneSiteFlow: !1,
85107
- quickAnswer: !1,
85108
- returnToSiteFormOnUserError: !1,
85109
- saveCredential: !0,
85110
- selectClass: "",
85111
- socketTimeout: 24e4,
85112
- toastDuration: 5e3,
85113
- toastPosition: "top-right"
85114
- },
85115
- __internal__: {
85116
- apiBaseUrl: null,
85117
- apiEnv: null,
85118
- assetsBaseUrl: null,
85119
- plaidSites: !1,
85120
- defaultHttpParams: {}
85121
- }
85122
- }, c = reactive({
85179
+ const o = reactive({
85123
85180
  client: {
85124
- ...o.client,
85125
- ...$e(n.config.client)
85181
+ ...defaultConfig.client,
85182
+ ..._e(n.config.client)
85126
85183
  },
85127
85184
  enableTestMode: n.enableTestMode,
85128
85185
  entrypoint: {
85129
- ...o.entrypoint,
85130
- ...$e(n.config.entrypoint)
85186
+ ...defaultConfig.entrypoint,
85187
+ ..._e(n.config.entrypoint)
85131
85188
  },
85132
85189
  internal: {
85133
- ...o.__internal__,
85134
- ...$e(n.config.__internal__)
85190
+ ...defaultConfig.__internal__,
85191
+ ..._e(n.config.__internal__)
85135
85192
  },
85136
- locale: n.config.locale || o.locale,
85193
+ locale: n.config.locale || defaultConfig.locale,
85137
85194
  navigation: {
85138
- ...o.navigation,
85139
- ...$e(n.config.navigation)
85195
+ ...defaultConfig.navigation,
85196
+ ..._e(n.config.navigation)
85140
85197
  },
85141
85198
  refreshTokenFunction: n.refreshTokenFunction,
85142
85199
  strict: n.strict,
85143
85200
  token: n.token,
85144
- onTokenRefreshed: (pe) => {
85145
- c.token = pe;
85201
+ onTokenRefreshed: ($e) => {
85202
+ o.token = $e;
85146
85203
  }
85147
85204
  });
85148
- function f() {
85205
+ function c() {
85149
85206
  a.value.close();
85150
85207
  }
85151
- function y() {
85208
+ function f() {
85152
85209
  return a.value.getLastRid();
85153
85210
  }
85154
- function m() {
85211
+ function y() {
85155
85212
  nextTick(() => {
85156
85213
  a.value.open();
85157
85214
  });
85158
85215
  }
85159
- function g(pe = {}) {
85216
+ function m($e = {}) {
85160
85217
  try {
85161
- configValidator.validateSync(pe);
85162
- } catch (Ce) {
85163
- if (Ce.name === "ValidationError")
85164
- throw new Error(`ValidationError: ${Ce.message}`);
85165
- }
85166
- c.client = {
85167
- ...o.client,
85168
- ...$e(pe.client)
85169
- }, c.entrypoint = {
85170
- ...o.entrypoint,
85171
- ...$e(pe.entrypoint)
85172
- }, c.internal = {
85173
- ...o.__internal__,
85174
- ...$e(pe.__internal__)
85175
- }, c.locale = pe.locale || o.locale, c.navigation = {
85176
- ...o.navigation,
85177
- ...$e(pe.navigation)
85218
+ configValidator.validateSync($e);
85219
+ } catch (pe) {
85220
+ if (pe.name === "ValidationError")
85221
+ throw new Error(`ValidationError: ${pe.message}`);
85222
+ }
85223
+ o.client = {
85224
+ ...defaultConfig.client,
85225
+ ..._e($e.client)
85226
+ }, o.entrypoint = {
85227
+ ...defaultConfig.entrypoint,
85228
+ ..._e($e.entrypoint)
85229
+ }, o.internal = {
85230
+ ...defaultConfig.__internal__,
85231
+ ..._e($e.__internal__)
85232
+ }, o.locale = $e.locale || defaultConfig.locale, o.navigation = {
85233
+ ...defaultConfig.navigation,
85234
+ ..._e($e.navigation)
85178
85235
  };
85179
85236
  }
85180
- function z(pe) {
85181
- a.value.setCredential(pe);
85237
+ function g($e) {
85238
+ a.value.setCredential($e);
85182
85239
  }
85183
- function ie(pe) {
85184
- c.entrypoint = { ...c.entrypoint, site: pe }, m();
85240
+ function z($e) {
85241
+ o.entrypoint = { ...o.entrypoint, site: $e }, y();
85185
85242
  }
85186
- function re(pe) {
85187
- a.value.updateCredential(pe);
85243
+ function ie($e) {
85244
+ a.value.updateCredential($e);
85188
85245
  }
85189
- function he(pe, Ce) {
85190
- return a.value.setToken(pe, Ce);
85246
+ function re($e, pe) {
85247
+ return a.value.setToken($e, pe);
85191
85248
  }
85192
- function _e(pe = {}) {
85249
+ function he($e = {}) {
85193
85250
  try {
85194
- configValidator.validateSync(pe);
85195
- } catch (Ce) {
85196
- if (Ce.name === "ValidationError")
85197
- throw new Error(`ValidationError: ${Ce.message}`);
85198
- }
85199
- c.client = {
85200
- ...c.client,
85201
- ...$e(pe.client)
85202
- }, c.entrypoint = {
85203
- ...c.entrypoint,
85204
- ...$e(pe.entrypoint)
85205
- }, c.internal = {
85206
- ...c.internal,
85207
- ...$e(pe.__internal__)
85208
- }, c.locale = pe.locale || c.locale, c.navigation = {
85209
- ...c.navigation,
85210
- ...$e(pe.navigation)
85251
+ configValidator.validateSync($e);
85252
+ } catch (pe) {
85253
+ if (pe.name === "ValidationError")
85254
+ throw new Error(`ValidationError: ${pe.message}`);
85255
+ }
85256
+ o.client = {
85257
+ ...o.client,
85258
+ ..._e($e.client)
85259
+ }, o.entrypoint = {
85260
+ ...o.entrypoint,
85261
+ ..._e($e.entrypoint)
85262
+ }, o.internal = {
85263
+ ...o.internal,
85264
+ ..._e($e.__internal__)
85265
+ }, o.locale = $e.locale || o.locale, o.navigation = {
85266
+ ...o.navigation,
85267
+ ..._e($e.navigation)
85211
85268
  };
85212
85269
  }
85213
- function $e(pe = {}) {
85214
- const Ce = { ...pe };
85215
- return Object.keys(Ce).forEach((Oe) => {
85216
- Ce[Oe] === void 0 && delete Ce[Oe];
85217
- }), Ce;
85270
+ function _e($e = {}) {
85271
+ const pe = { ...$e };
85272
+ return Object.keys(pe).forEach((Ce) => {
85273
+ pe[Ce] === void 0 && delete pe[Ce];
85274
+ }), pe;
85218
85275
  }
85219
85276
  return t({
85220
- close: f,
85221
- getLastRid: y,
85222
- open: m,
85223
- setConfig: g,
85224
- setEntrypointCredential: z,
85225
- setEntrypointSite: ie,
85226
- setEntrypointUpdateCredential: re,
85227
- setToken: he,
85228
- upsertConfig: _e
85229
- }), (pe, Ce) => (openBlock(), createBlock(unref(ElConfigProvider), {
85230
- locale: c.locale === "es" ? unref(es) : unref(en)
85277
+ /**
85278
+ * Closes the widget.
85279
+ */
85280
+ close: c,
85281
+ /**
85282
+ * Gets the last request ID.
85283
+ */
85284
+ getLastRid: f,
85285
+ /**
85286
+ * Opens the widget.
85287
+ */
85288
+ open: y,
85289
+ /**
85290
+ * Sets the configuration for the widget.
85291
+ */
85292
+ setConfig: m,
85293
+ /**
85294
+ * Sets the sync credential flow.
85295
+ */
85296
+ setEntrypointCredential: g,
85297
+ /**
85298
+ * Opens a site.
85299
+ */
85300
+ setEntrypointSite: z,
85301
+ /**
85302
+ * Sets the update credential flow.
85303
+ */
85304
+ setEntrypointUpdateCredential: ie,
85305
+ /**
85306
+ * Sets the token for authentication.
85307
+ */
85308
+ setToken: re,
85309
+ /**
85310
+ * Upserts the configuration for the widget.
85311
+ */
85312
+ upsertConfig: he
85313
+ }), ($e, pe) => (openBlock(), createBlock(unref(ElConfigProvider), {
85314
+ locale: o.locale === "es" ? unref(es) : unref(en)
85231
85315
  }, {
85232
85316
  default: withCtx(() => [
85233
- createVNode(DataWidget, mergeProps(c, {
85317
+ createVNode(DataWidget, mergeProps(o, {
85234
85318
  ref_key: "widgetComponent",
85235
85319
  ref: a
85236
85320
  }), null, 16)