@sylphx/sdk 0.32.0 → 0.32.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.
Files changed (80) hide show
  1. package/README.md +20 -0
  2. package/dist/access.d.ts +34 -0
  3. package/dist/access.js +14 -2
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +1564 -0
  6. package/dist/agents.js +1096 -0
  7. package/dist/agents.js.map +1 -0
  8. package/dist/ai.js +1 -1
  9. package/dist/artifacts.js +1 -1
  10. package/dist/assets.js +1 -1
  11. package/dist/auth/client.js +1 -1
  12. package/dist/auth/end-user-keys-mock.d.ts +83 -0
  13. package/dist/auth/end-user-keys-mock.js +427 -0
  14. package/dist/auth/end-user-keys-mock.js.map +1 -0
  15. package/dist/auth/end-user-keys.d.ts +219 -0
  16. package/dist/auth/end-user-keys.js +240 -0
  17. package/dist/auth/end-user-keys.js.map +1 -0
  18. package/dist/auth/verify.js +1 -1
  19. package/dist/auth.d.ts +201 -2
  20. package/dist/auth.js +148 -2
  21. package/dist/auth.js.map +1 -1
  22. package/dist/billing.d.ts +86 -8
  23. package/dist/billing.js +39 -1
  24. package/dist/billing.js.map +1 -1
  25. package/dist/broker.js +1 -1
  26. package/dist/build.d.ts +361 -28
  27. package/dist/build.js +302 -10
  28. package/dist/build.js.map +1 -1
  29. package/dist/common.js +1 -1
  30. package/dist/config/flags.js +1 -1
  31. package/dist/config.js +1 -1
  32. package/dist/connections.js +1 -1
  33. package/dist/data.d.ts +52 -0
  34. package/dist/data.js +57 -1
  35. package/dist/data.js.map +1 -1
  36. package/dist/entitlement.js +1 -1
  37. package/dist/events/realtime.js +1 -1
  38. package/dist/events/webhooks.js +1 -1
  39. package/dist/events.js +1 -1
  40. package/dist/flags.d.ts +18 -0
  41. package/dist/flags.js +44 -0
  42. package/dist/flags.js.map +1 -0
  43. package/dist/hosting.js +1 -1
  44. package/dist/ids.d.ts +152 -2
  45. package/dist/ids.js +32 -2
  46. package/dist/ids.js.map +1 -1
  47. package/dist/index.d.ts +14 -1
  48. package/dist/index.js +20 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/keys.js +1 -1
  51. package/dist/knowledge.d.ts +1192 -0
  52. package/dist/knowledge.js +1002 -0
  53. package/dist/knowledge.js.map +1 -0
  54. package/dist/localization.js +1 -1
  55. package/dist/methods.js +1563 -40
  56. package/dist/methods.js.map +1 -1
  57. package/dist/money.d.ts +1687 -7
  58. package/dist/money.js +1269 -1
  59. package/dist/money.js.map +1 -1
  60. package/dist/network.js +1 -1
  61. package/dist/notify.d.ts +346 -1
  62. package/dist/notify.js +249 -1
  63. package/dist/notify.js.map +1 -1
  64. package/dist/observability.d.ts +138 -0
  65. package/dist/observability.js +89 -1
  66. package/dist/observability.js.map +1 -1
  67. package/dist/realtime.d.ts +404 -0
  68. package/dist/realtime.js +312 -0
  69. package/dist/realtime.js.map +1 -0
  70. package/dist/release.js +1 -1
  71. package/dist/runners.js +1 -1
  72. package/dist/runtime.js +1 -1
  73. package/dist/sandboxes.js +1 -1
  74. package/dist/secrets.d.ts +336 -0
  75. package/dist/secrets.js +268 -1
  76. package/dist/secrets.js.map +1 -1
  77. package/dist/workflows.d.ts +119 -3
  78. package/dist/workflows.js +144 -4
  79. package/dist/workflows.js.map +1 -1
  80. package/package.json +2 -2
package/dist/auth.d.ts CHANGED
@@ -8,6 +8,18 @@ export interface AcceptInvitationRequest {
8
8
  /** The accepting end user; its verified email must be the invited address. */
9
9
  endUser: string;
10
10
  }
11
+ /** The request of AttachEndUserExternalId. */
12
+ export interface AttachEndUserExternalIdRequest {
13
+ /** The name of the end user. */
14
+ name: string;
15
+ /** The customer's namespace for this id: `^[a-z][a-z0-9_]{0,31}$`. */
16
+ namespace: string;
17
+ /**
18
+ * The id itself, 1 to 128 printable characters, unique in its namespace
19
+ * across the environment's live users.
20
+ */
21
+ externalId: string;
22
+ }
11
23
  /**
12
24
  * An Auth Config is the app scope of Sylphx Auth in one environment: which
13
25
  * sign-in methods the customer's app offers, and its MFA, passkey, lockout,
@@ -64,6 +76,18 @@ export interface AuthConfigSpec {
64
76
  * resource.
65
77
  */
66
78
  socialProviders?: SocialProvider[];
79
+ /**
80
+ * The address pattern of this environment's test accounts (a regular
81
+ * expression over the whole lower-cased address); unset means the
82
+ * environment has none. It must end in `@` and one of the environment's
83
+ * DNS-verified customer-organization domains, escaped
84
+ * (`qa\+[a-z0-9-]{1,40}@example\.com`), and must not match
85
+ * `probe@example.com`; it is stored as `^(?:<local part>)@<domain>$`. An
86
+ * end user is a test account (`synthetic_time`) only when it signed up
87
+ * with a matching address and proved that address by a link or code;
88
+ * changing the pattern never makes an existing end user one.
89
+ */
90
+ testEmailPattern?: string;
67
91
  }
68
92
  /** AuthConfigStatus is the observed state of an AuthConfig. */
69
93
  export interface AuthConfigStatus {
@@ -89,6 +113,16 @@ export interface CreateCustomerOrganizationRequest {
89
113
  customerOrganization: CustomerOrganization;
90
114
  /** Validate and return the result without writing anything. */
91
115
  validateOnly?: boolean;
116
+ /**
117
+ * The organization's first owner, an active end user of the same
118
+ * environment. The organization and its `owner` membership are created in
119
+ * one transaction, and the call honours `Idempotency-Key`: a retry returns
120
+ * the organization the first call created. Naming a person is explicit app
121
+ * authority: the app vouches for its own tenant. Empty creates an
122
+ * organization without members; creating then calling `CreateMembership` is
123
+ * not atomic.
124
+ */
125
+ ownerEndUser?: string;
92
126
  }
93
127
  /** The request of CreateEmailDomain. */
94
128
  export interface CreateEmailDomainRequest {
@@ -327,6 +361,37 @@ export interface EndUser {
327
361
  * locked. Unlock clears it; a suspension is `state`, not a lock.
328
362
  */
329
363
  readonly lockExpireTime?: string;
364
+ /**
365
+ * The customer's own ids for this end user, one per namespace
366
+ * (`game_user`, `steam_id`): how an app that signs users in by its own id
367
+ * finds them again. Read on create; never changed through here, because a
368
+ * set namespace's value is never rewritten — `AttachEndUserExternalId` sets
369
+ * an unset one. At most four namespaces. Never an authorization input:
370
+ * scope checks use grant ids.
371
+ */
372
+ externalIds?: Record<string, string>;
373
+ /**
374
+ * When the end user became a test account: set once, when an end user who
375
+ * signed up with an address matching the Auth config's
376
+ * `test_email_pattern` first proved that address by a link or code. No
377
+ * update, import, address change or sign-in method ever sets it; changing
378
+ * the address clears it. Unset for every other end user.
379
+ */
380
+ readonly syntheticTime?: string;
381
+ }
382
+ /** The request of FindEndUser. */
383
+ export interface FindEndUserRequest {
384
+ /** The environment to look in. */
385
+ parent: string;
386
+ /** The customer's namespace of the id. */
387
+ namespace: string;
388
+ /** The id to find. */
389
+ externalId: string;
390
+ }
391
+ /** The response of FindEndUser. */
392
+ export interface FindEndUserResponse {
393
+ /** The end user holding the id. */
394
+ endUser?: EndUser;
330
395
  }
331
396
  /** The request of GetAuthConfig. */
332
397
  export interface GetAuthConfigRequest {
@@ -348,6 +413,11 @@ export interface GetEndUserRequest {
348
413
  /** The name of the end user to get. */
349
414
  name: string;
350
415
  }
416
+ /** The request of GetIdentity. */
417
+ export interface GetIdentityRequest {
418
+ /** The name of the identity to get. */
419
+ name: string;
420
+ }
351
421
  /** The request of GetInvitation. */
352
422
  export interface GetInvitationRequest {
353
423
  /** The name of the invitation to get. */
@@ -373,6 +443,38 @@ export interface GetSessionRequest {
373
443
  /** The name of the session to get. */
374
444
  name: string;
375
445
  }
446
+ /**
447
+ * An Identity is one way an end user signs in: a password, a verified email, a
448
+ * federated provider account, a device credential (a guest account's secret),
449
+ * or a passkey. An end user always keeps at least one. An identity moves from
450
+ * one end user to another only by `:move`, an operator action; the end user
451
+ * never does it. It shows a fingerprint (a one-way digest), never the secret.
452
+ */
453
+ export interface Identity {
454
+ /** `orgs/{org}/projects/{project}/envs/{env}/end_users/{end_user}/identities/{identity}`. */
455
+ name?: string;
456
+ /** The identity's id; never reused. */
457
+ readonly uid?: string;
458
+ /** Resource metadata. */
459
+ meta?: common.ResourceMeta;
460
+ /** What kind of sign-in this is. */
461
+ readonly type?: IdentityType;
462
+ /**
463
+ * The provider of a federated identity (`google`, `apple`, ...); empty
464
+ * otherwise.
465
+ */
466
+ readonly provider?: string;
467
+ /**
468
+ * A one-way digest of the provider and the provider's subject (or of the
469
+ * device credential's verifier). It identifies the identity in an audit
470
+ * trail and reveals neither.
471
+ */
472
+ readonly fingerprint?: string;
473
+ /** When the identity was linked. */
474
+ readonly linkTime?: string;
475
+ /** The last sign-in with this identity, when known. */
476
+ readonly lastUseTime?: string;
477
+ }
376
478
  /**
377
479
  * An Invitation asks one email address to join a customer organization with
378
480
  * roles. It is single-use and expires; accepting needs an end user whose
@@ -462,6 +564,26 @@ export interface ListEndUsersResponse {
462
564
  /** The token of the next page; empty on the last page. */
463
565
  nextPageToken?: string;
464
566
  }
567
+ /** The request of ListIdentities. */
568
+ export interface ListIdentitiesRequest {
569
+ /** The end user whose identities to list. */
570
+ parent: string;
571
+ /** At most this many; default 50, clamped to 1000. */
572
+ pageSize?: number;
573
+ /** `next_page_token` of the previous page. */
574
+ pageToken?: string;
575
+ /** AIP-160 filter over labels and filterable fields. */
576
+ filter?: string;
577
+ /** AIP-132 ordering over filterable fields. */
578
+ orderBy?: string;
579
+ }
580
+ /** The response of ListIdentities. */
581
+ export interface ListIdentitiesResponse {
582
+ /** The page. */
583
+ identities?: Identity[];
584
+ /** The token of the next page; empty on the last page. */
585
+ nextPageToken?: string;
586
+ }
465
587
  /** The request of ListInvitations. */
466
588
  export interface ListInvitationsRequest {
467
589
  /** The parent to list in. */
@@ -484,7 +606,11 @@ export interface ListInvitationsResponse {
484
606
  }
485
607
  /** The request of ListMemberships. */
486
608
  export interface ListMembershipsRequest {
487
- /** The parent to list in. */
609
+ /**
610
+ * The parent to list in. `…/customer_organizations/-` (AIP-159) lists one end
611
+ * user's memberships across the environment's organizations and requires
612
+ * `filter = end_user="…"`; each result carries its own organization's name.
613
+ */
488
614
  parent: string;
489
615
  /** At most this many; default 50, clamped to 1000. */
490
616
  pageSize?: number;
@@ -579,6 +705,15 @@ export interface Membership {
579
705
  /** App-defined roles, for example `admin`. */
580
706
  roles?: string[];
581
707
  }
708
+ /** The request of MoveIdentity. */
709
+ export interface MoveIdentityRequest {
710
+ /** The name of the identity to move. */
711
+ name: string;
712
+ /** The end user that receives the identity. */
713
+ targetEndUser: string;
714
+ /** Why the identity moves (1 to 512 characters); recorded in the audit trail. */
715
+ reason: string;
716
+ }
582
717
  /**
583
718
  * An OAuth Client is a relying party of the customer's authorization server:
584
719
  * its app, API, or CLI. Tokens are signed by a Sylphx Keys handle and verify
@@ -872,13 +1007,15 @@ export interface VerifyEmailDomainRequest {
872
1007
  name: string;
873
1008
  }
874
1009
  /** A sign-in method or factor. */
875
- export type AuthMethod = 'password' | 'magic_link' | 'email_otp' | 'passkey' | 'totp' | 'oidc' | 'saml' | (string & {});
1010
+ export type AuthMethod = 'password' | 'magic_link' | 'email_otp' | 'passkey' | 'totp' | 'oidc' | 'saml' | 'device' | (string & {});
876
1011
  /** The verification state of an Email Domain. */
877
1012
  export type EmailDomainState = 'pending' | 'verified' | (string & {});
878
1013
  /** The lifecycle state of an end user. */
879
1014
  export type EndUserState = 'active' | 'suspended' | (string & {});
880
1015
  /** An OAuth grant. */
881
1016
  export type GrantType = 'authorization_code' | 'refresh_token' | 'device_code' | 'client_credentials' | (string & {});
1017
+ /** The kind of an Identity. */
1018
+ export type IdentityType = 'password' | 'email' | 'oidc' | 'device' | 'passkey' | (string & {});
882
1019
  /** The lifecycle of an Invitation. */
883
1020
  export type InvitationState = 'pending' | 'accepted' | 'revoked' | 'expired' | (string & {});
884
1021
  /** RFC 6749 client type. */
@@ -905,6 +1042,8 @@ export declare class AuthApi {
905
1042
  readonly endUsers: EndUsersCollection;
906
1043
  /** The `sessions` collection. */
907
1044
  readonly sessions: SessionsCollection;
1045
+ /** The `identities` collection. */
1046
+ readonly identities: IdentitiesCollection;
908
1047
  /** The `customer_organizations` collection. */
909
1048
  readonly customerOrganizations: CustomerOrganizationsCollection;
910
1049
  /** The `memberships` collection. */
@@ -1018,6 +1157,28 @@ export declare class EndUsersCollection {
1018
1157
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1019
1158
  */
1020
1159
  revokeSessions(request: RevokeEndUserSessionsRequest): Promise<RevokeEndUserSessionsResponse>;
1160
+ /**
1161
+ * Sets the customer's own id for an end user, once: an unset namespace is
1162
+ * written, a set one is never rewritten, and a different value for a set
1163
+ * namespace is refused. A namespace holds one id for the life of the user.
1164
+ * Erasure removes the ids and remembers their hashes, so a value that
1165
+ * belonged to an erased user is never handed to another one.
1166
+ *
1167
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*}:attachExternalId` · permission `auth:write` · effect `write`
1168
+ *
1169
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1170
+ */
1171
+ attachExternalId(request: AttachEndUserExternalIdRequest): Promise<EndUser>;
1172
+ /**
1173
+ * Finds the one end user of one of the customer's own ids. An id that
1174
+ * belongs to no live user of this environment is `RESOURCE_NOT_FOUND`,
1175
+ * the same answer a value erased with its user gives.
1176
+ *
1177
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/end_users:find` · permission `auth:read` · effect `read`
1178
+ *
1179
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1180
+ */
1181
+ find(request: FindEndUserRequest): Promise<FindEndUserResponse>;
1021
1182
  }
1022
1183
  /** `sessions` of Sylphx Auth: Resource type `auth.sylphx.com/Session`. */
1023
1184
  export declare class SessionsCollection {
@@ -1050,6 +1211,44 @@ export declare class SessionsCollection {
1050
1211
  */
1051
1212
  revoke(request: RevokeSessionRequest): Promise<Session>;
1052
1213
  }
1214
+ /** `identities` of Sylphx Auth: Resource type `auth.sylphx.com/Identity`. */
1215
+ export declare class IdentitiesCollection {
1216
+ private readonly client;
1217
+ constructor(client: runtime.Client);
1218
+ /**
1219
+ * Gets an identity of an end user.
1220
+ *
1221
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*\/identities/*}` · permission `auth:read` · effect `read`
1222
+ *
1223
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1224
+ */
1225
+ get(request: GetIdentityRequest): Promise<Identity>;
1226
+ /**
1227
+ * Lists the identities an end user signs in with.
1228
+ *
1229
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/end_users/*}/identities` · permission `auth:read` · effect `read`
1230
+ *
1231
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1232
+ */
1233
+ list(request: ListIdentitiesRequest): Promise<ListIdentitiesResponse>;
1234
+ /** Every item of every page of `list`. */
1235
+ listAll(request: ListIdentitiesRequest): AsyncGenerator<Identity>;
1236
+ /**
1237
+ * Moves a federated or device identity from one end user to another, to
1238
+ * fix a wrongly linked player. One transaction: the identity changes owner,
1239
+ * the sessions of both end users are revoked, and nothing else about
1240
+ * either moves (profile, memberships, data). Refused when it would leave
1241
+ * the source with no sign-in, unless the source is suspended, and when the
1242
+ * target already has an identity of the same provider. The reason is
1243
+ * audited with the operator, both end users and the identity's fingerprint.
1244
+ * An operator action: an end user's own session cannot call it.
1245
+ *
1246
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*\/identities/*}:move` · permission `auth:write` · effect `destructive`
1247
+ *
1248
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1249
+ */
1250
+ move(request: MoveIdentityRequest): Promise<Identity>;
1251
+ }
1053
1252
  /** `customer_organizations` of Sylphx Auth: Resource type `auth.sylphx.com/CustomerOrganization`. */
1054
1253
  export declare class CustomerOrganizationsCollection {
1055
1254
  private readonly client;
package/dist/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- // @generated by sylphx-gen 0.1.0 from contracts@c8aac0afaf7591d0d5efa1ba6a8540d723d41a97ce7ad5d68601380ef3ab4783. Do not edit.
1
+ // @generated by sylphx-gen 0.1.0 from contracts@c8a7361c53e572321b0ec9fb014fd1e8279b007b62562423038e0d0e5b9d767a. Do not edit.
2
2
  // `sylphx.auth.v1`.
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
@@ -6,6 +6,9 @@ runtime.registerSchemas({
6
6
  'sylphx.auth.v1.AcceptInvitationRequest': [
7
7
  ['endUser', 'end_user'],
8
8
  ],
9
+ 'sylphx.auth.v1.AttachEndUserExternalIdRequest': [
10
+ ['externalId', 'external_id'],
11
+ ],
9
12
  'sylphx.auth.v1.AuthConfig': [
10
13
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
11
14
  ['spec', 'spec', 'sylphx.auth.v1.AuthConfigSpec'],
@@ -22,6 +25,7 @@ runtime.registerSchemas({
22
25
  ['mailSendingDomain', 'mail_sending_domain'],
23
26
  ['userSyncDatabase', 'user_sync_database'],
24
27
  ['socialProviders', 'social_providers', 'sylphx.auth.v1.SocialProvider'],
28
+ ['testEmailPattern', 'test_email_pattern'],
25
29
  ],
26
30
  'sylphx.auth.v1.AuthConfigStatus': [
27
31
  ['observedGeneration', 'observed_generation'],
@@ -33,6 +37,7 @@ runtime.registerSchemas({
33
37
  ['customerOrganizationId', 'customer_organization_id'],
34
38
  ['customerOrganization', 'customer_organization', 'sylphx.auth.v1.CustomerOrganization'],
35
39
  ['validateOnly', 'validate_only'],
40
+ ['ownerEndUser', 'owner_end_user'],
36
41
  ],
37
42
  'sylphx.auth.v1.CreateEmailDomainRequest': [
38
43
  ['emailDomainId', 'email_domain_id'],
@@ -108,16 +113,30 @@ runtime.registerSchemas({
108
113
  ['lastLoginTime', 'last_login_time'],
109
114
  ['unsafeMetadata', 'unsafe_metadata', undefined, 'json'],
110
115
  ['lockExpireTime', 'lock_expire_time'],
116
+ ['externalIds', 'external_ids', undefined, 'map'],
117
+ ['syntheticTime', 'synthetic_time'],
118
+ ],
119
+ 'sylphx.auth.v1.FindEndUserRequest': [
120
+ ['externalId', 'external_id'],
121
+ ],
122
+ 'sylphx.auth.v1.FindEndUserResponse': [
123
+ ['endUser', 'end_user', 'sylphx.auth.v1.EndUser'],
111
124
  ],
112
125
  'sylphx.auth.v1.GetAuthConfigRequest': [],
113
126
  'sylphx.auth.v1.GetCustomerOrganizationRequest': [],
114
127
  'sylphx.auth.v1.GetEmailDomainRequest': [],
115
128
  'sylphx.auth.v1.GetEndUserRequest': [],
129
+ 'sylphx.auth.v1.GetIdentityRequest': [],
116
130
  'sylphx.auth.v1.GetInvitationRequest': [],
117
131
  'sylphx.auth.v1.GetMembershipRequest': [],
118
132
  'sylphx.auth.v1.GetOauthClientRequest': [],
119
133
  'sylphx.auth.v1.GetOrganizationRoleRequest': [],
120
134
  'sylphx.auth.v1.GetSessionRequest': [],
135
+ 'sylphx.auth.v1.Identity': [
136
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
137
+ ['linkTime', 'link_time'],
138
+ ['lastUseTime', 'last_use_time'],
139
+ ],
121
140
  'sylphx.auth.v1.Invitation': [
122
141
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
123
142
  ['expireTime', 'expire_time'],
@@ -151,6 +170,15 @@ runtime.registerSchemas({
151
170
  ['endUsers', 'end_users', 'sylphx.auth.v1.EndUser'],
152
171
  ['nextPageToken', 'next_page_token'],
153
172
  ],
173
+ 'sylphx.auth.v1.ListIdentitiesRequest': [
174
+ ['pageSize', 'page_size'],
175
+ ['pageToken', 'page_token'],
176
+ ['orderBy', 'order_by'],
177
+ ],
178
+ 'sylphx.auth.v1.ListIdentitiesResponse': [
179
+ ['identities', 'identities', 'sylphx.auth.v1.Identity'],
180
+ ['nextPageToken', 'next_page_token'],
181
+ ],
154
182
  'sylphx.auth.v1.ListInvitationsRequest': [
155
183
  ['pageSize', 'page_size'],
156
184
  ['pageToken', 'page_token'],
@@ -200,6 +228,9 @@ runtime.registerSchemas({
200
228
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
201
229
  ['endUser', 'end_user'],
202
230
  ],
231
+ 'sylphx.auth.v1.MoveIdentityRequest': [
232
+ ['targetEndUser', 'target_end_user'],
233
+ ],
203
234
  'sylphx.auth.v1.OauthClient': [
204
235
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
205
236
  ['spec', 'spec', 'sylphx.auth.v1.OauthClientSpec'],
@@ -319,6 +350,8 @@ export class AuthApi {
319
350
  endUsers;
320
351
  /** The `sessions` collection. */
321
352
  sessions;
353
+ /** The `identities` collection. */
354
+ identities;
322
355
  /** The `customer_organizations` collection. */
323
356
  customerOrganizations;
324
357
  /** The `memberships` collection. */
@@ -335,6 +368,7 @@ export class AuthApi {
335
368
  this.authConfigs = new AuthConfigsCollection(client);
336
369
  this.endUsers = new EndUsersCollection(client);
337
370
  this.sessions = new SessionsCollection(client);
371
+ this.identities = new IdentitiesCollection(client);
338
372
  this.customerOrganizations = new CustomerOrganizationsCollection(client);
339
373
  this.memberships = new MembershipsCollection(client);
340
374
  this.organizationRoles = new OrganizationRolesCollection(client);
@@ -550,6 +584,45 @@ export class EndUsersCollection {
550
584
  mutation: true,
551
585
  });
552
586
  }
587
+ /**
588
+ * Sets the customer's own id for an end user, once: an unset namespace is
589
+ * written, a set one is never rewritten, and a different value for a set
590
+ * namespace is refused. A namespace holds one id for the life of the user.
591
+ * Erasure removes the ids and remembers their hashes, so a value that
592
+ * belonged to an erased user is never handed to another one.
593
+ *
594
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*}:attachExternalId` · permission `auth:write` · effect `write`
595
+ *
596
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
597
+ */
598
+ async attachExternalId(request) {
599
+ return this.client.call({
600
+ method: 'POST',
601
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/end_users/*', 'name')}:attachExternalId`,
602
+ body: runtime.omit(request, ['name']),
603
+ bodyType: 'sylphx.auth.v1.AttachEndUserExternalIdRequest',
604
+ responseType: 'sylphx.auth.v1.EndUser',
605
+ mutation: true,
606
+ });
607
+ }
608
+ /**
609
+ * Finds the one end user of one of the customer's own ids. An id that
610
+ * belongs to no live user of this environment is `RESOURCE_NOT_FOUND`,
611
+ * the same answer a value erased with its user gives.
612
+ *
613
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/end_users:find` · permission `auth:read` · effect `read`
614
+ *
615
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
616
+ */
617
+ async find(request) {
618
+ return this.client.call({
619
+ method: 'GET',
620
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/end_users:find`,
621
+ query: { namespace: request.namespace, external_id: request.externalId },
622
+ responseType: 'sylphx.auth.v1.FindEndUserResponse',
623
+ mutation: false,
624
+ });
625
+ }
553
626
  }
554
627
  /** `sessions` of Sylphx Auth: Resource type `auth.sylphx.com/Session`. */
555
628
  export class SessionsCollection {
@@ -617,6 +690,79 @@ export class SessionsCollection {
617
690
  });
618
691
  }
619
692
  }
693
+ /** `identities` of Sylphx Auth: Resource type `auth.sylphx.com/Identity`. */
694
+ export class IdentitiesCollection {
695
+ client;
696
+ constructor(client) {
697
+ this.client = client;
698
+ }
699
+ /**
700
+ * Gets an identity of an end user.
701
+ *
702
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*\/identities/*}` · permission `auth:read` · effect `read`
703
+ *
704
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
705
+ */
706
+ async get(request) {
707
+ return this.client.call({
708
+ method: 'GET',
709
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/end_users/*/identities/*', 'name')}`,
710
+ responseType: 'sylphx.auth.v1.Identity',
711
+ mutation: false,
712
+ });
713
+ }
714
+ /**
715
+ * Lists the identities an end user signs in with.
716
+ *
717
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*\/end_users/*}/identities` · permission `auth:read` · effect `read`
718
+ *
719
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
720
+ */
721
+ async list(request) {
722
+ return this.client.call({
723
+ method: 'GET',
724
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*/end_users/*', 'parent')}/identities`,
725
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
726
+ responseType: 'sylphx.auth.v1.ListIdentitiesResponse',
727
+ mutation: false,
728
+ });
729
+ }
730
+ /** Every item of every page of `list`. */
731
+ async *listAll(request) {
732
+ let next = request;
733
+ for (;;) {
734
+ const page = await this.list(next);
735
+ yield* page.identities ?? [];
736
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
737
+ return;
738
+ next = { ...request, pageToken: page.nextPageToken };
739
+ }
740
+ }
741
+ /**
742
+ * Moves a federated or device identity from one end user to another, to
743
+ * fix a wrongly linked player. One transaction: the identity changes owner,
744
+ * the sessions of both end users are revoked, and nothing else about
745
+ * either moves (profile, memberships, data). Refused when it would leave
746
+ * the source with no sign-in, unless the source is suspended, and when the
747
+ * target already has an identity of the same provider. The reason is
748
+ * audited with the operator, both end users and the identity's fingerprint.
749
+ * An operator action: an end user's own session cannot call it.
750
+ *
751
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/end_users/*\/identities/*}:move` · permission `auth:write` · effect `destructive`
752
+ *
753
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
754
+ */
755
+ async move(request) {
756
+ return this.client.call({
757
+ method: 'POST',
758
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/end_users/*/identities/*', 'name')}:move`,
759
+ body: runtime.omit(request, ['name']),
760
+ bodyType: 'sylphx.auth.v1.MoveIdentityRequest',
761
+ responseType: 'sylphx.auth.v1.Identity',
762
+ mutation: true,
763
+ });
764
+ }
765
+ }
620
766
  /** `customer_organizations` of Sylphx Auth: Resource type `auth.sylphx.com/CustomerOrganization`. */
621
767
  export class CustomerOrganizationsCollection {
622
768
  client;
@@ -676,7 +822,7 @@ export class CustomerOrganizationsCollection {
676
822
  return this.client.call({
677
823
  method: 'POST',
678
824
  path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/customer_organizations`,
679
- query: { customer_organization_id: request.customerOrganizationId, validate_only: request.validateOnly },
825
+ query: { customer_organization_id: request.customerOrganizationId, validate_only: request.validateOnly, owner_end_user: request.ownerEndUser },
680
826
  body: request.customerOrganization ?? {},
681
827
  bodyType: 'sylphx.auth.v1.CustomerOrganization',
682
828
  responseType: 'sylphx.auth.v1.CustomerOrganization',