@superdurable/connector-google-workspace-admin 0.1.0 → 0.1.1
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/dex-connector.json +183 -9
- package/dist/{chunk-Z52APRCQ.js → chunk-JZYIW6P3.js} +46 -30
- package/dist/{connection-DIUn6yK-.d.ts → connection-PAXI58T7.d.ts} +8 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +53 -18
- package/dist/mock.d.ts +1 -1
- package/dist/mock.js +1 -1
- package/package.json +3 -2
package/dex-connector.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"connectorId": "google-workspace-admin",
|
|
3
|
-
"releaseTag": "connectors/google/workspace-admin/go/v0.24.
|
|
3
|
+
"releaseTag": "connectors/google/workspace-admin/go/v0.24.1",
|
|
4
4
|
"package": {
|
|
5
5
|
"ecosystem": "npm",
|
|
6
6
|
"name": "@superdurable/connector-google-workspace-admin",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.1"
|
|
8
8
|
},
|
|
9
9
|
"factories": [
|
|
10
10
|
{
|
|
11
11
|
"name": "newGetUserStep",
|
|
12
12
|
"kind": "query",
|
|
13
13
|
"operationId": "getUser",
|
|
14
|
+
"inputType": "GetUserInput",
|
|
15
|
+
"description": "Read one user account by primary email address, alias, or unique user ID.",
|
|
14
16
|
"fields": {
|
|
15
17
|
"stepType": "stepType",
|
|
16
18
|
"annotations": "annotations",
|
|
@@ -43,12 +45,28 @@
|
|
|
43
45
|
"field": "defect",
|
|
44
46
|
"optional": true
|
|
45
47
|
}
|
|
46
|
-
]
|
|
48
|
+
],
|
|
49
|
+
"inputSchema": {
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"description": "GetUserInput identifies one account to read.",
|
|
52
|
+
"properties": {
|
|
53
|
+
"userKey": {
|
|
54
|
+
"description": "UserKey is the account's primary email address, an alias address, or its numeric unique user ID.",
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"userKey"
|
|
60
|
+
],
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
47
63
|
},
|
|
48
64
|
{
|
|
49
65
|
"name": "newListUsersStep",
|
|
50
66
|
"kind": "query",
|
|
51
67
|
"operationId": "listUsers",
|
|
68
|
+
"inputType": "ListUsersInput",
|
|
69
|
+
"description": "List one bounded page of accounts in the administrator's customer account or one domain, optionally filtered with Google's user search syntax.",
|
|
52
70
|
"fields": {
|
|
53
71
|
"stepType": "stepType",
|
|
54
72
|
"annotations": "annotations",
|
|
@@ -76,12 +94,45 @@
|
|
|
76
94
|
"field": "defect",
|
|
77
95
|
"optional": true
|
|
78
96
|
}
|
|
79
|
-
]
|
|
97
|
+
],
|
|
98
|
+
"inputSchema": {
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"description": "ListUsersInput selects one page of accounts. Leave both Domain and Customer blank to list every account in the administrator's own customer account.",
|
|
101
|
+
"properties": {
|
|
102
|
+
"customer": {
|
|
103
|
+
"description": "Customer is a customer ID such as C03az79cb, for a reseller administrator; blank uses the administrator's own account.",
|
|
104
|
+
"type": "string"
|
|
105
|
+
},
|
|
106
|
+
"domain": {
|
|
107
|
+
"description": "Domain limits the page to one of the account's domains, such as example.com; it cannot be combined with Customer.",
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"orderBy": {
|
|
111
|
+
"description": "OrderBy is email, givenName, or familyName; blank sorts by primary address.",
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"pageSize": {
|
|
115
|
+
"description": "PageSize is 1 to 500 accounts; zero uses the connection's listUsersPageSize.",
|
|
116
|
+
"type": "integer"
|
|
117
|
+
},
|
|
118
|
+
"pageToken": {
|
|
119
|
+
"description": "PageToken is the NextPageToken of the previous page; Google keeps it valid for three days.",
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"query": {
|
|
123
|
+
"description": "Query is Google's user search syntax, such as orgUnitPath='/Sales' isSuspended=false; blank lists every account. Google documents that new data can take up to 36 hours to appear in search results.",
|
|
124
|
+
"type": "string"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"type": "object"
|
|
128
|
+
}
|
|
80
129
|
},
|
|
81
130
|
{
|
|
82
131
|
"name": "newCreateUserStep",
|
|
83
132
|
"kind": "mutation",
|
|
84
133
|
"operationId": "createUser",
|
|
134
|
+
"inputType": "CreateUserInput",
|
|
135
|
+
"description": "Create one account with a generated password nobody receives, tagged with a stable key, so a repeated Step returns the account it created instead of a duplicate.",
|
|
85
136
|
"fields": {
|
|
86
137
|
"stepType": "stepType",
|
|
87
138
|
"annotations": "annotations",
|
|
@@ -114,12 +165,54 @@
|
|
|
114
165
|
"field": "defect",
|
|
115
166
|
"optional": true
|
|
116
167
|
}
|
|
117
|
-
]
|
|
168
|
+
],
|
|
169
|
+
"inputSchema": {
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"description": "CreateUserInput describes one account to create. The connector generates the initial password itself: no password is accepted, returned, stored, or logged.",
|
|
172
|
+
"properties": {
|
|
173
|
+
"familyName": {
|
|
174
|
+
"description": "FamilyName is the required last name, at most 60 characters.",
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"givenName": {
|
|
178
|
+
"description": "GivenName is the required first name, at most 60 characters.",
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"orgUnitPath": {
|
|
182
|
+
"description": "OrgUnitPath places the account in an organizational unit, such as /Engineering; blank uses the top-level unit /.",
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"primaryEmail": {
|
|
186
|
+
"description": "PrimaryEmail is the new sign-in address in one of the account's verified domains, such as ada@example.com.",
|
|
187
|
+
"type": "string"
|
|
188
|
+
},
|
|
189
|
+
"provisioningKey": {
|
|
190
|
+
"description": "ProvisioningKey optionally identifies one logical account across Step executions, such as an HR hire ID. It is 1 to 128 letters, digits, and . _ : - characters; blank uses the Step's Call ID.",
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"recoveryEmail": {
|
|
194
|
+
"description": "RecoveryEmail is an optional personal address Google can use for account recovery.",
|
|
195
|
+
"type": "string"
|
|
196
|
+
},
|
|
197
|
+
"recoveryPhone": {
|
|
198
|
+
"description": "RecoveryPhone is an optional E.164 recovery phone number, such as +16506661212.",
|
|
199
|
+
"type": "string"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"required": [
|
|
203
|
+
"familyName",
|
|
204
|
+
"givenName",
|
|
205
|
+
"primaryEmail"
|
|
206
|
+
],
|
|
207
|
+
"type": "object"
|
|
208
|
+
}
|
|
118
209
|
},
|
|
119
210
|
{
|
|
120
211
|
"name": "newSuspendUserStep",
|
|
121
212
|
"kind": "mutation",
|
|
122
213
|
"operationId": "suspendUser",
|
|
214
|
+
"inputType": "SuspendUserInput",
|
|
215
|
+
"description": "Suspend one account so it cannot sign in, keeping its data; suspending a suspended account changes nothing.",
|
|
123
216
|
"fields": {
|
|
124
217
|
"stepType": "stepType",
|
|
125
218
|
"annotations": "annotations",
|
|
@@ -152,12 +245,28 @@
|
|
|
152
245
|
"field": "defect",
|
|
153
246
|
"optional": true
|
|
154
247
|
}
|
|
155
|
-
]
|
|
248
|
+
],
|
|
249
|
+
"inputSchema": {
|
|
250
|
+
"additionalProperties": false,
|
|
251
|
+
"description": "SuspendUserInput identifies one account to suspend.",
|
|
252
|
+
"properties": {
|
|
253
|
+
"userKey": {
|
|
254
|
+
"description": "UserKey is the account's primary email address, an alias address, or its numeric unique user ID.",
|
|
255
|
+
"type": "string"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"required": [
|
|
259
|
+
"userKey"
|
|
260
|
+
],
|
|
261
|
+
"type": "object"
|
|
262
|
+
}
|
|
156
263
|
},
|
|
157
264
|
{
|
|
158
265
|
"name": "newUnsuspendUserStep",
|
|
159
266
|
"kind": "mutation",
|
|
160
267
|
"operationId": "unsuspendUser",
|
|
268
|
+
"inputType": "UnsuspendUserInput",
|
|
269
|
+
"description": "Restore sign-in for one suspended account; restoring an active account changes nothing.",
|
|
161
270
|
"fields": {
|
|
162
271
|
"stepType": "stepType",
|
|
163
272
|
"annotations": "annotations",
|
|
@@ -190,12 +299,28 @@
|
|
|
190
299
|
"field": "defect",
|
|
191
300
|
"optional": true
|
|
192
301
|
}
|
|
193
|
-
]
|
|
302
|
+
],
|
|
303
|
+
"inputSchema": {
|
|
304
|
+
"additionalProperties": false,
|
|
305
|
+
"description": "UnsuspendUserInput identifies one account whose sign-in to restore.",
|
|
306
|
+
"properties": {
|
|
307
|
+
"userKey": {
|
|
308
|
+
"description": "UserKey is the account's primary email address, an alias address, or its numeric unique user ID.",
|
|
309
|
+
"type": "string"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"required": [
|
|
313
|
+
"userKey"
|
|
314
|
+
],
|
|
315
|
+
"type": "object"
|
|
316
|
+
}
|
|
194
317
|
},
|
|
195
318
|
{
|
|
196
319
|
"name": "newAddUserToGroupStep",
|
|
197
320
|
"kind": "mutation",
|
|
198
321
|
"operationId": "addUserToGroup",
|
|
322
|
+
"inputType": "AddUserToGroupInput",
|
|
323
|
+
"description": "Add one account to a group with a role; an existing membership is read back and returned instead of failing.",
|
|
199
324
|
"fields": {
|
|
200
325
|
"stepType": "stepType",
|
|
201
326
|
"annotations": "annotations",
|
|
@@ -228,12 +353,42 @@
|
|
|
228
353
|
"field": "defect",
|
|
229
354
|
"optional": true
|
|
230
355
|
}
|
|
231
|
-
]
|
|
356
|
+
],
|
|
357
|
+
"inputSchema": {
|
|
358
|
+
"additionalProperties": false,
|
|
359
|
+
"description": "AddUserToGroupInput adds one account to one group.",
|
|
360
|
+
"properties": {
|
|
361
|
+
"groupKey": {
|
|
362
|
+
"description": "GroupKey is the group's email address, an alias, or its unique group ID.",
|
|
363
|
+
"type": "string"
|
|
364
|
+
},
|
|
365
|
+
"memberEmail": {
|
|
366
|
+
"description": "MemberEmail is the account's primary or alias email address.",
|
|
367
|
+
"type": "string"
|
|
368
|
+
},
|
|
369
|
+
"role": {
|
|
370
|
+
"description": "Role is MEMBER, MANAGER, or OWNER; blank adds the account as MEMBER.",
|
|
371
|
+
"enum": [
|
|
372
|
+
"MANAGER",
|
|
373
|
+
"MEMBER",
|
|
374
|
+
"OWNER"
|
|
375
|
+
],
|
|
376
|
+
"type": "string"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"required": [
|
|
380
|
+
"groupKey",
|
|
381
|
+
"memberEmail"
|
|
382
|
+
],
|
|
383
|
+
"type": "object"
|
|
384
|
+
}
|
|
232
385
|
},
|
|
233
386
|
{
|
|
234
387
|
"name": "newRemoveUserFromGroupStep",
|
|
235
388
|
"kind": "mutation",
|
|
236
389
|
"operationId": "removeUserFromGroup",
|
|
390
|
+
"inputType": "RemoveUserFromGroupInput",
|
|
391
|
+
"description": "Remove one account's direct membership from a group; a membership that is already gone is reported as removed.",
|
|
237
392
|
"fields": {
|
|
238
393
|
"stepType": "stepType",
|
|
239
394
|
"annotations": "annotations",
|
|
@@ -266,7 +421,26 @@
|
|
|
266
421
|
"field": "defect",
|
|
267
422
|
"optional": true
|
|
268
423
|
}
|
|
269
|
-
]
|
|
424
|
+
],
|
|
425
|
+
"inputSchema": {
|
|
426
|
+
"additionalProperties": false,
|
|
427
|
+
"description": "RemoveUserFromGroupInput removes one account's direct membership from one group.",
|
|
428
|
+
"properties": {
|
|
429
|
+
"groupKey": {
|
|
430
|
+
"description": "GroupKey is the group's email address, an alias, or its unique group ID.",
|
|
431
|
+
"type": "string"
|
|
432
|
+
},
|
|
433
|
+
"memberKey": {
|
|
434
|
+
"description": "MemberKey is the account's primary or alias email address or its numeric unique user ID.",
|
|
435
|
+
"type": "string"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"required": [
|
|
439
|
+
"groupKey",
|
|
440
|
+
"memberKey"
|
|
441
|
+
],
|
|
442
|
+
"type": "object"
|
|
443
|
+
}
|
|
270
444
|
}
|
|
271
445
|
]
|
|
272
446
|
}
|
|
@@ -6,71 +6,85 @@ var ConfigSchema = z.object({
|
|
|
6
6
|
"maxResponseBytes": z.number().int().optional(),
|
|
7
7
|
"listUsersPageSize": z.number().int().optional()
|
|
8
8
|
});
|
|
9
|
+
var CredentialMaterialError = class extends TypeError {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "CredentialMaterialError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
|
|
16
|
+
"project credential decoding failed",
|
|
17
|
+
"shared project credential decoding failed",
|
|
18
|
+
"project credential decoding failed: this connector version does not support shared credentials"
|
|
19
|
+
]);
|
|
20
|
+
function isCredentialMaterialError(error) {
|
|
21
|
+
return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
|
|
22
|
+
}
|
|
9
23
|
function decodeCredentials(value) {
|
|
10
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new
|
|
24
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
11
25
|
const fields = value;
|
|
12
26
|
const allowed = /* @__PURE__ */ new Set(["auth_method", "access_token", "delegated_user", "oauth_client_id", "oauth_client_secret", "refresh_token", "service_account_key"]);
|
|
13
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new
|
|
14
|
-
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new
|
|
15
|
-
if (fields["delegated_user"] != null && !(typeof fields["delegated_user"] === "string")) throw new
|
|
16
|
-
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new
|
|
17
|
-
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new
|
|
18
|
-
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new
|
|
19
|
-
if (fields["service_account_key"] != null && !(typeof fields["service_account_key"] === "string")) throw new
|
|
27
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
28
|
+
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
|
|
29
|
+
if (fields["delegated_user"] != null && !(typeof fields["delegated_user"] === "string")) throw new CredentialMaterialError("credential delegated_user has an invalid type");
|
|
30
|
+
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
|
|
31
|
+
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
|
|
32
|
+
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
|
|
33
|
+
if (fields["service_account_key"] != null && !(typeof fields["service_account_key"] === "string")) throw new CredentialMaterialError("credential service_account_key has an invalid type");
|
|
20
34
|
const selectedMethod = fields["auth_method"] ?? "";
|
|
21
|
-
if (typeof selectedMethod !== "string") throw new
|
|
35
|
+
if (typeof selectedMethod !== "string") throw new CredentialMaterialError("credential auth_method is invalid");
|
|
22
36
|
const method = selectedMethod || "workspace-domain-delegation";
|
|
23
37
|
const credentials = { authMethodId: method };
|
|
24
38
|
if (method === "workspace-domain-delegation") {
|
|
25
|
-
if (!fields["service_account_key"]) throw new
|
|
39
|
+
if (!fields["service_account_key"]) throw new CredentialMaterialError("credential service_account_key is required");
|
|
26
40
|
if (fields["service_account_key"]) credentials.serviceAccountKey = new SecretString(fields["service_account_key"]);
|
|
27
|
-
if (!fields["delegated_user"]) throw new
|
|
41
|
+
if (!fields["delegated_user"]) throw new CredentialMaterialError("credential delegated_user is required");
|
|
28
42
|
if (fields["delegated_user"]) credentials.delegatedUser = fields["delegated_user"];
|
|
29
43
|
credentials.accessToken = new SecretString(fields["access_token"] ?? "");
|
|
30
44
|
} else if (method === "google-oauth") {
|
|
31
|
-
if (!fields["oauth_client_id"]) throw new
|
|
45
|
+
if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
|
|
32
46
|
if (fields["oauth_client_id"]) credentials.oauthClientId = fields["oauth_client_id"];
|
|
33
|
-
if (!fields["oauth_client_secret"]) throw new
|
|
47
|
+
if (!fields["oauth_client_secret"]) throw new CredentialMaterialError("credential oauth_client_secret is required");
|
|
34
48
|
if (fields["oauth_client_secret"]) credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"]);
|
|
35
|
-
if (!fields["access_token"]) throw new
|
|
49
|
+
if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
|
|
36
50
|
if (fields["access_token"]) credentials.accessToken = new SecretString(fields["access_token"]);
|
|
37
|
-
if (!fields["refresh_token"]) throw new
|
|
51
|
+
if (!fields["refresh_token"]) throw new CredentialMaterialError("credential refresh_token is required");
|
|
38
52
|
if (fields["refresh_token"]) credentials.refreshToken = new SecretString(fields["refresh_token"]);
|
|
39
53
|
} else {
|
|
40
|
-
throw new
|
|
54
|
+
throw new CredentialMaterialError("credential auth_method is invalid");
|
|
41
55
|
}
|
|
42
56
|
return credentials;
|
|
43
57
|
}
|
|
44
58
|
function decodeSharedCredentials(value) {
|
|
45
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new
|
|
59
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
|
|
46
60
|
const fields = value;
|
|
47
61
|
const allowed = /* @__PURE__ */ new Set(["auth_method", "access_token", "delegated_user", "oauth_client_id", "oauth_client_secret", "refresh_token", "service_account_key"]);
|
|
48
|
-
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new
|
|
49
|
-
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new
|
|
50
|
-
if (fields["delegated_user"] != null && !(typeof fields["delegated_user"] === "string")) throw new
|
|
51
|
-
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new
|
|
52
|
-
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new
|
|
53
|
-
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new
|
|
54
|
-
if (fields["service_account_key"] != null && !(typeof fields["service_account_key"] === "string")) throw new
|
|
62
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
|
|
63
|
+
if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new CredentialMaterialError("credential access_token has an invalid type");
|
|
64
|
+
if (fields["delegated_user"] != null && !(typeof fields["delegated_user"] === "string")) throw new CredentialMaterialError("credential delegated_user has an invalid type");
|
|
65
|
+
if (fields["oauth_client_id"] != null && !(typeof fields["oauth_client_id"] === "string")) throw new CredentialMaterialError("credential oauth_client_id has an invalid type");
|
|
66
|
+
if (fields["oauth_client_secret"] != null && !(typeof fields["oauth_client_secret"] === "string")) throw new CredentialMaterialError("credential oauth_client_secret has an invalid type");
|
|
67
|
+
if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new CredentialMaterialError("credential refresh_token has an invalid type");
|
|
68
|
+
if (fields["service_account_key"] != null && !(typeof fields["service_account_key"] === "string")) throw new CredentialMaterialError("credential service_account_key has an invalid type");
|
|
55
69
|
const selectedMethod = fields["auth_method"] ?? "";
|
|
56
|
-
if (typeof selectedMethod !== "string") throw new
|
|
70
|
+
if (typeof selectedMethod !== "string") throw new CredentialMaterialError("credential auth_method is invalid");
|
|
57
71
|
const method = selectedMethod || "workspace-domain-delegation";
|
|
58
72
|
const credentials = { authMethodId: method };
|
|
59
73
|
if (method === "workspace-domain-delegation") {
|
|
60
74
|
if (fields["service_account_key"]) credentials.serviceAccountKey = new SecretString(fields["service_account_key"]);
|
|
61
|
-
if (!fields["delegated_user"]) throw new
|
|
75
|
+
if (!fields["delegated_user"]) throw new CredentialMaterialError("credential delegated_user is required");
|
|
62
76
|
if (fields["delegated_user"]) credentials.delegatedUser = fields["delegated_user"];
|
|
63
|
-
if (!fields["access_token"]) throw new
|
|
77
|
+
if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
|
|
64
78
|
credentials.accessToken = new SecretString(fields["access_token"] ?? "");
|
|
65
79
|
} else if (method === "google-oauth") {
|
|
66
|
-
if (!fields["oauth_client_id"]) throw new
|
|
80
|
+
if (!fields["oauth_client_id"]) throw new CredentialMaterialError("credential oauth_client_id is required");
|
|
67
81
|
if (fields["oauth_client_id"]) credentials.oauthClientId = fields["oauth_client_id"];
|
|
68
82
|
if (fields["oauth_client_secret"]) credentials.oauthClientSecret = new SecretString(fields["oauth_client_secret"]);
|
|
69
|
-
if (!fields["access_token"]) throw new
|
|
83
|
+
if (!fields["access_token"]) throw new CredentialMaterialError("credential access_token is required");
|
|
70
84
|
if (fields["access_token"]) credentials.accessToken = new SecretString(fields["access_token"]);
|
|
71
85
|
if (fields["refresh_token"]) credentials.refreshToken = new SecretString(fields["refresh_token"]);
|
|
72
86
|
} else {
|
|
73
|
-
throw new
|
|
87
|
+
throw new CredentialMaterialError("credential auth_method is invalid");
|
|
74
88
|
}
|
|
75
89
|
return credentials;
|
|
76
90
|
}
|
|
@@ -365,6 +379,8 @@ var ConnectionNameProvider = "google";
|
|
|
365
379
|
|
|
366
380
|
export {
|
|
367
381
|
ConfigSchema,
|
|
382
|
+
CredentialMaterialError,
|
|
383
|
+
isCredentialMaterialError,
|
|
368
384
|
decodeCredentials,
|
|
369
385
|
decodeSharedCredentials,
|
|
370
386
|
GetUserInputSchema,
|
|
@@ -7,7 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
interface Config {
|
|
8
8
|
/** Google API root URL to which the connector appends /admin/directory/v1; leave blank for Google's public Admin SDK host. Enter an absolute HTTPS URL only for an explicitly supported compatible gateway. */
|
|
9
9
|
endpoint?: string;
|
|
10
|
-
/** Maximum complete Admin SDK Directory API response in bytes; enter a positive integer only to change the safety limit, for example when listUsers pages of up to 500 accounts are larger. Blank keeps the limit
|
|
10
|
+
/** Maximum complete Admin SDK Directory API response in bytes; enter a positive integer only to change the safety limit, for example when listUsers pages of up to 500 accounts are larger. Blank keeps the limit; an oversized response selects invalidResponse on a read and retries a write. */
|
|
11
11
|
maxResponseBytes?: number;
|
|
12
12
|
/** Number of accounts listUsers requests per page when the Step input leaves pageSize at zero; enter a whole number from 1 to 500, Google's maximum, only to trade smaller, faster pages for fewer requests. Blank uses the displayed default. */
|
|
13
13
|
listUsersPageSize?: number;
|
|
@@ -35,6 +35,12 @@ interface Credentials {
|
|
|
35
35
|
/** Secret service-account JSON key downloaded from https://console.cloud.google.com/iam-admin/serviceaccounts after selecting the account > Keys > Add key > Create new key > JSON; paste the complete document, which Dex keeps only in the credential store, and blank means delegated token minting cannot start. */
|
|
36
36
|
serviceAccountKey?: SecretString;
|
|
37
37
|
}
|
|
38
|
+
/** Stored credential material that fails the connector credential checks, so no retry can succeed. */
|
|
39
|
+
declare class CredentialMaterialError extends TypeError {
|
|
40
|
+
constructor(message: string);
|
|
41
|
+
}
|
|
42
|
+
/** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
|
|
43
|
+
declare function isCredentialMaterialError(error: unknown): boolean;
|
|
38
44
|
/** Decode private credential fields for the selected authorization method. */
|
|
39
45
|
declare function decodeCredentials(value: unknown): Credentials;
|
|
40
46
|
/** Decode shared credential fields for the selected authorization method. */
|
|
@@ -389,4 +395,4 @@ declare function newProjectCredentialProvider<Credentials>(project: LoadedProjec
|
|
|
389
395
|
/** Provider expected by named connections. */
|
|
390
396
|
declare const ConnectionNameProvider = "google";
|
|
391
397
|
|
|
392
|
-
export { type AddUserToGroupInput as A,
|
|
398
|
+
export { type AddUserToGroupInput as A, UserNameSchema as B, Connection as C, UserSchema as D, decodeCredentials as E, decodeSharedCredentials as F, type GetUserInput as G, isCredentialMaterialError as H, newConnection as I, newConnectionWithOperations as J, newProjectCredentialProvider as K, type ListUsersInput as L, type Operations as O, type RemoveUserFromGroupInput as R, type SuspendUserInput as S, type User as U, type AddUserToGroupOutput as a, type CreateUserInput as b, type CreateUserOutput as c, type ListUsersOutput as d, type RemoveUserFromGroupOutput as e, type UnsuspendUserInput as f, type Config as g, type CredentialSource as h, AddUserToGroupInputSchema as i, AddUserToGroupOutputSchema as j, ConfigSchema as k, ConnectionNameProvider as l, CreateUserInputSchema as m, CreateUserOutputSchema as n, CredentialMaterialError as o, type Credentials as p, GetUserInputSchema as q, type GroupMembership as r, GroupMembershipSchema as s, ListUsersInputSchema as t, ListUsersOutputSchema as u, RemoveUserFromGroupInputSchema as v, RemoveUserFromGroupOutputSchema as w, SuspendUserInputSchema as x, UnsuspendUserInputSchema as y, type UserName as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AddUserToGroupInput, a as AddUserToGroupOutput, C as Connection, b as CreateUserInput, c as CreateUserOutput, G as GetUserInput, U as User, L as ListUsersInput, d as ListUsersOutput, R as RemoveUserFromGroupInput, e as RemoveUserFromGroupOutput, S as SuspendUserInput, f as UnsuspendUserInput, g as Config, h as CredentialSource, O as Operations } from './connection-
|
|
2
|
-
export { i as AddUserToGroupInputSchema, j as AddUserToGroupOutputSchema, k as ConfigSchema, l as ConnectionNameProvider, m as CreateUserInputSchema, n as CreateUserOutputSchema, o as
|
|
1
|
+
import { A as AddUserToGroupInput, a as AddUserToGroupOutput, C as Connection, b as CreateUserInput, c as CreateUserOutput, G as GetUserInput, U as User, L as ListUsersInput, d as ListUsersOutput, R as RemoveUserFromGroupInput, e as RemoveUserFromGroupOutput, S as SuspendUserInput, f as UnsuspendUserInput, g as Config, h as CredentialSource, O as Operations } from './connection-PAXI58T7.js';
|
|
2
|
+
export { i as AddUserToGroupInputSchema, j as AddUserToGroupOutputSchema, k as ConfigSchema, l as ConnectionNameProvider, m as CreateUserInputSchema, n as CreateUserOutputSchema, o as CredentialMaterialError, p as Credentials, q as GetUserInputSchema, r as GroupMembership, s as GroupMembershipSchema, t as ListUsersInputSchema, u as ListUsersOutputSchema, v as RemoveUserFromGroupInputSchema, w as RemoveUserFromGroupOutputSchema, x as SuspendUserInputSchema, y as UnsuspendUserInputSchema, z as UserName, B as UserNameSchema, D as UserSchema, E as decodeCredentials, F as decodeSharedCredentials, H as isCredentialMaterialError, I as newConnection, J as newConnectionWithOperations, K as newProjectCredentialProvider } from './connection-PAXI58T7.js';
|
|
3
3
|
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
4
|
import { MutationDefinition, QueryDefinition, MutationStepConfig, Mutation, MutationResult, QueryStepConfig, Query, QueryResult, MutationStep, QueryStep, Call, QueryAttempt, MutationAttempt, ReceiptDraft, Failure } from '@superdurable/connectors-sdk';
|
|
5
5
|
import { StepTarget } from '@superdurable/dex';
|
|
@@ -361,6 +361,8 @@ declare class CreateUserOperation implements Mutation<CreateUserInput, CreateUse
|
|
|
361
361
|
/** Use a declared provisioning key or the Call ID. */ idempotencyKey(callId: string, input: CreateUserInput): string;
|
|
362
362
|
/** Insert and converge by reading the account after a conflict. */
|
|
363
363
|
invoke(call: Call, input: CreateUserInput): Promise<MutationAttempt<CreateUserOutput>>;
|
|
364
|
+
/** Read the address back, because an earlier attempt may have created the account. */
|
|
365
|
+
private confirmRefusal;
|
|
364
366
|
}
|
|
365
367
|
/** Set the suspended flag to true. */
|
|
366
368
|
declare class SuspendUserOperation implements Mutation<SuspendUserInput, User> {
|
|
@@ -447,6 +449,11 @@ declare class WorkspaceAdminClient {
|
|
|
447
449
|
receipt(call: Call, response?: ProviderResponse, objectId?: string): ReceiptDraft;
|
|
448
450
|
/** Resolve a token through the generated refresh declaration. */
|
|
449
451
|
resolveAccessToken(call: Call): Promise<string | undefined>;
|
|
452
|
+
/** Resolve a token and report whether a failure is transient rather than needing reconnection. */
|
|
453
|
+
resolveAccessTokenResult(call: Call): Promise<{
|
|
454
|
+
token?: string;
|
|
455
|
+
isTransient: boolean;
|
|
456
|
+
}>;
|
|
450
457
|
/** Send one Directory request, including a single refresh after HTTP 401. */
|
|
451
458
|
exchange(call: Call, operation: string, method: string, path: string, query?: Record<string, string>, payload?: unknown): Promise<DirectoryExchange>;
|
|
452
459
|
private outcome;
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
CreateUserInputSchema,
|
|
24
24
|
CreateUserMetadata,
|
|
25
25
|
CreateUserOutputSchema,
|
|
26
|
+
CredentialMaterialError,
|
|
26
27
|
GetUserBranch,
|
|
27
28
|
GetUserBranchDefect,
|
|
28
29
|
GetUserBranchFound,
|
|
@@ -75,11 +76,12 @@ import {
|
|
|
75
76
|
UserSchema,
|
|
76
77
|
decodeCredentials,
|
|
77
78
|
decodeSharedCredentials,
|
|
79
|
+
isCredentialMaterialError,
|
|
78
80
|
newConnection,
|
|
79
81
|
newConnectionWithOperations,
|
|
80
82
|
newProjectConnection,
|
|
81
83
|
newProjectCredentialProvider
|
|
82
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-JZYIW6P3.js";
|
|
83
85
|
|
|
84
86
|
// src/generated/steps.ts
|
|
85
87
|
import { goToBranch, newMutationStep, newQueryStep } from "@superdurable/connectors-sdk";
|
|
@@ -163,7 +165,8 @@ function newRemoveUserFromGroupStep(configuration) {
|
|
|
163
165
|
// src/client.ts
|
|
164
166
|
import { BodyTooLargeError, parseRetryAfter, sendProviderRequest, validateBaseURL } from "@superdurable/connectors-sdk/providerhttp";
|
|
165
167
|
import { ManifestCredentialRefreshDriver } from "@superdurable/connectors-sdk/oauthtoken";
|
|
166
|
-
import { resolveCredential, resolveCredentialAfterRejection } from "@superdurable/connectors-sdk";
|
|
168
|
+
import { ReauthorizationRequiredError, resolveCredential, resolveCredentialAfterRejection } from "@superdurable/connectors-sdk";
|
|
169
|
+
import { ConnectionNotSelectedError, CredentialBrokerRejectedError, ObjectNotFoundError } from "@superdurable/connectors-sdk/projectconfig";
|
|
167
170
|
|
|
168
171
|
// src/generated/refresh.ts
|
|
169
172
|
var Authorization = {
|
|
@@ -274,7 +277,8 @@ var Authorization = {
|
|
|
274
277
|
"invalid_grant",
|
|
275
278
|
"invalid_client",
|
|
276
279
|
"unauthorized_client"
|
|
277
|
-
]
|
|
280
|
+
],
|
|
281
|
+
"tokenExchangeTimeout": "25s"
|
|
278
282
|
},
|
|
279
283
|
"scopes": [
|
|
280
284
|
"https://www.googleapis.com/auth/admin.directory.user",
|
|
@@ -408,20 +412,36 @@ var CreateUserOperation = class {
|
|
|
408
412
|
if (hasCreationKey(resource, creationKey)) return newMutationBranch("created", { user, wasAlreadyCreated: true }, receipt);
|
|
409
413
|
return newMutationBranch("alreadyExists", { user, wasAlreadyCreated: false }, receipt, failure("createUser", "CONFLICT", "address belongs to an account this Step did not create"));
|
|
410
414
|
} catch {
|
|
411
|
-
return
|
|
415
|
+
return newMutationRetry(failure("createUser", "PROTOCOL", "provider returned an invalid account: account is invalid"));
|
|
412
416
|
}
|
|
413
417
|
}
|
|
414
418
|
if (read.outcome.kind === "notFound") {
|
|
415
419
|
const firstAttemptAt = call.context.firstAttemptAt;
|
|
416
|
-
if (firstAttemptAt && this.client.now().getTime() - new Date(firstAttemptAt).getTime() < 6e4) return newMutationRetry(failure("createUser", "AVAILABILITY", "Google reports the address as taken but does not return the account yet"));
|
|
420
|
+
if (hasPossibleEarlierAttempt(call) || firstAttemptAt && this.client.now().getTime() - new Date(firstAttemptAt).getTime() < 6e4) return newMutationRetry(failure("createUser", "AVAILABILITY", "Google reports the address as taken but does not return the account yet"));
|
|
417
421
|
return mutationFailure("createUser", "alreadyExists", "CONFLICT", zeroCreate, read.outcome.receipt, "address belongs to a group or an account outside the directory");
|
|
418
422
|
}
|
|
419
423
|
return mutationOutcome(read.outcome, zeroCreate, "providerRejected");
|
|
420
424
|
}
|
|
421
425
|
if (exchange.outcome.kind === "invalidResponse") return newMutationRetry(failure("createUser", exchange.outcome.failure.kind, "insert response is unusable; the retry reads the account back"));
|
|
422
|
-
|
|
426
|
+
const refusal = mutationOutcome(exchange.outcome, zeroCreate, "providerRejected");
|
|
427
|
+
if ((exchange.outcome.kind === "notFound" || exchange.outcome.kind === "rejected") && hasPossibleEarlierAttempt(call)) return this.confirmRefusal(call, email, creationKey, refusal);
|
|
428
|
+
return refusal;
|
|
429
|
+
}
|
|
430
|
+
/** Read the address back, because an earlier attempt may have created the account. */
|
|
431
|
+
async confirmRefusal(call, email, creationKey, refusal) {
|
|
432
|
+
const read = await this.client.exchange(call, "createUser", "GET", userPath(email));
|
|
433
|
+
if (!("response" in read)) return read.outcome.kind === "notFound" ? refusal : mutationOutcome(read.outcome, zeroCreate, "providerRejected");
|
|
434
|
+
try {
|
|
435
|
+
const { user, resource } = decodeUser(read.response.body);
|
|
436
|
+
return hasCreationKey(resource, creationKey) ? newMutationBranch("created", { user, wasAlreadyCreated: true }, this.client.receipt(call, read.response, user.id)) : refusal;
|
|
437
|
+
} catch {
|
|
438
|
+
return newMutationRetry(failure("createUser", "PROTOCOL", "provider returned an invalid account: account is invalid"));
|
|
439
|
+
}
|
|
423
440
|
}
|
|
424
441
|
};
|
|
442
|
+
function hasPossibleEarlierAttempt(call) {
|
|
443
|
+
return (call.context?.attempt ?? 1) > 1;
|
|
444
|
+
}
|
|
425
445
|
var SuspendUserOperation = class {
|
|
426
446
|
/** Bind a client. */
|
|
427
447
|
constructor(client) {
|
|
@@ -473,10 +493,10 @@ async function setSuspension(client, call, rawKey, suspended) {
|
|
|
473
493
|
try {
|
|
474
494
|
const { user } = decodeUser(exchange.response.body);
|
|
475
495
|
const receipt = client.receipt(call, exchange.response, user.id);
|
|
476
|
-
if (user.isSuspended !== suspended) return
|
|
496
|
+
if (user.isSuspended !== suspended) return newMutationRetry(failure(operation, "PROTOCOL", "Google returned the account without the requested suspension state"));
|
|
477
497
|
return newMutationBranch(suspended ? "suspended" : "unsuspended", user, receipt);
|
|
478
498
|
} catch {
|
|
479
|
-
return
|
|
499
|
+
return newMutationRetry(failure(operation, "PROTOCOL", "provider returned an invalid account: account is invalid"));
|
|
480
500
|
}
|
|
481
501
|
}
|
|
482
502
|
var AddUserToGroupOperation = class {
|
|
@@ -520,7 +540,7 @@ var AddUserToGroupOperation = class {
|
|
|
520
540
|
const membership = decodeMembership(read.response.body, groupKey);
|
|
521
541
|
return newMutationBranch("added", { membership, wasAlreadyMember: true }, this.client.receipt(call, read.response, membership.memberId));
|
|
522
542
|
} catch {
|
|
523
|
-
return
|
|
543
|
+
return newMutationRetry(failure("addUserToGroup", "PROTOCOL", "provider returned an invalid membership: membership is invalid"));
|
|
524
544
|
}
|
|
525
545
|
}
|
|
526
546
|
if (read.outcome.kind === "notFound") return newMutationRetry(failure("addUserToGroup", "AVAILABILITY", "Google reports the membership as existing but does not return it yet"));
|
|
@@ -570,7 +590,7 @@ function queryOutcome(outcome, zero, notFoundBranch = "providerRejected") {
|
|
|
570
590
|
return newQueryBranch(outcome.kind === "notFound" ? notFoundBranch : outcome.kind === "conflict" || outcome.kind === "rejected" ? "providerRejected" : outcome.kind, zero, outcome.receipt, outcome.failure);
|
|
571
591
|
}
|
|
572
592
|
function mutationOutcome(outcome, zero, rejectedBranch, notFoundBranch = rejectedBranch) {
|
|
573
|
-
if (outcome.kind === "retry") return newMutationRetry(outcome.failure, outcome.retryAfterMs);
|
|
593
|
+
if (outcome.kind === "retry" || outcome.kind === "invalidResponse") return newMutationRetry(outcome.failure, outcome.retryAfterMs);
|
|
574
594
|
return newMutationBranch(outcome.kind === "notFound" ? notFoundBranch : outcome.kind === "conflict" || outcome.kind === "rejected" ? rejectedBranch : outcome.kind, zero, outcome.receipt, outcome.failure);
|
|
575
595
|
}
|
|
576
596
|
function failure(operation, kind, message) {
|
|
@@ -810,18 +830,25 @@ var WorkspaceAdminClient = class {
|
|
|
810
830
|
}
|
|
811
831
|
/** Resolve a token through the generated refresh declaration. */
|
|
812
832
|
async resolveAccessToken(call) {
|
|
833
|
+
return (await this.resolveAccessTokenResult(call)).token;
|
|
834
|
+
}
|
|
835
|
+
/** Resolve a token and report whether a failure is transient rather than needing reconnection. */
|
|
836
|
+
async resolveAccessTokenResult(call) {
|
|
837
|
+
let credential;
|
|
813
838
|
try {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
return isHeaderSafeToken(token) ? token : void 0;
|
|
818
|
-
} catch {
|
|
819
|
-
return void 0;
|
|
839
|
+
credential = await resolveCredential(this.credentials, call, this.refreshDriver, call.context.cancellationSignal);
|
|
840
|
+
} catch (error) {
|
|
841
|
+
return { isTransient: !isTerminalCredentialError(error) };
|
|
820
842
|
}
|
|
843
|
+
if (credential.authMethodId && !["workspace-domain-delegation", "google-oauth"].includes(credential.authMethodId)) return { isTransient: false };
|
|
844
|
+
const token = credential.accessToken?.reveal() ?? "";
|
|
845
|
+
return isHeaderSafeToken(token) ? { token, isTransient: false } : { isTransient: false };
|
|
821
846
|
}
|
|
822
847
|
/** Send one Directory request, including a single refresh after HTTP 401. */
|
|
823
848
|
async exchange(call, operation, method, path, query, payload) {
|
|
824
|
-
|
|
849
|
+
const resolved = await this.resolveAccessTokenResult(call);
|
|
850
|
+
if (resolved.isTransient) return { outcome: this.outcome("retry", operation, "AUTHENTICATION", "connection credentials are temporarily unavailable") };
|
|
851
|
+
let token = resolved.token;
|
|
825
852
|
if (!token) return { outcome: this.outcome("defect", operation, "AUTHENTICATION", "connection credentials are unavailable") };
|
|
826
853
|
let body;
|
|
827
854
|
try {
|
|
@@ -847,6 +874,7 @@ var WorkspaceAdminClient = class {
|
|
|
847
874
|
if (error instanceof BodyTooLargeError && error.status !== void 0 && error.headers !== void 0) {
|
|
848
875
|
response = { status: error.status, headers: error.headers, body: new Uint8Array() };
|
|
849
876
|
if (response.status >= 200 && response.status < 300) return { outcome: this.outcome("invalidResponse", operation, "RESPONSE_TOO_LARGE", "provider response exceeds the configured limit", this.receipt(call, response)) };
|
|
877
|
+
return { outcome: this.outcome("retry", operation, "TRANSPORT", "provider error response exceeds the configured limit", this.receipt(call, response)) };
|
|
850
878
|
} else {
|
|
851
879
|
return { outcome: this.outcome("retry", operation, "TRANSPORT", "provider is unavailable") };
|
|
852
880
|
}
|
|
@@ -874,7 +902,8 @@ var WorkspaceAdminClient = class {
|
|
|
874
902
|
if (response.status === 408 || response.status >= 500) return { outcome: this.outcome("retry", operation, "AVAILABILITY", "provider is temporarily unavailable" + suffix, receipt, retryDelay(response, this.now())) };
|
|
875
903
|
if (response.status === 404) return { outcome: this.outcome("notFound", operation, "NOT_FOUND", "resource was not found", receipt) };
|
|
876
904
|
if (response.status === 409) return { outcome: this.outcome("conflict", operation, "CONFLICT", "provider reported a conflicting resource" + suffix, receipt) };
|
|
877
|
-
|
|
905
|
+
if (!definiteRefusalStatuses.has(response.status)) return { outcome: this.outcome("retry", operation, "AVAILABILITY", `provider answered HTTP ${response.status}, which leaves the outcome unknown${suffix}`, receipt, retryDelay(response, this.now())) };
|
|
906
|
+
const kind = response.status === 400 ? "VALIDATION" : response.status === 401 ? "AUTHENTICATION" : response.status === 403 ? "AUTHORIZATION" : "PROVIDER_REJECTION";
|
|
878
907
|
return { outcome: this.outcome("rejected", operation, kind, `provider rejected the request with HTTP ${response.status}${suffix}`, receipt) };
|
|
879
908
|
}
|
|
880
909
|
return { outcome: this.outcome("defect", operation, "LOCAL_DEFECT", "authenticated request retry was exhausted") };
|
|
@@ -885,6 +914,10 @@ var WorkspaceAdminClient = class {
|
|
|
885
914
|
};
|
|
886
915
|
var retryableForbiddenReasons = /* @__PURE__ */ new Set(["userRateLimitExceeded", "rateLimitExceeded", "quotaExceeded"]);
|
|
887
916
|
var reportableReasons = /* @__PURE__ */ new Set(["badRequest", "invalid", "required", "notFound", "duplicate", "conflict", "conditionNotMet", "failedPrecondition", "forbidden", "insufficientPermissions", "authError", "limitExceeded", "backendError", "userRateLimitExceeded", "rateLimitExceeded", "quotaExceeded"]);
|
|
917
|
+
var definiteRefusalStatuses = /* @__PURE__ */ new Set([400, 401, 403, 411, 413, 414, 415, 422]);
|
|
918
|
+
function isTerminalCredentialError(error) {
|
|
919
|
+
return error instanceof ReauthorizationRequiredError || error instanceof ObjectNotFoundError || error instanceof ConnectionNotSelectedError || error instanceof CredentialBrokerRejectedError || isCredentialMaterialError(error);
|
|
920
|
+
}
|
|
888
921
|
function isHeaderSafeToken(token) {
|
|
889
922
|
return token !== "" && ![...token].some((character) => character.charCodeAt(0) < 33 || character.charCodeAt(0) > 126);
|
|
890
923
|
}
|
|
@@ -977,6 +1010,7 @@ export {
|
|
|
977
1010
|
CreateUserMetadata,
|
|
978
1011
|
CreateUserOperation,
|
|
979
1012
|
CreateUserOutputSchema,
|
|
1013
|
+
CredentialMaterialError,
|
|
980
1014
|
GetUserBranch,
|
|
981
1015
|
GetUserBranchDefect,
|
|
982
1016
|
GetUserBranchFound,
|
|
@@ -1037,6 +1071,7 @@ export {
|
|
|
1037
1071
|
decodeSharedCredentials,
|
|
1038
1072
|
goPathEscape,
|
|
1039
1073
|
goQueryEncode,
|
|
1074
|
+
isCredentialMaterialError,
|
|
1040
1075
|
newAddUserToGroupStep,
|
|
1041
1076
|
newConnection,
|
|
1042
1077
|
newConnectionWithOperations,
|
package/dist/mock.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MockQuery, MockMutation, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
2
|
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
-
import { O as Operations, C as Connection, G as GetUserInput, U as User, L as ListUsersInput, d as ListUsersOutput, b as CreateUserInput, c as CreateUserOutput, S as SuspendUserInput, f as UnsuspendUserInput, A as AddUserToGroupInput, a as AddUserToGroupOutput, R as RemoveUserFromGroupInput, e as RemoveUserFromGroupOutput,
|
|
3
|
+
import { O as Operations, C as Connection, G as GetUserInput, U as User, L as ListUsersInput, d as ListUsersOutput, b as CreateUserInput, c as CreateUserOutput, S as SuspendUserInput, f as UnsuspendUserInput, A as AddUserToGroupInput, a as AddUserToGroupOutput, R as RemoveUserFromGroupInput, e as RemoveUserFromGroupOutput, r as GroupMembership, z as UserName } from './connection-PAXI58T7.js';
|
|
4
4
|
import '@superdurable/connectors-sdk/projectconfig';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
package/dist/mock.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
UserNameSchema,
|
|
24
24
|
UserSchema,
|
|
25
25
|
newConnectionWithOperations
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JZYIW6P3.js";
|
|
27
27
|
|
|
28
28
|
// src/generated/mock.ts
|
|
29
29
|
import { branchCase, retryCase, newMutation, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-google-workspace-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Google Workspace Admin Directory operations for Dex Flows",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"./mock": {
|
|
26
26
|
"types": "./dist/mock.d.ts",
|
|
27
27
|
"import": "./dist/mock.js"
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"./dex-connector.json": "./dex-connector.json"
|
|
29
30
|
},
|
|
30
31
|
"files": [
|
|
31
32
|
"dist",
|