@friggframework/core 2.0.0--canary.461.176b582.0 → 2.0.0--canary.461.b8c7c6b.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.
@@ -100,6 +100,17 @@ class CredentialRepositoryMongo extends CredentialRepositoryInterface {
100
100
  if (!identifiers)
101
101
  throw new Error('identifiers required to upsert credential');
102
102
 
103
+ if (!identifiers.user && !identifiers.userId) {
104
+ throw new Error('user or userId required in identifiers');
105
+ }
106
+ if (!identifiers.externalId) {
107
+ throw new Error(
108
+ 'externalId required in identifiers to prevent credential collision. ' +
109
+ 'When multiple credentials exist for the same user, both userId and externalId ' +
110
+ 'are needed to uniquely identify which credential to update.'
111
+ );
112
+ }
113
+
103
114
  // Build where clause from identifiers
104
115
  const where = this._convertIdentifiersToWhere(identifiers);
105
116
 
@@ -119,6 +119,17 @@ class CredentialRepositoryPostgres extends CredentialRepositoryInterface {
119
119
  if (!identifiers)
120
120
  throw new Error('identifiers required to upsert credential');
121
121
 
122
+ if (!identifiers.user && !identifiers.userId) {
123
+ throw new Error('user or userId required in identifiers');
124
+ }
125
+ if (!identifiers.externalId) {
126
+ throw new Error(
127
+ 'externalId required in identifiers to prevent credential collision. ' +
128
+ 'When multiple credentials exist for the same user, both userId and externalId ' +
129
+ 'are needed to uniquely identify which credential to update.'
130
+ );
131
+ }
132
+
122
133
  const where = this._convertIdentifiersToWhere(identifiers);
123
134
 
124
135
  const { user, externalId } = identifiers;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.461.176b582.0",
4
+ "version": "2.0.0--canary.461.b8c7c6b.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -37,9 +37,9 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@friggframework/eslint-config": "2.0.0--canary.461.176b582.0",
41
- "@friggframework/prettier-config": "2.0.0--canary.461.176b582.0",
42
- "@friggframework/test": "2.0.0--canary.461.176b582.0",
40
+ "@friggframework/eslint-config": "2.0.0--canary.461.b8c7c6b.0",
41
+ "@friggframework/prettier-config": "2.0.0--canary.461.b8c7c6b.0",
42
+ "@friggframework/test": "2.0.0--canary.461.b8c7c6b.0",
43
43
  "@prisma/client": "^6.17.0",
44
44
  "@types/lodash": "4.17.15",
45
45
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "176b5825613b18d39abb44b9428291a446a798e5"
82
+ "gitHead": "b8c7c6bedb12c3dd0c055eedae89456050458d48"
83
83
  }