@mitralab.io/sdk-core 0.2.13 → 0.2.14
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/CHANGELOG.md +19 -0
- package/README.md +3 -1
- package/contracts/README.md +5 -0
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.14/sdk-parity.json +2902 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +25 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -508,6 +508,9 @@ function expectAppFields(app, context, errors) {
|
|
|
508
508
|
if (!isNullableString(app.icon)) invalidField(context, "icon", errors);
|
|
509
509
|
if (!isNullableString(app.template)) invalidField(context, "template", errors);
|
|
510
510
|
if (typeof app.allowSignup !== "boolean") invalidField(context, "allowSignup", errors);
|
|
511
|
+
for (const field of ["emailLoginEnabled", "passwordLoginEnabled"]) {
|
|
512
|
+
if (field in app && typeof app[field] !== "boolean") invalidField(context, field, errors);
|
|
513
|
+
}
|
|
511
514
|
if (typeof app.externalAccessEnabled !== "boolean") {
|
|
512
515
|
invalidField(context, "externalAccessEnabled", errors);
|
|
513
516
|
}
|
|
@@ -2932,9 +2935,31 @@ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
|
2932
2935
|
"Notify user response",
|
|
2933
2936
|
errors
|
|
2934
2937
|
);
|
|
2938
|
+
},
|
|
2939
|
+
async sendEmail(input) {
|
|
2940
|
+
return expectMessageAccepted(
|
|
2941
|
+
await transport.request("/api/v1/messages/send", {
|
|
2942
|
+
method: "POST",
|
|
2943
|
+
body: { channel: "EMAIL", payload: rawEmailPayload(input) }
|
|
2944
|
+
}),
|
|
2945
|
+
"Send email response",
|
|
2946
|
+
errors
|
|
2947
|
+
);
|
|
2935
2948
|
}
|
|
2936
2949
|
};
|
|
2937
2950
|
}
|
|
2951
|
+
function rawEmailPayload(input) {
|
|
2952
|
+
return {
|
|
2953
|
+
type: "RAW",
|
|
2954
|
+
to: input.to,
|
|
2955
|
+
...input.cc === void 0 ? {} : { cc: input.cc },
|
|
2956
|
+
...input.bcc === void 0 ? {} : { bcc: input.bcc },
|
|
2957
|
+
...input.replyTo === void 0 ? {} : { replyTo: input.replyTo },
|
|
2958
|
+
subject: input.subject,
|
|
2959
|
+
html: input.html,
|
|
2960
|
+
...input.text === void 0 ? {} : { text: input.text }
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2938
2963
|
|
|
2939
2964
|
// src/modules/publicFunctions.ts
|
|
2940
2965
|
function createPublicFunctionsModule(transport, errors = defaultSdkCoreErrorFactory) {
|
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,28 @@ interface AgentConnection {
|
|
|
1266
1281
|
customProviders?: AgentConnectionCustomProvider[];
|
|
1267
1282
|
}
|
|
1268
1283
|
interface MessageAccepted {
|
|
1269
|
-
/** Identifier assigned by Messenger to the accepted
|
|
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
|
+
}
|
|
1272
1306
|
interface AppContext {
|
|
1273
1307
|
appId: string;
|
|
1274
1308
|
app: AppDefinition;
|
|
@@ -1759,6 +1793,8 @@ declare function createMembersModule(transport: Transport, errors?: SdkCoreError
|
|
|
1759
1793
|
interface MessengerModule {
|
|
1760
1794
|
/** Sends plain text to the authenticated user; channel rendering may support markdown. */
|
|
1761
1795
|
notify(content: string): Promise<MessageAccepted>;
|
|
1796
|
+
/** Sends an email from the app's sender; only the app's backend token may send. */
|
|
1797
|
+
sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
|
|
1762
1798
|
}
|
|
1763
1799
|
declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
|
|
1764
1800
|
|
|
@@ -2152,4 +2188,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
2152
2188
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
2153
2189
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
2154
2190
|
|
|
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 };
|
|
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 };
|
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,28 @@ interface AgentConnection {
|
|
|
1266
1281
|
customProviders?: AgentConnectionCustomProvider[];
|
|
1267
1282
|
}
|
|
1268
1283
|
interface MessageAccepted {
|
|
1269
|
-
/** Identifier assigned by Messenger to the accepted
|
|
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
|
+
}
|
|
1272
1306
|
interface AppContext {
|
|
1273
1307
|
appId: string;
|
|
1274
1308
|
app: AppDefinition;
|
|
@@ -1759,6 +1793,8 @@ declare function createMembersModule(transport: Transport, errors?: SdkCoreError
|
|
|
1759
1793
|
interface MessengerModule {
|
|
1760
1794
|
/** Sends plain text to the authenticated user; channel rendering may support markdown. */
|
|
1761
1795
|
notify(content: string): Promise<MessageAccepted>;
|
|
1796
|
+
/** Sends an email from the app's sender; only the app's backend token may send. */
|
|
1797
|
+
sendEmail(input: SendEmailInput): Promise<MessageAccepted>;
|
|
1762
1798
|
}
|
|
1763
1799
|
declare function createMessengerModule(transport: Transport, errors?: SdkCoreErrorFactory): MessengerModule;
|
|
1764
1800
|
|
|
@@ -2152,4 +2188,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
2152
2188
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
2153
2189
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
2154
2190
|
|
|
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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -436,6 +436,9 @@ function expectAppFields(app, context, errors) {
|
|
|
436
436
|
if (!isNullableString(app.icon)) invalidField(context, "icon", errors);
|
|
437
437
|
if (!isNullableString(app.template)) invalidField(context, "template", errors);
|
|
438
438
|
if (typeof app.allowSignup !== "boolean") invalidField(context, "allowSignup", errors);
|
|
439
|
+
for (const field of ["emailLoginEnabled", "passwordLoginEnabled"]) {
|
|
440
|
+
if (field in app && typeof app[field] !== "boolean") invalidField(context, field, errors);
|
|
441
|
+
}
|
|
439
442
|
if (typeof app.externalAccessEnabled !== "boolean") {
|
|
440
443
|
invalidField(context, "externalAccessEnabled", errors);
|
|
441
444
|
}
|
|
@@ -2860,9 +2863,31 @@ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
|
2860
2863
|
"Notify user response",
|
|
2861
2864
|
errors
|
|
2862
2865
|
);
|
|
2866
|
+
},
|
|
2867
|
+
async sendEmail(input) {
|
|
2868
|
+
return expectMessageAccepted(
|
|
2869
|
+
await transport.request("/api/v1/messages/send", {
|
|
2870
|
+
method: "POST",
|
|
2871
|
+
body: { channel: "EMAIL", payload: rawEmailPayload(input) }
|
|
2872
|
+
}),
|
|
2873
|
+
"Send email response",
|
|
2874
|
+
errors
|
|
2875
|
+
);
|
|
2863
2876
|
}
|
|
2864
2877
|
};
|
|
2865
2878
|
}
|
|
2879
|
+
function rawEmailPayload(input) {
|
|
2880
|
+
return {
|
|
2881
|
+
type: "RAW",
|
|
2882
|
+
to: input.to,
|
|
2883
|
+
...input.cc === void 0 ? {} : { cc: input.cc },
|
|
2884
|
+
...input.bcc === void 0 ? {} : { bcc: input.bcc },
|
|
2885
|
+
...input.replyTo === void 0 ? {} : { replyTo: input.replyTo },
|
|
2886
|
+
subject: input.subject,
|
|
2887
|
+
html: input.html,
|
|
2888
|
+
...input.text === void 0 ? {} : { text: input.text }
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2866
2891
|
|
|
2867
2892
|
// src/modules/publicFunctions.ts
|
|
2868
2893
|
function createPublicFunctionsModule(transport, errors = defaultSdkCoreErrorFactory) {
|