@mitralab.io/sdk-core 0.2.13 → 0.2.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.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
  }
@@ -508,6 +511,9 @@ function expectAppFields(app, context, errors) {
508
511
  if (!isNullableString(app.icon)) invalidField(context, "icon", errors);
509
512
  if (!isNullableString(app.template)) invalidField(context, "template", errors);
510
513
  if (typeof app.allowSignup !== "boolean") invalidField(context, "allowSignup", errors);
514
+ for (const field of ["emailLoginEnabled", "passwordLoginEnabled"]) {
515
+ if (field in app && typeof app[field] !== "boolean") invalidField(context, field, errors);
516
+ }
511
517
  if (typeof app.externalAccessEnabled !== "boolean") {
512
518
  invalidField(context, "externalAccessEnabled", errors);
513
519
  }
@@ -750,6 +756,48 @@ function expectMessageAccepted(value, context, errors = defaultSdkCoreErrorFacto
750
756
  if (typeof response.messageId !== "string") invalidField(context, "messageId", errors);
751
757
  return response;
752
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
+ }
753
801
  function expectAgentDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
754
802
  const agent = expectObject(value, context, errors);
755
803
  if (typeof agent.id !== "string") invalidField(context, "id", errors);
@@ -2921,7 +2969,21 @@ function createMembersModule(transport, errors = defaultSdkCoreErrorFactory) {
2921
2969
  }
2922
2970
 
2923
2971
  // src/modules/messenger.ts
2924
- function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
2972
+ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory, getAppId) {
2973
+ const templatePath = (type) => `/api/v1/email/templates/${encodePathSegment(type, "email template type", errors)}`;
2974
+ const currentAppId = () => {
2975
+ const appId = getAppId?.();
2976
+ if (!appId) configurationError("An appId is required for email templates", errors);
2977
+ return appId;
2978
+ };
2979
+ const preview = async (type, appId) => expectEmailTemplatePreview(
2980
+ await transport.request(`${templatePath(type)}/preview`, {
2981
+ method: "GET",
2982
+ params: { appId }
2983
+ }),
2984
+ "Email template preview response",
2985
+ errors
2986
+ );
2925
2987
  return {
2926
2988
  async notify(content) {
2927
2989
  return expectMessageAccepted(
@@ -2932,9 +2994,99 @@ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
2932
2994
  "Notify user response",
2933
2995
  errors
2934
2996
  );
2997
+ },
2998
+ async sendEmail(input) {
2999
+ return expectMessageAccepted(
3000
+ await transport.request("/api/v1/messages/send", {
3001
+ method: "POST",
3002
+ body: { channel: "EMAIL", payload: rawEmailPayload(input) }
3003
+ }),
3004
+ "Send email response",
3005
+ errors
3006
+ );
3007
+ },
3008
+ async listEmailTemplates() {
3009
+ return expectObjectArray(
3010
+ await transport.request("/api/v1/email/templates", {
3011
+ method: "GET",
3012
+ params: { appId: currentAppId() }
3013
+ }),
3014
+ "Email template list response",
3015
+ errors,
3016
+ expectEmailTemplate
3017
+ );
3018
+ },
3019
+ async getEmailTemplateType(type) {
3020
+ return expectEmailTemplateTypeCatalog(
3021
+ await transport.request(
3022
+ `/api/v1/email/template-types/${encodePathSegment(type, "email template type", errors)}`,
3023
+ { method: "GET" }
3024
+ ),
3025
+ "Email template type response",
3026
+ errors
3027
+ );
3028
+ },
3029
+ async getEmailTemplate(type) {
3030
+ return expectEmailTemplate(
3031
+ await transport.request(templatePath(type), {
3032
+ method: "GET",
3033
+ params: { appId: currentAppId() }
3034
+ }),
3035
+ "Email template response",
3036
+ errors
3037
+ );
3038
+ },
3039
+ async upsertEmailTemplate(type, input) {
3040
+ const appId = currentAppId();
3041
+ const template = expectEmailTemplate(
3042
+ await transport.request(templatePath(type), {
3043
+ method: "PUT",
3044
+ body: templateBody(appId, input)
3045
+ }),
3046
+ "Upsert email template response",
3047
+ errors
3048
+ );
3049
+ try {
3050
+ return { template, preview: await preview(type, appId) };
3051
+ } catch (previewError) {
3052
+ return { template, preview: null, previewError };
3053
+ }
3054
+ },
3055
+ async previewEmailTemplate(type) {
3056
+ return preview(type, currentAppId());
3057
+ },
3058
+ async deleteEmailTemplate(type) {
3059
+ expectEmpty(
3060
+ await transport.request(templatePath(type), {
3061
+ method: "DELETE",
3062
+ params: { appId: currentAppId() }
3063
+ }),
3064
+ "Delete email template response",
3065
+ errors
3066
+ );
2935
3067
  }
2936
3068
  };
2937
3069
  }
3070
+ function rawEmailPayload(input) {
3071
+ return {
3072
+ type: "RAW",
3073
+ to: input.to,
3074
+ ...input.cc === void 0 ? {} : { cc: input.cc },
3075
+ ...input.bcc === void 0 ? {} : { bcc: input.bcc },
3076
+ ...input.replyTo === void 0 ? {} : { replyTo: input.replyTo },
3077
+ subject: input.subject,
3078
+ html: input.html,
3079
+ ...input.text === void 0 ? {} : { text: input.text }
3080
+ };
3081
+ }
3082
+ function templateBody(appId, input) {
3083
+ return {
3084
+ appId,
3085
+ subject: input.subject,
3086
+ htmlBody: input.htmlBody,
3087
+ ...input.textBody === void 0 ? {} : { textBody: input.textBody }
3088
+ };
3089
+ }
2938
3090
 
2939
3091
  // src/modules/publicFunctions.ts
2940
3092
  function createPublicFunctionsModule(transport, errors = defaultSdkCoreErrorFactory) {
@@ -3252,7 +3404,7 @@ function createSdkCore(options) {
3252
3404
  integrationResources: createIntegrationResourcesModule(options.transports.integration, errors),
3253
3405
  integrationTemplates: createIntegrationTemplatesModule(options.transports.integration, errors),
3254
3406
  members,
3255
- messenger: createMessengerModule(messengerTransport, errors),
3407
+ messenger: createMessengerModule(messengerTransport, errors, options.getAppId),
3256
3408
  publicFunctions: createPublicFunctionsModule(options.transports.publicFunctions, errors),
3257
3409
  queries: createQueriesModule(options.transports.dataManager, errors),
3258
3410
  sql: createSqlModule(options.transports.dataManager, errors),
package/dist/index.d.cts CHANGED
@@ -589,6 +589,13 @@ interface AppUpdateInput {
589
589
  icon?: string;
590
590
  /** Whether users may sign up through this app. Omission preserves the current value. */
591
591
  allowSignup?: boolean;
592
+ /** Whether users may sign in with a code sent by email. Omission preserves the current value. */
593
+ emailLoginEnabled?: boolean;
594
+ /**
595
+ * Whether users may sign in with a password. Omission preserves the current value. Code Studio
596
+ * rejects `true` while the app inherits the platform login.
597
+ */
598
+ passwordLoginEnabled?: boolean;
592
599
  }
593
600
  interface AppDomain {
594
601
  hostname: string;
@@ -610,6 +617,10 @@ interface AppSummary {
610
617
  template: string | null;
611
618
  planId: string;
612
619
  allowSignup: boolean;
620
+ /** Absent on a Code Studio that predates email login. */
621
+ emailLoginEnabled?: boolean;
622
+ /** Absent on a Code Studio that predates password login. */
623
+ passwordLoginEnabled?: boolean;
613
624
  externalAccessEnabled: boolean;
614
625
  currentVersion: AppVersion | null;
615
626
  createdAt: string;
@@ -630,6 +641,10 @@ interface AppDefinition {
630
641
  planId: string;
631
642
  template: string | null;
632
643
  allowSignup: boolean;
644
+ /** Absent on a Code Studio that predates email login. */
645
+ emailLoginEnabled?: boolean;
646
+ /** Absent on a Code Studio that predates password login. */
647
+ passwordLoginEnabled?: boolean;
633
648
  externalAccessEnabled: boolean;
634
649
  currentVersion: AppVersion | null;
635
650
  createdAt: string;
@@ -1266,9 +1281,83 @@ interface AgentConnection {
1266
1281
  customProviders?: AgentConnectionCustomProvider[];
1267
1282
  }
1268
1283
  interface MessageAccepted {
1269
- /** Identifier assigned by Messenger to the accepted notification. */
1284
+ /** Identifier assigned by Messenger to the accepted message. */
1270
1285
  messageId: string;
1271
1286
  }
1287
+ /**
1288
+ * Email sent with the app's sender. There is no `from` because Messenger picks the sender from
1289
+ * the app in the token, and only the app's backend sends: a token exchanged from an api key or
1290
+ * the Server Function token. An app end-user token is refused with `403`. Recipient and content
1291
+ * rules, such as Messenger's cap on recipients across `to`, `cc` and `bcc`, are enforced there.
1292
+ */
1293
+ interface SendEmailInput {
1294
+ /** One address per entry. */
1295
+ to: string[];
1296
+ /** One address per entry. */
1297
+ cc?: string[];
1298
+ /** One address per entry. */
1299
+ bcc?: string[];
1300
+ replyTo?: string;
1301
+ subject: string;
1302
+ html: string;
1303
+ /** Plain-text alternative for clients that do not render HTML. */
1304
+ text?: string;
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
+ }
1272
1361
  interface AppContext {
1273
1362
  appId: string;
1274
1363
  app: AppDefinition;
@@ -1759,8 +1848,31 @@ declare function createMembersModule(transport: Transport, errors?: SdkCoreError
1759
1848
  interface MessengerModule {
1760
1849
  /** Sends plain text to the authenticated user; channel rendering may support markdown. */
1761
1850
  notify(content: string): Promise<MessageAccepted>;
1851
+ /** Sends an email from the app's sender; only the app's backend token may send. */
1852
+ sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
1853
+ /**
1854
+ * Lists the current app's email templates: the platform row (`platformDefault: true`) of every
1855
+ * type and, beside it, the app's row for each type the app has rewritten.
1856
+ */
1857
+ listEmailTemplates(): Promise<EmailTemplate[]>;
1858
+ /** Gets the variables a type accepts, referenced as `$name` in the subject and HTML body. */
1859
+ getEmailTemplateType(type: EmailTemplateType): Promise<EmailTemplateTypeCatalog>;
1860
+ /** Gets the current app's version of a template, or the platform text when it has none. */
1861
+ getEmailTemplate(type: EmailTemplateType): Promise<EmailTemplate>;
1862
+ /**
1863
+ * Replaces the current app's version of a template and renders its preview. Every required
1864
+ * variable must appear in the subject or the HTML body.
1865
+ */
1866
+ upsertEmailTemplate(type: EmailTemplateType, input: EmailTemplateInput): Promise<EmailTemplateUpsertResult>;
1867
+ /**
1868
+ * Renders the app's saved template, or the platform one, with the catalog's sample values. It
1869
+ * does not prove which HTML goes out: the sender and the brand policy decide that at send time.
1870
+ */
1871
+ previewEmailTemplate(type: EmailTemplateType): Promise<EmailTemplatePreview>;
1872
+ /** Deletes the current app's version of a template, so the platform text applies again. */
1873
+ deleteEmailTemplate(type: EmailTemplateType): Promise<void>;
1762
1874
  }
1763
- declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
1875
+ declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory, getAppId?: () => string | undefined): MessengerModule;
1764
1876
 
1765
1877
  interface PublicFunctionsModule {
1766
1878
  /**
@@ -1832,7 +1944,7 @@ interface SdkCoreTransports {
1832
1944
  codeStudio?: Transport;
1833
1945
  /** Copilot transport for tasks, credentials, models, and app connections. */
1834
1946
  copilot?: Transport;
1835
- /** Messenger transport for current-user notifications. */
1947
+ /** Messenger transport for current-user notifications, app emails, and their templates. */
1836
1948
  messenger?: Transport;
1837
1949
  /**
1838
1950
  * Anonymous Functions transport. It must not add Authorization or X-App-Id headers.
@@ -2152,4 +2264,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
2152
2264
  declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
2153
2265
  declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
2154
2266
 
2155
- 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 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 };
2267
+ 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 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
@@ -589,6 +589,13 @@ interface AppUpdateInput {
589
589
  icon?: string;
590
590
  /** Whether users may sign up through this app. Omission preserves the current value. */
591
591
  allowSignup?: boolean;
592
+ /** Whether users may sign in with a code sent by email. Omission preserves the current value. */
593
+ emailLoginEnabled?: boolean;
594
+ /**
595
+ * Whether users may sign in with a password. Omission preserves the current value. Code Studio
596
+ * rejects `true` while the app inherits the platform login.
597
+ */
598
+ passwordLoginEnabled?: boolean;
592
599
  }
593
600
  interface AppDomain {
594
601
  hostname: string;
@@ -610,6 +617,10 @@ interface AppSummary {
610
617
  template: string | null;
611
618
  planId: string;
612
619
  allowSignup: boolean;
620
+ /** Absent on a Code Studio that predates email login. */
621
+ emailLoginEnabled?: boolean;
622
+ /** Absent on a Code Studio that predates password login. */
623
+ passwordLoginEnabled?: boolean;
613
624
  externalAccessEnabled: boolean;
614
625
  currentVersion: AppVersion | null;
615
626
  createdAt: string;
@@ -630,6 +641,10 @@ interface AppDefinition {
630
641
  planId: string;
631
642
  template: string | null;
632
643
  allowSignup: boolean;
644
+ /** Absent on a Code Studio that predates email login. */
645
+ emailLoginEnabled?: boolean;
646
+ /** Absent on a Code Studio that predates password login. */
647
+ passwordLoginEnabled?: boolean;
633
648
  externalAccessEnabled: boolean;
634
649
  currentVersion: AppVersion | null;
635
650
  createdAt: string;
@@ -1266,9 +1281,83 @@ interface AgentConnection {
1266
1281
  customProviders?: AgentConnectionCustomProvider[];
1267
1282
  }
1268
1283
  interface MessageAccepted {
1269
- /** Identifier assigned by Messenger to the accepted notification. */
1284
+ /** Identifier assigned by Messenger to the accepted message. */
1270
1285
  messageId: string;
1271
1286
  }
1287
+ /**
1288
+ * Email sent with the app's sender. There is no `from` because Messenger picks the sender from
1289
+ * the app in the token, and only the app's backend sends: a token exchanged from an api key or
1290
+ * the Server Function token. An app end-user token is refused with `403`. Recipient and content
1291
+ * rules, such as Messenger's cap on recipients across `to`, `cc` and `bcc`, are enforced there.
1292
+ */
1293
+ interface SendEmailInput {
1294
+ /** One address per entry. */
1295
+ to: string[];
1296
+ /** One address per entry. */
1297
+ cc?: string[];
1298
+ /** One address per entry. */
1299
+ bcc?: string[];
1300
+ replyTo?: string;
1301
+ subject: string;
1302
+ html: string;
1303
+ /** Plain-text alternative for clients that do not render HTML. */
1304
+ text?: string;
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
+ }
1272
1361
  interface AppContext {
1273
1362
  appId: string;
1274
1363
  app: AppDefinition;
@@ -1759,8 +1848,31 @@ declare function createMembersModule(transport: Transport, errors?: SdkCoreError
1759
1848
  interface MessengerModule {
1760
1849
  /** Sends plain text to the authenticated user; channel rendering may support markdown. */
1761
1850
  notify(content: string): Promise<MessageAccepted>;
1851
+ /** Sends an email from the app's sender; only the app's backend token may send. */
1852
+ sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
1853
+ /**
1854
+ * Lists the current app's email templates: the platform row (`platformDefault: true`) of every
1855
+ * type and, beside it, the app's row for each type the app has rewritten.
1856
+ */
1857
+ listEmailTemplates(): Promise<EmailTemplate[]>;
1858
+ /** Gets the variables a type accepts, referenced as `$name` in the subject and HTML body. */
1859
+ getEmailTemplateType(type: EmailTemplateType): Promise<EmailTemplateTypeCatalog>;
1860
+ /** Gets the current app's version of a template, or the platform text when it has none. */
1861
+ getEmailTemplate(type: EmailTemplateType): Promise<EmailTemplate>;
1862
+ /**
1863
+ * Replaces the current app's version of a template and renders its preview. Every required
1864
+ * variable must appear in the subject or the HTML body.
1865
+ */
1866
+ upsertEmailTemplate(type: EmailTemplateType, input: EmailTemplateInput): Promise<EmailTemplateUpsertResult>;
1867
+ /**
1868
+ * Renders the app's saved template, or the platform one, with the catalog's sample values. It
1869
+ * does not prove which HTML goes out: the sender and the brand policy decide that at send time.
1870
+ */
1871
+ previewEmailTemplate(type: EmailTemplateType): Promise<EmailTemplatePreview>;
1872
+ /** Deletes the current app's version of a template, so the platform text applies again. */
1873
+ deleteEmailTemplate(type: EmailTemplateType): Promise<void>;
1762
1874
  }
1763
- declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
1875
+ declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory, getAppId?: () => string | undefined): MessengerModule;
1764
1876
 
1765
1877
  interface PublicFunctionsModule {
1766
1878
  /**
@@ -1832,7 +1944,7 @@ interface SdkCoreTransports {
1832
1944
  codeStudio?: Transport;
1833
1945
  /** Copilot transport for tasks, credentials, models, and app connections. */
1834
1946
  copilot?: Transport;
1835
- /** Messenger transport for current-user notifications. */
1947
+ /** Messenger transport for current-user notifications, app emails, and their templates. */
1836
1948
  messenger?: Transport;
1837
1949
  /**
1838
1950
  * Anonymous Functions transport. It must not add Authorization or X-App-Id headers.
@@ -2152,4 +2264,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
2152
2264
  declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
2153
2265
  declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
2154
2266
 
2155
- 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 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 };
2267
+ 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 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 };