@collective-intelligence/external-apps-server-sdk 0.1.13 → 0.1.15

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/dist/index.d.ts CHANGED
@@ -163,6 +163,39 @@ export type ExternalApplicationsCreateOrGetAppUserResponses = {
163
163
  };
164
164
  };
165
165
  export type ExternalApplicationsCreateOrGetAppUserResponse = ExternalApplicationsCreateOrGetAppUserResponses[keyof ExternalApplicationsCreateOrGetAppUserResponses];
166
+ export type ExternalApplicationsCheckAppUserEmailData = {
167
+ body: {
168
+ email: string;
169
+ };
170
+ headers: {
171
+ authorization?: string;
172
+ "x-organization-id": string;
173
+ "x-correlation-id"?: string;
174
+ "x-external-audit-issuer"?: string;
175
+ "x-external-audit-subject"?: string;
176
+ "x-external-caller-kind"?: "anonymous_visitor";
177
+ "x-external-ci-user-id"?: string;
178
+ "x-external-server-role"?: string;
179
+ };
180
+ path?: never;
181
+ query?: never;
182
+ url: "/application/v1/users/check-email";
183
+ };
184
+ export type ExternalApplicationsCheckAppUserEmailResponses = {
185
+ /**
186
+ * Success
187
+ */
188
+ 200: {
189
+ correlationId: string;
190
+ result: {
191
+ usable: true;
192
+ } | {
193
+ reason: "user_unavailable" | "target_inactive";
194
+ usable: false;
195
+ };
196
+ };
197
+ };
198
+ export type ExternalApplicationsCheckAppUserEmailResponse = ExternalApplicationsCheckAppUserEmailResponses[keyof ExternalApplicationsCheckAppUserEmailResponses];
166
199
  export type ExternalApplicationsGetAppUserResponses = {
167
200
  /**
168
201
  * Success
@@ -558,6 +591,9 @@ interface DurableFileUpload {
558
591
  sizeBytes: number;
559
592
  }
560
593
  export type ExternalApplicationServiceOperationRequest = {
594
+ input: ExternalApplicationsCheckAppUserEmailData["body"];
595
+ operationId: "users_check_email";
596
+ } | {
561
597
  input: DurableFileUpload;
562
598
  operationId: "files_upload";
563
599
  } | {
@@ -577,11 +613,16 @@ export type ExternalApplicationServiceOperationRequest = {
577
613
  };
578
614
  operationId: "users_link_companies";
579
615
  };
616
+ /**
617
+ * Whether `users_create_or_get` would accept an email, checked without
618
+ * creating anything; an unknown email is usable.
619
+ */
620
+ export type ApplicationUserEmailCheck = ExternalApplicationsCheckAppUserEmailResponse["result"];
580
621
  /** A user's linked company entities, in entity id order. */
581
622
  export interface UserCompanyLinks {
582
623
  entityIds: string[];
583
624
  }
584
- export type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"files_upload", {
625
+ export type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"users_check_email", ApplicationUserEmailCheck> | EnvelopeSuccess<"files_upload", {
585
626
  storageFileId: StorageFileId;
586
627
  }> | EnvelopeSuccess<"origins_set_runtime", {
587
628
  origin: string;
@@ -971,6 +1012,13 @@ export interface ServerClient {
971
1012
  * remain limited to service credentials and Organization members.
972
1013
  */
973
1014
  readonly users: Readonly<{
1015
+ /**
1016
+ * Whether `createOrGet` would accept `email`, without creating anything:
1017
+ * `{ usable: true }`, or `{ usable: false, reason }` with
1018
+ * `user_unavailable` or `target_inactive`. An unknown email is usable.
1019
+ * Service credentials only, under the users-create permission.
1020
+ */
1021
+ checkEmail: ServerOperationMethod<"users_check_email">;
974
1022
  createOrGet: ServerOperationMethod<"users_create_or_get">;
975
1023
  deactivate: ServerOperationMethod<"users_deactivate">;
976
1024
  get: ServerOperationMethod<"users_get">;