@dynamic-labs-wallet/browser 1.0.110 → 1.0.111

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/index.cjs CHANGED
@@ -966,6 +966,7 @@ const BACKUP_SIZE_BYTES_ESTIMATE = 64 * 1024;
966
966
  const USER_ACTIONABLE_REASONS = new Set([
967
967
  'auth_denied',
968
968
  'storage_full',
969
+ 'provider_not_configured',
969
970
  // Google Drive credentials are provided per-customer (each project's own
970
971
  // Google Cloud OAuth app), so 429s hit the customer's project quota, not
971
972
  // Dynamic's. From an oncall perspective there is nothing to act on -- the
@@ -973,10 +974,8 @@ const USER_ACTIONABLE_REASONS = new Set([
973
974
  'rate_limited'
974
975
  ]);
975
976
  /**
976
- * Returns true when the failure reason represents a problem the end user
977
- * has to wait out or resolve themselves (e.g. grant Drive permission, free
978
- * up storage, wait for a per-user/per-project rate limit to clear) and not
979
- * a system-side issue oncall should investigate.
977
+ * Returns true when the failure reason is outside our systems and oncall cannot act on it.
978
+ * This includes user permissions, provider configuration, quota, and rate-limit issues.
980
979
  */ const isUserActionableGoogleDriveBackupErrorReason = (reason)=>USER_ACTIONABLE_REASONS.has(reason);
981
980
  const NON_RETRYABLE_AUTH_REASONS = new Set([
982
981
  'insufficientPermissions',
@@ -988,6 +987,12 @@ const NON_RETRYABLE_AUTH_DETAIL_REASONS = new Set([
988
987
  'ACCESS_TOKEN_EXPIRED',
989
988
  'CREDENTIALS_MISSING'
990
989
  ]);
990
+ const PROVIDER_NOT_CONFIGURED_REASONS = new Set([
991
+ 'accessNotConfigured'
992
+ ]);
993
+ const PROVIDER_NOT_CONFIGURED_DETAIL_REASONS = new Set([
994
+ 'SERVICE_DISABLED'
995
+ ]);
991
996
  const RATE_LIMIT_REASONS = new Set([
992
997
  'rateLimitExceeded',
993
998
  'userRateLimitExceeded',
@@ -1013,6 +1018,13 @@ const NETWORK_ERROR = {
1013
1018
  errorReason: 'auth_denied'
1014
1019
  };
1015
1020
  }
1021
+ if (reason && PROVIDER_NOT_CONFIGURED_REASONS.has(reason) || detailReason && PROVIDER_NOT_CONFIGURED_DETAIL_REASONS.has(detailReason)) {
1022
+ return {
1023
+ message: 'Google Drive backup is unavailable: the Google Drive API is not enabled for this application. Contact the app developer.',
1024
+ isRetryable: false,
1025
+ errorReason: 'provider_not_configured'
1026
+ };
1027
+ }
1016
1028
  if (reason === 'storageQuotaExceeded') {
1017
1029
  return {
1018
1030
  message: 'Google Drive storage is full. Free up space in your Google Drive and try again.',
@@ -2215,11 +2227,8 @@ const initializeCloudKit = async (config, signInButtonId, onSignInRequired, onSi
2215
2227
  ...new Set(failures.map((f)=>f.errorReason))
2216
2228
  ];
2217
2229
  const isUserActionable = failures.every((f)=>isUserActionableGoogleDriveBackupErrorReason(f.errorReason));
2218
- // OAuth scope and storage-quota failures are end-user issues (grant
2219
- // Drive permission, free up storage) not anything oncall can fix.
2220
- // Downgrade them to warn so monitors can filter on status:error and
2221
- // still catch real system-side failures (5xx/network/unknown) without
2222
- // the user-side noise drowning out the signal.
2230
+ // User, provider-configuration, and rate-limit failures are outside Dynamic's systems.
2231
+ // Warn so status:error monitors focus on failures Dynamic can investigate.
2223
2232
  // When every location failed for the same reason (the dominant case)
2224
2233
  // surface a single string; otherwise emit the array so consumers can
2225
2234
  // see the mix.
package/index.esm.js CHANGED
@@ -967,6 +967,7 @@ const BACKUP_SIZE_BYTES_ESTIMATE = 64 * 1024;
967
967
  const USER_ACTIONABLE_REASONS = new Set([
968
968
  'auth_denied',
969
969
  'storage_full',
970
+ 'provider_not_configured',
970
971
  // Google Drive credentials are provided per-customer (each project's own
971
972
  // Google Cloud OAuth app), so 429s hit the customer's project quota, not
972
973
  // Dynamic's. From an oncall perspective there is nothing to act on -- the
@@ -974,10 +975,8 @@ const USER_ACTIONABLE_REASONS = new Set([
974
975
  'rate_limited'
975
976
  ]);
976
977
  /**
977
- * Returns true when the failure reason represents a problem the end user
978
- * has to wait out or resolve themselves (e.g. grant Drive permission, free
979
- * up storage, wait for a per-user/per-project rate limit to clear) and not
980
- * a system-side issue oncall should investigate.
978
+ * Returns true when the failure reason is outside our systems and oncall cannot act on it.
979
+ * This includes user permissions, provider configuration, quota, and rate-limit issues.
981
980
  */ const isUserActionableGoogleDriveBackupErrorReason = (reason)=>USER_ACTIONABLE_REASONS.has(reason);
982
981
  const NON_RETRYABLE_AUTH_REASONS = new Set([
983
982
  'insufficientPermissions',
@@ -989,6 +988,12 @@ const NON_RETRYABLE_AUTH_DETAIL_REASONS = new Set([
989
988
  'ACCESS_TOKEN_EXPIRED',
990
989
  'CREDENTIALS_MISSING'
991
990
  ]);
991
+ const PROVIDER_NOT_CONFIGURED_REASONS = new Set([
992
+ 'accessNotConfigured'
993
+ ]);
994
+ const PROVIDER_NOT_CONFIGURED_DETAIL_REASONS = new Set([
995
+ 'SERVICE_DISABLED'
996
+ ]);
992
997
  const RATE_LIMIT_REASONS = new Set([
993
998
  'rateLimitExceeded',
994
999
  'userRateLimitExceeded',
@@ -1014,6 +1019,13 @@ const NETWORK_ERROR = {
1014
1019
  errorReason: 'auth_denied'
1015
1020
  };
1016
1021
  }
1022
+ if (reason && PROVIDER_NOT_CONFIGURED_REASONS.has(reason) || detailReason && PROVIDER_NOT_CONFIGURED_DETAIL_REASONS.has(detailReason)) {
1023
+ return {
1024
+ message: 'Google Drive backup is unavailable: the Google Drive API is not enabled for this application. Contact the app developer.',
1025
+ isRetryable: false,
1026
+ errorReason: 'provider_not_configured'
1027
+ };
1028
+ }
1017
1029
  if (reason === 'storageQuotaExceeded') {
1018
1030
  return {
1019
1031
  message: 'Google Drive storage is full. Free up space in your Google Drive and try again.',
@@ -2216,11 +2228,8 @@ const initializeCloudKit = async (config, signInButtonId, onSignInRequired, onSi
2216
2228
  ...new Set(failures.map((f)=>f.errorReason))
2217
2229
  ];
2218
2230
  const isUserActionable = failures.every((f)=>isUserActionableGoogleDriveBackupErrorReason(f.errorReason));
2219
- // OAuth scope and storage-quota failures are end-user issues (grant
2220
- // Drive permission, free up storage) not anything oncall can fix.
2221
- // Downgrade them to warn so monitors can filter on status:error and
2222
- // still catch real system-side failures (5xx/network/unknown) without
2223
- // the user-side noise drowning out the signal.
2231
+ // User, provider-configuration, and rate-limit failures are outside Dynamic's systems.
2232
+ // Warn so status:error monitors focus on failures Dynamic can investigate.
2224
2233
  // When every location failed for the same reason (the dominant case)
2225
2234
  // surface a single string; otherwise emit the array so consumers can
2226
2235
  // see the mix.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser",
3
- "version": "1.0.110",
3
+ "version": "1.0.111",
4
4
  "license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "1.0.110",
7
+ "@dynamic-labs-wallet/core": "1.0.111",
8
8
  "@dynamic-labs-wallet/forward-mpc-client": "1.0.2",
9
- "@dynamic-labs-wallet/primitives": "1.0.110",
9
+ "@dynamic-labs-wallet/primitives": "1.0.111",
10
10
  "@dynamic-labs/sdk-api-core": "^0.16.0",
11
11
  "@noble/curves": "1.8.0",
12
12
  "argon2id": "1.0.1",
@@ -22,12 +22,10 @@ type GoogleDriveErrorBody = {
22
22
  * can branch on a fixed enum instead of substring-matching the
23
23
  * user-facing message.
24
24
  */
25
- export type GoogleDriveBackupErrorReason = 'auth_denied' | 'storage_full' | 'rate_limited' | 'service_unavailable' | 'network' | 'unknown';
25
+ export type GoogleDriveBackupErrorReason = 'auth_denied' | 'storage_full' | 'rate_limited' | 'provider_not_configured' | 'service_unavailable' | 'network' | 'unknown';
26
26
  /**
27
- * Returns true when the failure reason represents a problem the end user
28
- * has to wait out or resolve themselves (e.g. grant Drive permission, free
29
- * up storage, wait for a per-user/per-project rate limit to clear) and not
30
- * a system-side issue oncall should investigate.
27
+ * Returns true when the failure reason is outside our systems and oncall cannot act on it.
28
+ * This includes user permissions, provider configuration, quota, and rate-limit issues.
31
29
  */
32
30
  export declare const isUserActionableGoogleDriveBackupErrorReason: (reason: GoogleDriveBackupErrorReason) => boolean;
33
31
  type MappedUploadError = {
@@ -1 +1 @@
1
- {"version":3,"file":"googleDrive.d.ts","sourceRoot":"","sources":["../../../src/backup/providers/googleDrive.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mCAAmC,0GAGtC,CAAC;AAeX,KAAK,oBAAoB,GAAG;IAC1B,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,KAAK,CAAC;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACtD,OAAO,CAAC,EAAE,KAAK,CAAC;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACxD,CAAC;CACH,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,4BAA4B,GACpC,aAAa,GACb,cAAc,GACd,cAAc,GACd,qBAAqB,GACrB,SAAS,GACT,SAAS,CAAC;AAYd;;;;;GAKG;AACH,eAAO,MAAM,4CAA4C,WAAY,4BAA4B,KAAG,OAC/D,CAAC;AAEtC,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,4BAA4B,CAAC;CAC3C,CAAC;AAkBF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,eAAgB,MAAM,QAAQ,oBAAoB,GAAG,IAAI,KAAG,iBAkDjG,CAAC;AAUF,eAAO,MAAM,sBAAsB,WAAY,iBAAiB,KAAG,KAQlE,CAAC;AAiDF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,WAAW,EAAE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QAAQ,EAAE,OAAO,CAAC;CACnB,iBAOA,CAAC;AA0FF,eAAO,MAAM,wBAAwB,+BAGlC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAiCA,CAAC;AAEF,eAAO,MAAM,2BAA2B,+BAGrC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,OAAO,CA6BlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AA0DzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,0HAUnC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB;;2BAEuB;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,kBAwFA,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AA0DzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,0HAUnC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB;;2BAEuB;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,kBAqFA,CAAC"}