@mitralab.io/sdk-core 0.2.14 → 0.2.16-beta.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.
package/dist/index.cjs CHANGED
@@ -120,6 +120,9 @@ function isObject(value) {
120
120
  function isNullableString(value) {
121
121
  return value === null || typeof value === "string";
122
122
  }
123
+ function isNonEmptyString(value) {
124
+ return typeof value === "string" && value.length > 0;
125
+ }
123
126
  function isNullableBoolean(value) {
124
127
  return value === null || typeof value === "boolean";
125
128
  }
@@ -753,6 +756,83 @@ function expectMessageAccepted(value, context, errors = defaultSdkCoreErrorFacto
753
756
  if (typeof response.messageId !== "string") invalidField(context, "messageId", errors);
754
757
  return response;
755
758
  }
759
+ function expectEmailTemplate(value, context, errors = defaultSdkCoreErrorFactory) {
760
+ const template = expectObject(value, context, errors);
761
+ if (typeof template.id !== "string") invalidField(context, "id", errors);
762
+ if (!isNonEmptyString(template.type)) invalidField(context, "type", errors);
763
+ if (!isNullableString(template.senderIdentityId)) {
764
+ invalidField(context, "senderIdentityId", errors);
765
+ }
766
+ if (typeof template.subject !== "string") invalidField(context, "subject", errors);
767
+ if (typeof template.htmlBody !== "string") invalidField(context, "htmlBody", errors);
768
+ if (!isNullableString(template.textBody)) invalidField(context, "textBody", errors);
769
+ if (typeof template.platformDefault !== "boolean") {
770
+ invalidField(context, "platformDefault", errors);
771
+ }
772
+ if (typeof template.createdAt !== "string") invalidField(context, "createdAt", errors);
773
+ if (typeof template.updatedAt !== "string") invalidField(context, "updatedAt", errors);
774
+ return template;
775
+ }
776
+ function expectEmailTemplateTypeCatalog(value, context, errors = defaultSdkCoreErrorFactory) {
777
+ const catalog = expectObject(value, context, errors);
778
+ if (!isNonEmptyString(catalog.type)) invalidField(context, "type", errors);
779
+ expectObjectArray(catalog.variables, `${context} variables`, errors).forEach(
780
+ (variable, position) => {
781
+ const variableContext = `${context} variable ${position}`;
782
+ if (typeof variable.name !== "string") invalidField(variableContext, "name", errors);
783
+ if (typeof variable.required !== "boolean") {
784
+ invalidField(variableContext, "required", errors);
785
+ }
786
+ if (!isNullableString(variable.description)) {
787
+ invalidField(variableContext, "description", errors);
788
+ }
789
+ if (!isNullableString(variable.preview)) invalidField(variableContext, "preview", errors);
790
+ }
791
+ );
792
+ return catalog;
793
+ }
794
+ function expectEmailTemplatePreview(value, context, errors = defaultSdkCoreErrorFactory) {
795
+ const preview = expectObject(value, context, errors);
796
+ if (typeof preview.subject !== "string") invalidField(context, "subject", errors);
797
+ if (typeof preview.htmlBody !== "string") invalidField(context, "htmlBody", errors);
798
+ if (!isNullableString(preview.textBody)) invalidField(context, "textBody", errors);
799
+ return preview;
800
+ }
801
+ function expectEmailSender(value, context, errors = defaultSdkCoreErrorFactory) {
802
+ const sender = expectObject(value, context, errors);
803
+ if (typeof sender.id !== "string") invalidField(context, "id", errors);
804
+ if (typeof sender.email !== "string") invalidField(context, "email", errors);
805
+ if (typeof sender.displayName !== "string") invalidField(context, "displayName", errors);
806
+ if (!isNonEmptyString(sender.status)) invalidField(context, "status", errors);
807
+ if (typeof sender.sharedWithCurrentWorkspace !== "boolean") {
808
+ invalidField(context, "sharedWithCurrentWorkspace", errors);
809
+ }
810
+ if (typeof sender.ownerConfirmationPending !== "boolean") {
811
+ invalidField(context, "ownerConfirmationPending", errors);
812
+ }
813
+ if (typeof sender.createdAt !== "string") invalidField(context, "createdAt", errors);
814
+ if (typeof sender.updatedAt !== "string") invalidField(context, "updatedAt", errors);
815
+ return sender;
816
+ }
817
+ function expectEmailSettings(value, context, errors = defaultSdkCoreErrorFactory) {
818
+ const settings = expectObject(value, context, errors);
819
+ if (typeof settings.appId !== "string") invalidField(context, "appId", errors);
820
+ if (!isNullableString(settings.senderIdentityId)) {
821
+ invalidField(context, "senderIdentityId", errors);
822
+ }
823
+ if (!isNullableString(settings.displayName)) invalidField(context, "displayName", errors);
824
+ if (!isNullableString(settings.replyTo)) invalidField(context, "replyTo", errors);
825
+ if (typeof settings.ownTemplateSendsFromBrand !== "boolean") {
826
+ invalidField(context, "ownTemplateSendsFromBrand", errors);
827
+ }
828
+ const senderContext = `${context} effectiveSender`;
829
+ const sender = expectObject(settings.effectiveSender, senderContext, errors);
830
+ if (typeof sender.email !== "string") invalidField(senderContext, "email", errors);
831
+ if (!isNullableString(sender.displayName)) invalidField(senderContext, "displayName", errors);
832
+ if (!isNonEmptyString(sender.source)) invalidField(senderContext, "source", errors);
833
+ if (!isNullableString(sender.reason)) invalidField(senderContext, "reason", errors);
834
+ return settings;
835
+ }
756
836
  function expectAgentDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
757
837
  const agent = expectObject(value, context, errors);
758
838
  if (typeof agent.id !== "string") invalidField(context, "id", errors);
@@ -2924,7 +3004,23 @@ function createMembersModule(transport, errors = defaultSdkCoreErrorFactory) {
2924
3004
  }
2925
3005
 
2926
3006
  // src/modules/messenger.ts
2927
- function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
3007
+ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory, getAppId) {
3008
+ const templatePath = (type) => `/api/v1/email/templates/${encodePathSegment(type, "email template type", errors)}`;
3009
+ const senderPath = (senderId) => `/api/v1/email/identities/${encodePathSegment(senderId, "email sender id", errors)}`;
3010
+ const currentAppId = () => {
3011
+ const appId = getAppId?.();
3012
+ if (!appId) configurationError("An appId is required for app email calls", errors);
3013
+ return appId;
3014
+ };
3015
+ const settingsPath = () => `/api/v1/email/apps/${encodePathSegment(currentAppId(), "app id", errors)}/settings`;
3016
+ const preview = async (type, appId) => expectEmailTemplatePreview(
3017
+ await transport.request(`${templatePath(type)}/preview`, {
3018
+ method: "GET",
3019
+ params: { appId }
3020
+ }),
3021
+ "Email template preview response",
3022
+ errors
3023
+ );
2928
3024
  return {
2929
3025
  async notify(content) {
2930
3026
  return expectMessageAccepted(
@@ -2945,6 +3041,120 @@ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
2945
3041
  "Send email response",
2946
3042
  errors
2947
3043
  );
3044
+ },
3045
+ async listEmailTemplates() {
3046
+ return expectObjectArray(
3047
+ await transport.request("/api/v1/email/templates", {
3048
+ method: "GET",
3049
+ params: { appId: currentAppId() }
3050
+ }),
3051
+ "Email template list response",
3052
+ errors,
3053
+ expectEmailTemplate
3054
+ );
3055
+ },
3056
+ async getEmailTemplateType(type) {
3057
+ return expectEmailTemplateTypeCatalog(
3058
+ await transport.request(
3059
+ `/api/v1/email/template-types/${encodePathSegment(type, "email template type", errors)}`,
3060
+ { method: "GET" }
3061
+ ),
3062
+ "Email template type response",
3063
+ errors
3064
+ );
3065
+ },
3066
+ async getEmailTemplate(type) {
3067
+ return expectEmailTemplate(
3068
+ await transport.request(templatePath(type), {
3069
+ method: "GET",
3070
+ params: { appId: currentAppId() }
3071
+ }),
3072
+ "Email template response",
3073
+ errors
3074
+ );
3075
+ },
3076
+ async upsertEmailTemplate(type, input) {
3077
+ const appId = currentAppId();
3078
+ const template = expectEmailTemplate(
3079
+ await transport.request(templatePath(type), {
3080
+ method: "PUT",
3081
+ body: templateBody(appId, input)
3082
+ }),
3083
+ "Upsert email template response",
3084
+ errors
3085
+ );
3086
+ try {
3087
+ return { template, preview: await preview(type, appId) };
3088
+ } catch (previewError) {
3089
+ return { template, preview: null, previewError };
3090
+ }
3091
+ },
3092
+ async previewEmailTemplate(type) {
3093
+ return preview(type, currentAppId());
3094
+ },
3095
+ async deleteEmailTemplate(type) {
3096
+ expectEmpty(
3097
+ await transport.request(templatePath(type), {
3098
+ method: "DELETE",
3099
+ params: { appId: currentAppId() }
3100
+ }),
3101
+ "Delete email template response",
3102
+ errors
3103
+ );
3104
+ },
3105
+ async listEmailSenders() {
3106
+ return expectObjectArray(
3107
+ await transport.request("/api/v1/email/identities/workspace", { method: "GET" }),
3108
+ "Email sender list response",
3109
+ errors,
3110
+ expectEmailSender
3111
+ );
3112
+ },
3113
+ async registerEmailSender(input) {
3114
+ return expectEmailSender(
3115
+ await transport.request("/api/v1/email/identities", {
3116
+ method: "POST",
3117
+ body: { email: input.email, displayName: input.displayName }
3118
+ }),
3119
+ "Register email sender response",
3120
+ errors
3121
+ );
3122
+ },
3123
+ async resendEmailSenderVerification(senderId) {
3124
+ return expectEmailSender(
3125
+ await transport.request(`${senderPath(senderId)}/resend-verification`, {
3126
+ method: "POST"
3127
+ }),
3128
+ "Resend email sender verification response",
3129
+ errors
3130
+ );
3131
+ },
3132
+ async confirmEmailSender(senderId, code) {
3133
+ return expectEmailSender(
3134
+ await transport.request(`${senderPath(senderId)}/confirm`, {
3135
+ method: "POST",
3136
+ body: { code }
3137
+ }),
3138
+ "Confirm email sender response",
3139
+ errors
3140
+ );
3141
+ },
3142
+ async getEmailSettings() {
3143
+ return expectEmailSettings(
3144
+ await transport.request(settingsPath(), { method: "GET" }),
3145
+ "Email settings response",
3146
+ errors
3147
+ );
3148
+ },
3149
+ async updateEmailSettings(input) {
3150
+ return expectEmailSettings(
3151
+ await transport.request(settingsPath(), {
3152
+ method: "PUT",
3153
+ body: settingsBody(input)
3154
+ }),
3155
+ "Update email settings response",
3156
+ errors
3157
+ );
2948
3158
  }
2949
3159
  };
2950
3160
  }
@@ -2960,6 +3170,21 @@ function rawEmailPayload(input) {
2960
3170
  ...input.text === void 0 ? {} : { text: input.text }
2961
3171
  };
2962
3172
  }
3173
+ function templateBody(appId, input) {
3174
+ return {
3175
+ appId,
3176
+ subject: input.subject,
3177
+ htmlBody: input.htmlBody,
3178
+ ...input.textBody === void 0 ? {} : { textBody: input.textBody }
3179
+ };
3180
+ }
3181
+ function settingsBody(input) {
3182
+ return {
3183
+ ...input.senderIdentityId === void 0 ? {} : { senderIdentityId: input.senderIdentityId },
3184
+ ...input.displayName === void 0 ? {} : { displayName: input.displayName },
3185
+ ...input.replyTo === void 0 ? {} : { replyTo: input.replyTo }
3186
+ };
3187
+ }
2963
3188
 
2964
3189
  // src/modules/publicFunctions.ts
2965
3190
  function createPublicFunctionsModule(transport, errors = defaultSdkCoreErrorFactory) {
@@ -3277,7 +3502,7 @@ function createSdkCore(options) {
3277
3502
  integrationResources: createIntegrationResourcesModule(options.transports.integration, errors),
3278
3503
  integrationTemplates: createIntegrationTemplatesModule(options.transports.integration, errors),
3279
3504
  members,
3280
- messenger: createMessengerModule(messengerTransport, errors),
3505
+ messenger: createMessengerModule(messengerTransport, errors, options.getAppId),
3281
3506
  publicFunctions: createPublicFunctionsModule(options.transports.publicFunctions, errors),
3282
3507
  queries: createQueriesModule(options.transports.dataManager, errors),
3283
3508
  sql: createSqlModule(options.transports.dataManager, errors),
package/dist/index.d.cts CHANGED
@@ -1303,6 +1303,108 @@ interface SendEmailInput {
1303
1303
  /** Plain-text alternative for clients that do not render HTML. */
1304
1304
  text?: string;
1305
1305
  }
1306
+ /**
1307
+ * The account emails an app may rewrite with its own token. Messenger sends them from the app's
1308
+ * sender settings or the brand, so a template never picks its sender.
1309
+ */
1310
+ type EmailTemplateType = "SIGN_IN" | "SSO_GUIDANCE" | "APP_USER_INVITED" | "APP_ACCESS_REQUIRED";
1311
+ interface EmailTemplate {
1312
+ id: string;
1313
+ /**
1314
+ * An `EmailTemplateType` with an app token. Kept as a string because a console token also
1315
+ * lists the platform's other types, and a type Messenger opens later must not break the list.
1316
+ */
1317
+ type: string;
1318
+ /** Always null for these types: their sender comes from the app settings or the brand. */
1319
+ senderIdentityId: string | null;
1320
+ subject: string;
1321
+ htmlBody: string;
1322
+ textBody: string | null;
1323
+ /** True on a platform row. The list returns it next to the app's own row when the app rewrote the type. */
1324
+ platformDefault: boolean;
1325
+ createdAt: string;
1326
+ updatedAt: string;
1327
+ }
1328
+ interface EmailTemplateVariable {
1329
+ /** Referenced in a template as `$name`. */
1330
+ name: string;
1331
+ /** A required variable must appear in the subject or the HTML body. */
1332
+ required: boolean;
1333
+ description: string | null;
1334
+ /** Sample value used to render the preview. */
1335
+ preview: string | null;
1336
+ }
1337
+ interface EmailTemplateTypeCatalog {
1338
+ type: string;
1339
+ variables: EmailTemplateVariable[];
1340
+ }
1341
+ /** Replaces the app's version of the template as a whole. */
1342
+ interface EmailTemplateInput {
1343
+ subject: string;
1344
+ htmlBody: string;
1345
+ /** Left out, the plain-text version saved before is cleared. */
1346
+ textBody?: string;
1347
+ }
1348
+ /** The template rendered with the preview values of its variables. */
1349
+ interface EmailTemplatePreview {
1350
+ subject: string;
1351
+ htmlBody: string;
1352
+ textBody: string | null;
1353
+ }
1354
+ interface EmailTemplateUpsertResult {
1355
+ template: EmailTemplate;
1356
+ /** Null when only the preview failed; the template is saved all the same. */
1357
+ preview: EmailTemplatePreview | null;
1358
+ /** The transport or response error of the preview, unchanged, when `preview` is null. */
1359
+ previewError?: unknown;
1360
+ }
1361
+ /** An address of a person, available as a sender in the app's workspace. */
1362
+ interface EmailSender {
1363
+ id: string;
1364
+ email: string;
1365
+ displayName: string;
1366
+ /**
1367
+ * `PENDING`, `VERIFIED` or `FAILED`. Kept as a string so a status Messenger adds later does not
1368
+ * break the list. Only a `VERIFIED` address signs the app's emails.
1369
+ */
1370
+ status: string;
1371
+ sharedWithCurrentWorkspace: boolean;
1372
+ /** True until the person confirms the 6-digit code Messenger sent to the address. */
1373
+ ownerConfirmationPending: boolean;
1374
+ createdAt: string;
1375
+ updatedAt: string;
1376
+ }
1377
+ interface EmailSenderInput {
1378
+ email: string;
1379
+ /** Name of the address; the app settings may override it in the From header. */
1380
+ displayName: string;
1381
+ }
1382
+ /** The From the app's emails use now, which falls back to the brand while the app sender cannot sign. */
1383
+ interface EffectiveEmailSender {
1384
+ email: string;
1385
+ displayName: string | null;
1386
+ /** `APP_SENDER` or `BRAND_DEFAULT`, as a string for the same reason as `EmailSender.status`. */
1387
+ source: string;
1388
+ /** Why the brand signs: `NO_SETTINGS`, `IDENTITY_NOT_VERIFIED` or `IDENTITY_NOT_SHARED`. */
1389
+ reason: string | null;
1390
+ }
1391
+ interface EmailSettings {
1392
+ appId: string;
1393
+ senderIdentityId: string | null;
1394
+ displayName: string | null;
1395
+ replyTo: string | null;
1396
+ effectiveSender: EffectiveEmailSender;
1397
+ /** True when the app's own templates go out even while the brand signs. */
1398
+ ownTemplateSendsFromBrand: boolean;
1399
+ }
1400
+ /** Replaces the app's settings as a whole: a field left out or null is cleared. */
1401
+ interface EmailSettingsInput {
1402
+ /** An `EmailSender.id` from `listEmailSenders`; without it the app sends from the brand. */
1403
+ senderIdentityId?: string | null;
1404
+ /** Single line, shown in the From header. */
1405
+ displayName?: string | null;
1406
+ replyTo?: string | null;
1407
+ }
1306
1408
  interface AppContext {
1307
1409
  appId: string;
1308
1410
  app: AppDefinition;
@@ -1795,8 +1897,48 @@ interface MessengerModule {
1795
1897
  notify(content: string): Promise<MessageAccepted>;
1796
1898
  /** Sends an email from the app's sender; only the app's backend token may send. */
1797
1899
  sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
1798
- }
1799
- declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
1900
+ /**
1901
+ * Lists the current app's email templates: the platform row (`platformDefault: true`) of every
1902
+ * type and, beside it, the app's row for each type the app has rewritten.
1903
+ */
1904
+ listEmailTemplates(): Promise<EmailTemplate[]>;
1905
+ /** Gets the variables a type accepts, referenced as `$name` in the subject and HTML body. */
1906
+ getEmailTemplateType(type: EmailTemplateType): Promise<EmailTemplateTypeCatalog>;
1907
+ /** Gets the current app's version of a template, or the platform text when it has none. */
1908
+ getEmailTemplate(type: EmailTemplateType): Promise<EmailTemplate>;
1909
+ /**
1910
+ * Replaces the current app's version of a template and renders its preview. Every required
1911
+ * variable must appear in the subject or the HTML body.
1912
+ */
1913
+ upsertEmailTemplate(type: EmailTemplateType, input: EmailTemplateInput): Promise<EmailTemplateUpsertResult>;
1914
+ /**
1915
+ * Renders the app's saved template, or the platform one, with the catalog's sample values. It
1916
+ * does not prove which HTML goes out: the sender and the brand policy decide that at send time.
1917
+ */
1918
+ previewEmailTemplate(type: EmailTemplateType): Promise<EmailTemplatePreview>;
1919
+ /** Deletes the current app's version of a template, so the platform text applies again. */
1920
+ deleteEmailTemplate(type: EmailTemplateType): Promise<void>;
1921
+ /** Lists the addresses available as senders in the workspace of the token. */
1922
+ listEmailSenders(): Promise<EmailSender[]>;
1923
+ /**
1924
+ * Registers an address in the name of the person in the token and makes it available in the
1925
+ * app's workspace. An address the person already owns comes back as saved, made available too.
1926
+ * Messenger mails a verification link and a 6-digit code to the address.
1927
+ */
1928
+ registerEmailSender(input: EmailSenderInput): Promise<EmailSender>;
1929
+ /**
1930
+ * Mails the AWS link again while AWS has not verified the address, and a new code only while
1931
+ * the person has not confirmed one yet.
1932
+ */
1933
+ resendEmailSenderVerification(senderId: string): Promise<EmailSender>;
1934
+ /** Confirms the 6-digit code the person read in the mailbox of the address. */
1935
+ confirmEmailSender(senderId: string, code: string): Promise<EmailSender>;
1936
+ /** Gets the current app's sender settings and the From its emails use now. */
1937
+ getEmailSettings(): Promise<EmailSettings>;
1938
+ /** Replaces the current app's sender settings; a field left out is cleared. */
1939
+ updateEmailSettings(input: EmailSettingsInput): Promise<EmailSettings>;
1940
+ }
1941
+ declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory, getAppId?: () => string | undefined): MessengerModule;
1800
1942
 
1801
1943
  interface PublicFunctionsModule {
1802
1944
  /**
@@ -1868,7 +2010,7 @@ interface SdkCoreTransports {
1868
2010
  codeStudio?: Transport;
1869
2011
  /** Copilot transport for tasks, credentials, models, and app connections. */
1870
2012
  copilot?: Transport;
1871
- /** Messenger transport for current-user notifications. */
2013
+ /** Messenger transport for current-user notifications, app emails, and their templates. */
1872
2014
  messenger?: Transport;
1873
2015
  /**
1874
2016
  * Anonymous Functions transport. It must not add Authorization or X-App-Id headers.
@@ -2188,4 +2330,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
2188
2330
  declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
2189
2331
  declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
2190
2332
 
2191
- export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentInput, type AgentMessage, type AgentModel, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
2333
+ export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentInput, type AgentMessage, type AgentModel, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EffectiveEmailSender, type EmailSender, type EmailSenderInput, type EmailSettings, type EmailSettingsInput, type EmailTemplate, type EmailTemplateInput, type EmailTemplatePreview, type EmailTemplateType, type EmailTemplateTypeCatalog, type EmailTemplateUpsertResult, type EmailTemplateVariable, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
package/dist/index.d.ts CHANGED
@@ -1303,6 +1303,108 @@ interface SendEmailInput {
1303
1303
  /** Plain-text alternative for clients that do not render HTML. */
1304
1304
  text?: string;
1305
1305
  }
1306
+ /**
1307
+ * The account emails an app may rewrite with its own token. Messenger sends them from the app's
1308
+ * sender settings or the brand, so a template never picks its sender.
1309
+ */
1310
+ type EmailTemplateType = "SIGN_IN" | "SSO_GUIDANCE" | "APP_USER_INVITED" | "APP_ACCESS_REQUIRED";
1311
+ interface EmailTemplate {
1312
+ id: string;
1313
+ /**
1314
+ * An `EmailTemplateType` with an app token. Kept as a string because a console token also
1315
+ * lists the platform's other types, and a type Messenger opens later must not break the list.
1316
+ */
1317
+ type: string;
1318
+ /** Always null for these types: their sender comes from the app settings or the brand. */
1319
+ senderIdentityId: string | null;
1320
+ subject: string;
1321
+ htmlBody: string;
1322
+ textBody: string | null;
1323
+ /** True on a platform row. The list returns it next to the app's own row when the app rewrote the type. */
1324
+ platformDefault: boolean;
1325
+ createdAt: string;
1326
+ updatedAt: string;
1327
+ }
1328
+ interface EmailTemplateVariable {
1329
+ /** Referenced in a template as `$name`. */
1330
+ name: string;
1331
+ /** A required variable must appear in the subject or the HTML body. */
1332
+ required: boolean;
1333
+ description: string | null;
1334
+ /** Sample value used to render the preview. */
1335
+ preview: string | null;
1336
+ }
1337
+ interface EmailTemplateTypeCatalog {
1338
+ type: string;
1339
+ variables: EmailTemplateVariable[];
1340
+ }
1341
+ /** Replaces the app's version of the template as a whole. */
1342
+ interface EmailTemplateInput {
1343
+ subject: string;
1344
+ htmlBody: string;
1345
+ /** Left out, the plain-text version saved before is cleared. */
1346
+ textBody?: string;
1347
+ }
1348
+ /** The template rendered with the preview values of its variables. */
1349
+ interface EmailTemplatePreview {
1350
+ subject: string;
1351
+ htmlBody: string;
1352
+ textBody: string | null;
1353
+ }
1354
+ interface EmailTemplateUpsertResult {
1355
+ template: EmailTemplate;
1356
+ /** Null when only the preview failed; the template is saved all the same. */
1357
+ preview: EmailTemplatePreview | null;
1358
+ /** The transport or response error of the preview, unchanged, when `preview` is null. */
1359
+ previewError?: unknown;
1360
+ }
1361
+ /** An address of a person, available as a sender in the app's workspace. */
1362
+ interface EmailSender {
1363
+ id: string;
1364
+ email: string;
1365
+ displayName: string;
1366
+ /**
1367
+ * `PENDING`, `VERIFIED` or `FAILED`. Kept as a string so a status Messenger adds later does not
1368
+ * break the list. Only a `VERIFIED` address signs the app's emails.
1369
+ */
1370
+ status: string;
1371
+ sharedWithCurrentWorkspace: boolean;
1372
+ /** True until the person confirms the 6-digit code Messenger sent to the address. */
1373
+ ownerConfirmationPending: boolean;
1374
+ createdAt: string;
1375
+ updatedAt: string;
1376
+ }
1377
+ interface EmailSenderInput {
1378
+ email: string;
1379
+ /** Name of the address; the app settings may override it in the From header. */
1380
+ displayName: string;
1381
+ }
1382
+ /** The From the app's emails use now, which falls back to the brand while the app sender cannot sign. */
1383
+ interface EffectiveEmailSender {
1384
+ email: string;
1385
+ displayName: string | null;
1386
+ /** `APP_SENDER` or `BRAND_DEFAULT`, as a string for the same reason as `EmailSender.status`. */
1387
+ source: string;
1388
+ /** Why the brand signs: `NO_SETTINGS`, `IDENTITY_NOT_VERIFIED` or `IDENTITY_NOT_SHARED`. */
1389
+ reason: string | null;
1390
+ }
1391
+ interface EmailSettings {
1392
+ appId: string;
1393
+ senderIdentityId: string | null;
1394
+ displayName: string | null;
1395
+ replyTo: string | null;
1396
+ effectiveSender: EffectiveEmailSender;
1397
+ /** True when the app's own templates go out even while the brand signs. */
1398
+ ownTemplateSendsFromBrand: boolean;
1399
+ }
1400
+ /** Replaces the app's settings as a whole: a field left out or null is cleared. */
1401
+ interface EmailSettingsInput {
1402
+ /** An `EmailSender.id` from `listEmailSenders`; without it the app sends from the brand. */
1403
+ senderIdentityId?: string | null;
1404
+ /** Single line, shown in the From header. */
1405
+ displayName?: string | null;
1406
+ replyTo?: string | null;
1407
+ }
1306
1408
  interface AppContext {
1307
1409
  appId: string;
1308
1410
  app: AppDefinition;
@@ -1795,8 +1897,48 @@ interface MessengerModule {
1795
1897
  notify(content: string): Promise<MessageAccepted>;
1796
1898
  /** Sends an email from the app's sender; only the app's backend token may send. */
1797
1899
  sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
1798
- }
1799
- declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
1900
+ /**
1901
+ * Lists the current app's email templates: the platform row (`platformDefault: true`) of every
1902
+ * type and, beside it, the app's row for each type the app has rewritten.
1903
+ */
1904
+ listEmailTemplates(): Promise<EmailTemplate[]>;
1905
+ /** Gets the variables a type accepts, referenced as `$name` in the subject and HTML body. */
1906
+ getEmailTemplateType(type: EmailTemplateType): Promise<EmailTemplateTypeCatalog>;
1907
+ /** Gets the current app's version of a template, or the platform text when it has none. */
1908
+ getEmailTemplate(type: EmailTemplateType): Promise<EmailTemplate>;
1909
+ /**
1910
+ * Replaces the current app's version of a template and renders its preview. Every required
1911
+ * variable must appear in the subject or the HTML body.
1912
+ */
1913
+ upsertEmailTemplate(type: EmailTemplateType, input: EmailTemplateInput): Promise<EmailTemplateUpsertResult>;
1914
+ /**
1915
+ * Renders the app's saved template, or the platform one, with the catalog's sample values. It
1916
+ * does not prove which HTML goes out: the sender and the brand policy decide that at send time.
1917
+ */
1918
+ previewEmailTemplate(type: EmailTemplateType): Promise<EmailTemplatePreview>;
1919
+ /** Deletes the current app's version of a template, so the platform text applies again. */
1920
+ deleteEmailTemplate(type: EmailTemplateType): Promise<void>;
1921
+ /** Lists the addresses available as senders in the workspace of the token. */
1922
+ listEmailSenders(): Promise<EmailSender[]>;
1923
+ /**
1924
+ * Registers an address in the name of the person in the token and makes it available in the
1925
+ * app's workspace. An address the person already owns comes back as saved, made available too.
1926
+ * Messenger mails a verification link and a 6-digit code to the address.
1927
+ */
1928
+ registerEmailSender(input: EmailSenderInput): Promise<EmailSender>;
1929
+ /**
1930
+ * Mails the AWS link again while AWS has not verified the address, and a new code only while
1931
+ * the person has not confirmed one yet.
1932
+ */
1933
+ resendEmailSenderVerification(senderId: string): Promise<EmailSender>;
1934
+ /** Confirms the 6-digit code the person read in the mailbox of the address. */
1935
+ confirmEmailSender(senderId: string, code: string): Promise<EmailSender>;
1936
+ /** Gets the current app's sender settings and the From its emails use now. */
1937
+ getEmailSettings(): Promise<EmailSettings>;
1938
+ /** Replaces the current app's sender settings; a field left out is cleared. */
1939
+ updateEmailSettings(input: EmailSettingsInput): Promise<EmailSettings>;
1940
+ }
1941
+ declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory, getAppId?: () => string | undefined): MessengerModule;
1800
1942
 
1801
1943
  interface PublicFunctionsModule {
1802
1944
  /**
@@ -1868,7 +2010,7 @@ interface SdkCoreTransports {
1868
2010
  codeStudio?: Transport;
1869
2011
  /** Copilot transport for tasks, credentials, models, and app connections. */
1870
2012
  copilot?: Transport;
1871
- /** Messenger transport for current-user notifications. */
2013
+ /** Messenger transport for current-user notifications, app emails, and their templates. */
1872
2014
  messenger?: Transport;
1873
2015
  /**
1874
2016
  * Anonymous Functions transport. It must not add Authorization or X-App-Id headers.
@@ -2188,4 +2330,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
2188
2330
  declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
2189
2331
  declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
2190
2332
 
2191
- export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentInput, type AgentMessage, type AgentModel, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
2333
+ export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentDirectChannelOptions, type AgentFetch, type AgentFetchResponse, type AgentInput, type AgentMessage, type AgentModel, type AgentProviderUsage, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskChannel, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentTurnUsage, type AgentTurnUsageRequest, type AgentUpdateItem, type AgentWebSocket, type AgentWebSocketConstructor, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CredentialUsage, type CredentialUsageWindow, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EffectiveEmailSender, type EmailSender, type EmailSenderInput, type EmailSettings, type EmailSettingsInput, type EmailTemplate, type EmailTemplateInput, type EmailTemplatePreview, type EmailTemplateType, type EmailTemplateTypeCatalog, type EmailTemplateUpsertResult, type EmailTemplateVariable, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SendEmailInput, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };