From 7beb40be77dd6ab5110e87f6465f7d3d7990a37d Mon Sep 17 00:00:00 2001 From: CodeMash Date: Mon, 5 Oct 2026 23:53:23 +0300 Subject: [PATCH 1/5] chore(references): refresh hub and api DTO references from the gateway Taken from /types/python and /types/typescript of Community Hub and Api hosts built from gateway refactoringV2 (database last wave): AllRecords on UpdateMany / DeleteMany, TaxonomyRef dependency pairs, Env on schema triggers, RenameUniqueName removed, JoinedCollections on aggregates. api2.dtos.ts was last refreshed from ServiceStack 8.30, so its diff is large. Header Date / Version / BaseUrl kept as before. Reference only; nothing imports it. Co-Authored-By: Claude Opus 5.5 --- references/api2.dtos.ts | 7255 ++++++++++++++++----------------------- references/api_dtos.py | 427 +++ references/hub2.dtos.ts | 209 +- references/hub_dtos.py | 171 +- 4 files changed, 3514 insertions(+), 4548 deletions(-) diff --git a/references/api2.dtos.ts b/references/api2.dtos.ts index e2c4a22..3658882 100644 --- a/references/api2.dtos.ts +++ b/references/api2.dtos.ts @@ -15,4841 +15,3536 @@ AddDescriptionAsComments: True //DefaultImports: */ -export module CodeMashApi2 { - export interface IReturn { - createResponse(): T; - } - export interface IReturnVoid { - createResponse(): void; - } +export module CodeMashApi2 +{ + // @ts-nocheck - export interface IHasSessionId { - sessionId?: string; - } + export interface IReturn + { + createResponse(): T; + } - export interface IHasBearerToken { - bearerToken?: string; - } + export interface IReturnVoid + { + createResponse(): void; + } - export interface IPost {} + export interface IHasSessionId + { + sessionId?: string; + } - export interface IGet {} + export interface IHasBearerToken + { + bearerToken?: string; + } - export class ValueObject { - public constructor(init?: Partial) { - (Object as any).assign(this, init); + export interface IPost + { } - } - // @DataContract - export class BindableTemplate extends ValueObject { - // @DataMember - public code: RazorTemplateCode; + // @DataContract(Namespace="http://codemash.io/types/") + export class RequestBase implements ICultureBasedRequest, IVersionBasedRequest, IHasCorrelationIdRequest + { + /** @description Specify culture code when your response from the API should be localised. E.g.: en */ + // @DataMember + // @ApiMember(DataType="string", Description="Specify culture code when your response from the API should be localised. E.g.: en", Name="CultureCode", ParameterType="header") + public cultureCode?: string; - public constructor(init?: Partial>) { - super(init); - (Object as any).assign(this, init); - } - } + /** @description TimeZone */ + // @DataMember + // @ApiMember(DataType="string", Description="TimeZone", Name="TimeZoneId", ParameterType="header") + public timeZoneId?: string; - // @DataContract - export class MessageTranslation extends ValueObject { - // @DataMember - public language: Language; + /** @description The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v3 */ + // @DataMember + // @ApiMember(DataType="string", Description="The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v3", IsRequired=true, Name="version", ParameterType="path") + public version: string; - // @DataMember - public content: TContent; + /** @description CorrelationId for each request */ + // @DataMember + // @ApiMember(DataType="string", Description="CorrelationId for each request", Name="CorrelationId", ParameterType="header") + public correlationId?: string; - public constructor(init?: Partial>) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class EmailAddress extends ValueObject { - // @DataMember - public address: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export interface ICultureBasedRequest + { + cultureCode?: string; } - } - // @DataContract - export class DisplayName extends ValueObject { - // @DataMember - public value: string; + export interface IVersionBasedRequest + { + version: string; + } - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export interface IHasCorrelationIdRequest + { + correlationId?: string; } - } - // @DataContract - export class ProjectName extends ValueObject { - // @DataMember - public name: string; + // @DataContract(Namespace="http://codemash.io/types/") + export class CodeMashRequestBase extends RequestBase implements IHasProjectId, IHasEnv + { + /** @description ID of your project. Can be passed in a header as norbix-project-id. */ + // @DataMember + // @ApiMember(DataType="string", Description="ID of your project. Can be passed in a header as norbix-project-id.", IsRequired=true, Name="norbix-project-id", ParameterType="header") + public projectId: string; + + /** @description Target environment for this request (e.g. TEST, STAGING). Optional — when omitted the request runs against PROD. Can be passed in a header as norbix-env. */ + // @DataMember + // @ApiMember(DataType="string", Description="Target environment for this request (e.g. TEST, STAGING). Optional — when omitted the request runs against PROD. Can be passed in a header as norbix-env.", Name="norbix-env", ParameterType="header") + public env?: string; - // @DataMember - public uniqueName: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export interface IHasProjectId + { + projectId: string; } - } - // @DataContract - export class AccountOwner extends ValueObject { - // @DataMember - public email: EmailAddress; + export interface IHasEnv + { + env?: string; + } - // @DataMember - public displayName?: DisplayName; + export enum Gender + { + Male = 'Male', + Female = 'Female', + Other = 'Other', + } - // @DataMember - public billingEmail?: EmailAddress; + export enum MarketingBlockReason + { + Unspecified = 'Unspecified', + Unsubscribed = 'Unsubscribed', + Complaint = 'Complaint', + HardBounce = 'HardBounce', + InvalidEmail = 'InvalidEmail', + AdminBlock = 'AdminBlock', + } - // @DataMember - public operationsEmail?: EmailAddress; + export class UserGeneralInfoDto + { + public phone?: string; + public primaryEmail?: string; + public displayName?: string; + public firstName?: string; + public lastName?: string; + public fullName?: string; + public addressLine1?: string; + public addressLine2?: string; + public country?: string; + public city?: string; + public state?: string; + public postalCode?: string; + public company?: string; + public gender?: Gender; + public birthDate?: number; + public timeZone?: string; + public language?: string; + public blockAllMarketingMessages: boolean; + public blockedTags?: { [index:string]: HashSet; }; + public blockReasons?: MarketingBlockReason[]; + public extraMetadata?: string; + public notes?: string; - // @DataMember - public securityEmail?: EmailAddress; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public permissions?: string[]; + // @DataContract + export class SaveUser extends CodeMashRequestBase + { + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; - // @DataMember - public allowedProjects?: ProjectName[]; + /** @description User Info */ + // @DataMember + // @ApiMember(DataType="object", Description="User Info", Name="UserGeneralInfo", ParameterType="body") + public userGeneralInfo?: UserGeneralInfoDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + /** @description Attach this login to an existing user id. Optional. */ + // @DataMember + // @ApiMember(Description="Attach this login to an existing user id. Optional.") + public userId?: string; - // @DataContract - export class AggregateId extends ValueObject { - // @DataMember - public id: string; + /** @description Ignore UserRegistersAsRole from Membership Settings */ + // @DataMember + // @ApiMember(DataType="boolean", Description="Ignore UserRegistersAsRole from Membership Settings", Name="IgnoreUserRegistersAsRole", ParameterType="body") + public ignoreUserRegistersAsRole: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class AccountId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataContract + export class SaveUserWithRolesBase extends SaveUser + { + // @DataMember + public roles: string[] = []; - export class HashedToken extends ValueObject { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export enum ValidationType { - AccountAdmin = 'AccountAdmin', - AccountUser = 'AccountUser', - ProjectUser = 'ProjectUser', - } + export class CodeMashListPaginationRequestBase extends RequestBase implements IHasProjectId, IHasEnv + { + /** @description ID of your project. Can be passed in a header as norbix-project-id. */ + // @DataMember + // @ApiMember(DataType="string", Description="ID of your project. Can be passed in a header as norbix-project-id.", IsRequired=true, Name="norbix-project-id", ParameterType="header") + public projectId: string; - export class ProjectId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + /** @description Target environment for this request (e.g. TEST, STAGING). Optional — when omitted the request runs against PROD. Can be passed in a header as norbix-env. */ + // @DataMember + // @ApiMember(DataType="string", Description="Target environment for this request (e.g. TEST, STAGING). Optional — when omitted the request runs against PROD. Can be passed in a header as norbix-env.", Name="norbix-env", ParameterType="header") + public env?: string; - // @DataContract - export class UserId extends ValueObject { - // @DataMember - public id: string; + /** @description Cursor token — fetch the page AFTER this item. */ + // @DataMember + // @ApiMember(DataType="string", Description="Cursor token — fetch the page AFTER this item.", Name="startingAfter", ParameterType="query") + public startingAfter?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + /** @description Cursor token — fetch the page BEFORE this item. */ + // @DataMember + // @ApiMember(DataType="string", Description="Cursor token — fetch the page BEFORE this item.", Name="endingBefore", ParameterType="query") + public endingBefore?: string; - export class ValidationToken extends HashedToken { - public token: string; - public createDate: string; - public validUntil?: string; - public type: ValidationType; - public projectId: ProjectId; - public accountId: AccountId; - public accountOwner: AccountOwner; - public userId: UserId; + /** @description Amount of records to return. */ + // @DataMember + // @ApiMember(DataType="integer", Description="Amount of records to return.", Format="int32", Name="pageSize", ParameterType="query") + public pageSize?: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class CodeMashSubscriptionId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export interface IPasskeyCeremonyRequest + { } - } - export class UtcDateTime extends ValueObject { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export class CursorArgs implements ICursorArgs + { + public field: string; + public order: number; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class Quantity extends ValueObject { - public value: number; + export class PagingArgs + { + public cursorArgs?: CursorArgs; + public pageSize?: number; + public startingAfter?: string; + public endingBefore?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class CodeMashManagedServiceSubscription extends ValueObject { - public subscriptionId: CodeMashSubscriptionId; - public willExpireOn: UtcDateTime; - public issuedOn: UtcDateTime; - public projectCap: Quantity; - public isTrial: boolean; + // @DataContract + export enum CodeMashRelease + { + NotSet = 'NotSet', + Community = 'Community', + ManagedService = 'ManagedService', + Enterprise = 'Enterprise', + } - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export enum CodeMashRuntime + { + Development = 'Development', + CI = 'CI', + Staging = 'Staging', + Production = 'Production', } - } - // @DataContract - export class SecretVersion extends ValueObject { - // @DataMember - public value: string; + // @DataContract + export class EchoLicenseDto + { + // @DataMember(Name="domain") + public domain?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Name="accountId") + public accountId?: string; - // @DataContract - export class Secret extends ValueObject implements IDecryptable { - // @DataMember - public value: string; + // @DataMember(Name="email") + public email?: string; - // @DataMember - public version: SecretVersion; + // @DataMember(Name="release") + public release?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Name="expire") + public expire: number; + + // @DataMember(Name="isTrial") + public isTrial: boolean; - export class CodeMashLicense extends CodeMashManagedServiceSubscription { - public domain: string; - public accountId: AccountId; - public isEnterprise: boolean; - public key: Secret; + // @DataMember(Name="cap") + public cap: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class ExternalCustomerId extends ValueObject { - public id: string; + export class EchoRegionDto + { + public code: string; + public displayName: string; + public apiUrl: string; + public hubUrl: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class Tag extends ValueObject { - public value: string; + export class EchoAgentDto + { + public mcpUrl: string; + public oAuthMetadataUrl?: string; + public installationType: string; + public onboardingDocsUrl: string; + public toolsUrl: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class TagDescription extends ValueObject { - public displayName: DisplayName; - public description?: string; + export class PublicBrandDto + { + public displayName: string; + public mainColor?: string; + public accentColor?: string; + public logoUrl?: string; + public iconUrl?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class TagTranslation extends MessageTranslation { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class PublicPasswordPolicyDto + { + public minLength: number; + public maxLength?: number; + public minNumbers?: number; + public minUpper?: number; + public minLower?: number; + public minSpecial?: number; + public allowedSpecial?: string; - // @DataContract - export class BaseTagDefinition extends ValueObject { - // @DataMember - public tag: Tag; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public translations: TagTranslation[]; + export class PublicAuthDto + { + public socialProviders: string[] = []; + public passkey: boolean; + public methods?: string[]; + public passwordPolicy?: PublicPasswordPolicyDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class GroupDefinition extends BaseTagDefinition { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export class PublicAiAssistantDto + { + public id: string; + public name: string; + public welcome?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export enum CommunicationChannel { - Transactional = 'Transactional', - Marketing = 'Marketing', - System = 'System', - } + export class PublicAiChatDto + { + public enabled: boolean; + public assistants: PublicAiAssistantDto[] = []; - export enum DeliveryChannel { - Email = 'Email', - Push = 'Push', - Sms = 'Sms', - WebPush = 'WebPush', - InApp = 'InApp', - ChatBot = 'ChatBot', - ChatPlatform = 'ChatPlatform', - } + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataContract - export class TagDefinition extends BaseTagDefinition { - // @DataMember - public defaultDelivery: { [index: string]: boolean }; + export class ErrorDto + { + public message: string; + public errorCode?: string; + public context?: { [index:string]: string; }; + public stackTrace?: ErrorDto[]; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class IntegrationId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class CodeMashResponseStatus + { + public isSuccess: boolean; + public errors?: ErrorDto[]; - export enum ProjectStatus { - Active = 'Active', - Locked = 'Locked', - Disabled = 'Disabled', - } + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - export class ProjectRegionId extends ValueObject { - // @DataMember - public value: string; + // @DataContract + export class ResponseBase + { + // @DataMember + public responseStatus: CodeMashResponseStatus; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export enum Continent { - Africa = 'Africa', - Antarctica = 'Antarctica', - Asia = 'Asia', - Europe = 'Europe', - NorthAmerica = 'NorthAmerica', - Oceania = 'Oceania', - SouthAmerica = 'SouthAmerica', - } + export class EndUserChatAttachment + { + public id: string; + public sessionId: string; + public fileName: string; + public contentType: string; + public kind: string; + public size: number; + public summary?: string; + public createdAtUtc: string; - // @DataContract - export class ProjectRegion extends ValueObject { - // @DataMember - public id: ProjectRegionId; - - // @DataMember - public name?: string; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public continent?: Continent; + export class EndUserChatMemoryNote + { + public id: string; + public sessionId: string; + public kind: string; + public text: string; + public createdAtUtc: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class GroupTags extends ValueObject { - // @DataMember - public group: Tag; + export class EndUserChatAssistant + { + public id: string; + public name: string; + public welcomeMessage?: string; + public isDefault: boolean; + public memoryEnabled: boolean; - // @DataMember - public tags: Tag[]; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class ProjectCommunicationChannel extends ValueObject { - // @DataMember - public channel: CommunicationChannel; - // @DataMember - public groups: GroupTags[]; + export class EndUserChatPlan + { + public id: string; + public name: string; + public quotaUnit: string; + public monthlyQuota: number; + public used: number; + public remaining: number; + public attachments: boolean; + public rag: boolean; + public memory: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class ProjectCommunication { - // @DataMember - public channels: ProjectCommunicationChannel[]; + export class EndUserChatSession + { + public id: string; + public assistantId?: string; + public title?: string; + public isPinned: boolean; + public isArchived: boolean; + public lastSeq: number; + public createdAtUtc: string; + public updatedAtUtc: string; - // @DataMember - public groups: GroupDefinition[]; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public tags: TagDefinition[]; + export class AiChatEntryWireDto + { + public kind: string; + public id: string; + public seq: number; + public atUtc: string; + public refEntryId?: string; + public workItemId?: string; + public feedback?: string; + public feedbackAtUtc?: string; + public feedbackByUserAuthId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class Language extends ValueObject { - // @DataMember - public code: string; - // @DataMember - public name: string; + export class EndUserAiToolParameter + { + public name: string; + public type: string; + public required: boolean; + public description?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class BrandColor extends ValueObject { - // @DataMember - public color: string; + export class EndUserAiTool + { + public name: string; + public description: string; + public toolsets: string[] = []; + public requiresConfirmation: boolean; + public parameters: EndUserAiToolParameter[] = []; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class FilePath extends ValueObject { - public path: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export enum AuthType + { + Service = 'Service', + Email = 'Email', + UserName = 'UserName', + Phone = 'Phone', + Guest = 'Guest', + Social = 'Social', } - } - export class FileResource extends ValueObject { - public path: FilePath; - public integrationId: IntegrationId; + export class AccessInformationDto + { + public ip?: string; + public date?: string; + public timeZone?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class ProjectLogo extends ValueObject { - public fileResource: FileResource; - public publicUrl?: string; + export class RegistrationDto + { + public registrationInformation: AccessInformationDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class ProjectIcon extends ValueObject { - public fileResource: FileResource; - public publicUrl?: string; + export class LoginDto + { + public needChangePasswordOnNextLogin: boolean; + public lastAccessInformation?: AccessInformationDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class ProjectBrand extends ValueObject { - // @DataMember - public mainColor?: BrandColor; + export enum AuthStatus + { + Registered = 0, + PendingValidation = 2, + Active = 8, + Unregistered = 16, + Suspended = 32, + InActive = 64, + Blocked = 128, + } - // @DataMember - public accentColor?: BrandColor; + export class AuthDto implements IBindableContract + { + public id: string; + public type: AuthType; + public email?: string; + public userName?: string; + public registration?: RegistrationDto; + public login?: LoginDto; + public generalInfo?: UserGeneralInfoDto; + public roles?: string[]; + public pushDevices?: string[]; + public tags?: string[]; + public status: AuthStatus; + public createdOn: string; + public modifiedOn: string; - // @DataMember - public logo?: ProjectLogo; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public icon?: ProjectIcon; + export class PaginatedResponse + { + public items: IList; + public hasMore: boolean; + public hasPrevious: boolean; + public startingAfter?: string; + public endingBefore?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial>) { (Object as any).assign(this, init); } } - } - // @DataContract - export class TimeZone extends ValueObject { - // @DataMember - public zoneId: string; + export class UserMarketingPreferencesDto + { + public blockAllMarketingMessages: boolean; + public blockedTags?: { [index:string]: HashSet; }; + public blockReasons?: MarketingBlockReason[]; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class DomainUrl extends ValueObject { - public value: string; + export class PasskeyListItemDto + { + public credentialId: string; + public friendlyName: string; + public registeredOnUtc: string; + public lastUsedOnUtc: string; + public isRevoked: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - export enum ModuleWidgetTypes { - Days7Count = 'Days7Count', - WeeklyCount = 'WeeklyCount', - Days30Count = 'Days30Count', - MonthlyCount = 'MonthlyCount', - YearlyCount = 'YearlyCount', - LifetimeCount = 'LifetimeCount', - } - // @Flags() - export enum ApplicationModule { - Account = 0, - Membership = 1, - Database = 2, - Files = 4, - Code = 8, - Email = 16, - Push = 32, - Payment = 64, - Scheduler = 128, - Logging = 256, - ServerEvents = 512, - } + export class TermMultiParentDto + { + // @DataMember + public taxonomyId: string; - export class ProjectWidget extends ValueObject { - public widgetType: ModuleWidgetTypes; - public applicationModule: ApplicationModule; + // @DataMember + public parentId: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public name?: string; - // @DataContract - export class Project extends ValueObject implements IBindableToSystemTokens { - // @DataMember - public id: ProjectId; + // @DataMember + public names?: { [index:string]: string; }; - // @DataMember - public defaultDatabaseIntegrationId: IntegrationId; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public status: ProjectStatus; + export class TermTreeDto + { + // @DataMember + public id: string; - // @DataMember - public name: ProjectName; + // @DataMember + public taxonomyId?: string; - // @DataMember - public regions?: ProjectRegion[]; + // @DataMember + public taxonomyName?: string; - // @DataMember - public projectCommunication?: ProjectCommunication; + // @DataMember + public parentId?: string; - // @DataMember - public languages: Language[]; + // @DataMember + public order?: number; - // @DataMember - public defaultLanguage: Language; + // @DataMember + public name?: string; - // @DataMember - public description?: string; + // @DataMember + public names?: { [index:string]: string; }; - // @DataMember - public brand?: ProjectBrand; + // @DataMember + public description?: string; - // @DataMember - public timeZone?: TimeZone; + // @DataMember + public descriptions?: { [index:string]: string; }; - // @DataMember - public paymentZones?: TimeZone[]; + // @DataMember + public multiParents?: TermMultiParentDto[]; - // @DataMember - public marketingUrl?: DomainUrl; + // @DataMember + public meta?: Object; - // @DataMember - public socials?: { [index: string]: string }; + // @DataMember + public children?: TermTreeDto[]; - // @DataMember - public allowedOrigins?: DomainUrl[]; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public widgets?: ProjectWidget[]; + export class TaxonomyTreeDto + { + // @DataMember + public viewId: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public taxonomyName: string; - // @DataContract - export class Integration extends ValueObject implements IHasDomainId { - // @DataMember - public id: IntegrationId; + // @DataMember + public taxonomySlug: string; - // @DataMember - public name: DisplayName; + // @DataMember + public parentId?: string; - // @DataMember - public isEnabled: boolean; + // @DataMember + public children?: TaxonomyTreeDto[]; - // @DataMember - public viewId: string; + // @DataMember + public terms?: TermTreeDto[]; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export enum DatabaseProvider { - CodeMashMongoDbAtlasCluster = 'CodeMashMongoDbAtlasCluster', - CodeMashMongoDbAtlasServerless = 'CodeMashMongoDbAtlasServerless', - MongoDbConnectionString = 'MongoDbConnectionString', - } + export class TermDto + { + // @DataMember + public id: string; - // @DataContract - export class DatabaseIntegration extends Integration { - // @DataMember - public provider: DatabaseProvider; + // @DataMember + public taxonomyId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public taxonomyName?: string; - export class DeviceId extends ValueObject { - public id: string; + // @DataMember + public parentId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public order?: number; - export enum DeviceType { - Unknown = 'Unknown', - Phone = 'Phone', - Tablet = 'Tablet', - Desktop = 'Desktop', - Tv = 'Tv', - } + // @DataMember + public name?: string; - export class PushDeviceToken extends ValueObject { - public token: string; + // @DataMember + public names?: { [index:string]: string; }; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public description?: string; - export enum PushDeviceDeliveryFamily { - Ios = 'Ios', - Android = 'Android', - Chrome = 'Chrome', - Safari = 'Safari', - Expo = 'Expo', - } + // @DataMember + public descriptions?: { [index:string]: string; }; - // @DataContract - export class PushDeviceDeliveryToken { - // @DataMember - public pushDeviceToken: PushDeviceToken; + // @DataMember + public multiParents?: TermMultiParentDto[]; - // @DataMember - public deliveryFamily: PushDeviceDeliveryFamily; + // @DataMember + public meta?: Object; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class PushDevice extends ValueObject { - // @DataMember - public id: DeviceId; + export class JsonSchemaFieldDto + { + // @DataMember + public fieldName: string; - // @DataMember - public brand?: string; - - // @DataMember - public manufacturer?: string; - - // @DataMember - public modelName?: string; - - // @DataMember - public deviceName?: string; - - // @DataMember - public deviceType?: DeviceType; - - // @DataMember - public osName?: string; - - // @DataMember - public osVersion?: string; - - // @DataMember - public platformApiLevel?: number; - - // @DataMember - public token: PushDeviceDeliveryToken; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - // @DataContract(Namespace="http://codemash.io/types/") - export class RequestBase - implements ICultureBasedRequest, IVersionBasedRequest - { - /** @description Specify culture code when your response from the API should be localised. E.g.: en */ - // @DataMember - // @ApiMember(DataType="string", Description="Specify culture code when your response from the API should be localised. E.g.: en", Name="CultureCode", ParameterType="header") - public cultureCode?: string; - - /** @description TimeZone */ - // @DataMember - // @ApiMember(DataType="string", Description="TimeZone", Name="TimeZoneId", ParameterType="header") - public timeZoneId?: string; - - /** @description The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v3 */ - // @DataMember - // @ApiMember(DataType="string", Description="The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v3", IsRequired=true, Name="version", ParameterType="path") - public version: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class CodeMashRequestBase - extends RequestBase - implements IHasProjectId - { - /** @description ID of your project. Can be passed in a header as X-CM-ProjectId. */ - // @DataMember - // @ApiMember(DataType="string", Description="ID of your project. Can be passed in a header as X-CM-ProjectId.", IsRequired=true, Name="X-CM-ProjectId", ParameterType="header") - public projectId: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export interface ICultureBasedRequest { - cultureCode?: string; - } - - export interface IVersionBasedRequest { - version: string; - } - - export interface IHasProjectId { - projectId: string; - } - - export enum Gender { - Male = 'Male', - Female = 'Female', - Other = 'Other', - } - - export class UserGeneralInfoDto { - public phone?: string; - public primaryEmail?: string; - public displayName?: string; - public firstName?: string; - public lastName?: string; - public fullName?: string; - public addressLine1?: string; - public addressLine2?: string; - public country?: string; - public city?: string; - public state?: string; - public postalCode?: string; - public company?: string; - public gender?: Gender; - public birthDate?: number; - public timeZone?: string; - public language?: string; - public blockAllMarketingMessages: boolean; - public blockedTags?: { [index: string]: string[] }; - public extraMetadata?: string; - public notes?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - // @DataContract - export class SaveUser extends CodeMashRequestBase { - /** @description User Info */ - // @DataMember - // @ApiMember(DataType="object", Description="User Info", Name="UserGeneralInfo", ParameterType="body") - public userGeneralInfo?: UserGeneralInfoDto; - - /** @description Ignore UserRegistersAsRole from Membership Settings */ - // @DataMember - // @ApiMember(DataType="boolean", Description="Ignore UserRegistersAsRole from Membership Settings", Name="IgnoreUserRegistersAsRole", ParameterType="body") - public ignoreUserRegistersAsRole: boolean; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - // @DataContract - export class SaveUserWithRolesBase extends SaveUser { - // @DataMember - public roles: string[]; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class ListPaginationRequestBase - extends RequestBase - implements IRequestWithPaging, IRequestWithSorting - { - /** @description Amount of records to return */ - // @DataMember - // @ApiMember(DataType="integer", Description="Amount of records to return", Format="int32", Name="PageSize", ParameterType="form") - public pageSize?: number; - - // @DataMember - public startingAfter?: string; - - // @DataMember - public endingBefore?: string; - - /** @description A query that specifies how to sort filtered records */ - // @DataMember - // @ApiMember(DataType="string", Description="A query that specifies how to sort filtered records", Name="Sort", ParameterType="body") - public sort?: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class CodeMashListPaginationRequestBase - extends ListPaginationRequestBase - implements IHasProjectId - { - /** @description ID of your project. Can be passed in a header as X-CM-ProjectId. */ - // @DataMember - // @ApiMember(DataType="string", Description="ID of your project. Can be passed in a header as X-CM-ProjectId.", IsRequired=true, Name="X-CM-ProjectId", ParameterType="header") - public projectId: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export interface IRequestWithPaging { - pageSize?: number; - startingAfter?: string; - endingBefore?: string; - } - - export interface IRequestWithSorting { - sort?: string; - } - - export class RoleName extends ValueObject { - public displayName?: string; - public name: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class IamResourcePermission extends ValueObject { - public permissionNamespace: string; - public permissionName: string; - public permissionDisplayName: string; - public permissionDescription?: string; - public selected?: boolean; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export enum PermissionsAccessSet { - OwnRecord = 'OwnRecord', - Full = 'Full', - ReadOnly = 'ReadOnly', - SameRole = 'SameRole', - Executable = 'Executable', - SharedWithMe = 'SharedWithMe', - Custom = 'Custom', - } + export class DataSchemaDto + { + // @DataMember + public json: string; - export class IamResourcePermissionsSet extends ValueObject { - public setName: PermissionsAccessSet; - public resourcePermissions: IamResourcePermission[]; + // @DataMember + public fields: JsonSchemaFieldDto[] = []; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class IamModuleGroupResource extends ValueObject { - public namespaceId: string; - public resourceDisplayName: string; - public resourcePermissions: IamResourcePermission[]; - public resourcePermissionSets: IamResourcePermissionsSet[]; + export class VisualSchemaDto + { + // @DataMember + public json: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class IamModuleGroup extends ValueObject { - public displayName: string; - public name: string; - public resources: IamModuleGroupResource[]; + export class SchemaSettingsDto + { + // @DataMember + public softDelete: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public hasRecordOwner: boolean; - export class IamModule extends ValueObject { - public displayName: string; - public name: string; - public groups: IamModuleGroup[]; + // @DataMember + public description?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class CustomPolicyId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class SchemaEmbedSettingsDto + { + // @DataMember + public enabled: boolean; - export class CustomPolicy extends ValueObject { - public name: DisplayName; - public permissions: IamModule[]; - public description?: string; - public id: CustomPolicyId; - public isReadonly: boolean; + // @DataMember + public fields: string[] = []; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public embeddingIntegrationId?: string; - export class CustomPolicyPermissions extends ValueObject { - public policy: CustomPolicy; - public permissions: string[]; + // @DataMember + public perUser: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - export class Phone extends ValueObject { - public value: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export enum TriggerType + { + Membership = 'Membership', + Schema = 'Schema', + Files = 'Files', + Payments = 'Payments', + Ai = 'Ai', } - } - // @DataContract - export class FirstName extends ValueObject { - // @DataMember - public value: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export enum TriggerActionType + { + Code = 'Code', + Push = 'Push', + Sms = 'Sms', + Email = 'Email', + WebhookCall = 'WebhookCall', + SseCall = 'SseCall', + Marketplace = 'Marketplace', } - } - // @DataContract - export class LastName extends ValueObject { - // @DataMember - public value: string; + // @DataContract + export class TriggerActionDto + { + // @DataMember + public type: TriggerActionType; + + // @DataMember + public integrationId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class MidName extends ValueObject { - public value: string; + // @DataContract + export class TriggerDto implements IHasViewId + { + // @DataMember + public type: TriggerType; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public viewId: string; - export class FullName extends ValueObject { - public firstName?: FirstName; - public midName?: MidName; - public lastName?: LastName; - public title?: string; + // @DataMember + public name: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public thenAction: TriggerActionDto; - export class City extends ValueObject { - public value: string; + // @DataMember + public description?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public isEnabled: boolean; + + // @DataMember + public activationCode?: string; - export class Country extends ValueObject { - public code: string; - public name: string; + // @DataMember + public savedByAuthId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class AddressLine extends ValueObject { - public value: string; + export class SchemaDto implements IHasViewId + { + // @DataMember + public viewId: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public schemaName: string; - export class PostalCode extends ValueObject { - public value: string; + // @DataMember + public schemaSlug?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public version: number; - export class CountryState extends ValueObject { - public value: string; + // @DataMember + public metaSchemaVersion: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public dataSchema: DataSchemaDto; - export class Address extends ValueObject { - public city?: City; - public country?: Country; - public addressLine1?: AddressLine; - public addressLine2?: AddressLine; - public postalCode?: PostalCode; - public state?: CountryState; + // @DataMember + public visualSchema: VisualSchemaDto; - public constructor(init?: Partial
) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public publishedAt: string; - export class UserMarketingPreferences { - public blockAllMarketingMessages: boolean; - public blockedTags?: { [index: string]: Tag[] }; + // @DataMember + public settings?: SchemaSettingsDto; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public embed?: SchemaEmbedSettingsDto; - export class UserGeneralInfo implements IBindableToSystemTokens { - public phone?: Phone; - public primaryEmail?: EmailAddress; - public displayName?: DisplayName; - public firstName?: FirstName; - public lastName?: LastName; - public fullName?: FullName; - public address?: Address; - public company?: string; - public gender?: Gender; - public birthDate?: UtcDateTime; - public timeZone?: TimeZone; - public language?: Language; - public marketingPreferences?: UserMarketingPreferences; - public notes?: string; - public extraMetadata?: string; + // @DataMember + public triggers?: TriggerDto[]; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export enum TriggerType { - Membership = 'Membership', - Schema = 'Schema', - Files = 'Files', - Payments = 'Payments', - } + export class SchemaListProjection implements IHasViewId + { + // @DataMember + public viewId: string; - export class TriggerId extends ValueObject { - public id: string; + // @DataMember + public schemaName: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public schemaTitle: string; - export class RazorTemplateCode extends ValueObject { - public value: string; + // @DataMember + public latestVersion?: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public hasDraft: boolean; - export enum TriggerActionType { - Code = 'Code', - Push = 'Push', - Email = 'Email', - WebhookCall = 'WebhookCall', - } + // @DataMember + public metaSchemaVersion: number; - // @DataContract - export class TriggerAction extends ValueObject { - // @DataMember - public type: TriggerActionType; + // @DataMember + public description?: string; - // @DataMember - public integrationId?: IntegrationId; + // @DataMember + public env?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class Trigger extends ValueObject { - // @DataMember - public type: TriggerType; - // @DataMember - public id: TriggerId; + // @DataContract + export class FileChecksumDto + { + // @DataMember(Order=1) + public algorithm: string; - // @DataMember - public name: DisplayName; + // @DataMember(Order=2) + public hash: string; - // @DataMember - public description?: string; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public preExecuteCode?: RazorTemplateCode; + // @DataContract + export class FileResourceDto + { + // @DataMember(Order=1) + public id: string; - // @DataMember - public thenAction: TriggerAction; + // @DataMember(Order=2) + public originalFileName: string; - // @DataMember - public executeOnBehalfOfUser?: UserId; + // @DataMember(Order=3) + public extension: string; - // @DataMember - public isEnabled: boolean; + // @DataMember(Order=4) + public storedFileName: string; - // @DataMember - public order: number; + // @DataMember(Order=5) + public sizeBytes?: number; - // @DataMember - public breakOnError: boolean; + // @DataMember(Order=6) + public checksum?: FileChecksumDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - export enum MembershipTriggerType { - OnRegistered = 'OnRegistered', - OnInvited = 'OnInvited', - OnVerified = 'OnVerified', - OnUpdated = 'OnUpdated', - OnDeleted = 'OnDeleted', - OnBlocked = 'OnBlocked', - OnReactivated = 'OnReactivated', - } - export class MembershipTrigger extends Trigger { - public when: MembershipTriggerType; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export enum FileProvider + { + Local = 'Local', + AwsS3 = 'AwsS3', + AzureBlobStorage = 'AzureBlobStorage', + GoogleCloudStorage = 'GoogleCloudStorage', + Ftp = 'Ftp', + AppleICloud = 'AppleICloud', + DropBox = 'DropBox', + GoogleDrive = 'GoogleDrive', } - } - - // @DataContract - export class TriggersProcessingStarted { - // @DataMember - public correlationId: string; - // @DataMember - public createdOn: UtcDateTime; + // @DataContract + export class FileResourceRefDto + { + // @DataMember(Order=1) + public resource: FileResourceDto; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember(Order=2) + public integrationId: string; - // @DataContract - export class TriggerStarted { - // @DataMember - public triggerId: TriggerId; + // @DataMember(Order=3) + public provider: FileProvider; - // @DataMember - public correlationId: string; + // @DataMember(Order=4) + public path: string; - // @DataMember - public moduleName: string; + // @DataMember(Order=5) + public publicUrl?: string; - // @DataMember - public createdOn: UtcDateTime; + // @DataMember(Order=6) + public isPublic: boolean; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class ErrorDto { - // @DataMember - public message: string; + // @DataContract + export class PublicFolderDto + { + // @DataMember(Order=1) + public path: string; - // @DataMember - public errorCode?: string; + // @DataMember(Order=2) + public publicId: string; - // @DataMember - public context?: { [index: string]: string }; + // @DataMember(Order=3) + public publicUrl?: string; - // @DataMember - public stackTrace?: ErrorDto[]; + // @DataMember(Order=4) + public inherited: boolean; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - // @DataContract - export class TriggerFailed { - // @DataMember - public triggerId: TriggerId; + // @DataContract + export class IntegrationTestResultItemDto + { + // @DataMember + public operation: string; - // @DataMember - public correlationId: string; + // @DataMember + public result: string; - // @DataMember - public moduleName: string; + // @DataMember + public errors?: IReadOnlyList; - // @DataMember - public breakOnError: boolean; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + } - // @DataMember - public preExecutionCode?: string; + // @DataContract + export class ResponseError + { + // @DataMember(Order=1) + public errorCode: string; - // @DataMember - public preExecutionBoundedCode?: string; + // @DataMember(Order=2) + public fieldName: string; - // @DataMember - public errors?: ErrorDto[]; + // @DataMember(Order=3) + public message: string; - // @DataMember - public createdOn: UtcDateTime; + // @DataMember(Order=4) + public meta?: { [index:string]: string; }; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class TriggerFinished { - // @DataMember - public triggerId: TriggerId; - - // @DataMember - public correlationId: string; - // @DataMember - public moduleName: string; + // @DataContract + export class ResponseStatus + { + // @DataMember(Order=1) + public errorCode: string; - // @DataMember - public createdOn: UtcDateTime; + // @DataMember(Order=2) + public message?: string; - // @DataMember - public skipped: boolean; + // @DataMember(Order=3) + public stackTrace?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - // @DataContract - export class TriggersProcessingStopped { - // @DataMember - public correlationId: string; + // @DataMember(Order=4) + public errors?: ResponseError[]; - // @DataMember - public createdOn: UtcDateTime; + // @DataMember(Order=5) + public meta?: { [index:string]: string; }; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class UserName extends ValueObject { - public value: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export interface IBindableContract + { } - } - - export enum UserType { - Service = 'Service', - Email = 'Email', - UserName = 'UserName', - Phone = 'Phone', - Guest = 'Guest', - Social = 'Social', - } - export class IpAddress { - public ip: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); + export interface IHasViewId + { + viewId: string; } - } - - export class AccessInformation { - public ip?: IpAddress; - public date?: UtcDateTime; - public zone?: TimeZone; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + export interface ICursorArgs + { + field: string; + order: number; } - } - export class Registration { - public registrationInformation: AccessInformation; + export class StringFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public format?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public pattern?: string; - export class Login { - public needChangePasswordOnNextLogin: boolean; - public lastAccessInformation?: AccessInformation; + // @DataMember + public minLength?: number; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public maxLength?: number; - export enum UserStatus { - Registered = 0, - PendingValidation = 2, - Active = 8, - Unregistered = 16, - Suspended = 32, - InActive = 64, - Blocked = 128, - } + // @DataMember + public translateOptions?: IReadOnlyDictionary; - export class PushDevices extends Array { - public constructor(init?: Partial) { - super(); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class User extends ValueObject implements IBindableToSystemTokens { - public id: UserId; - public roles?: RoleName[]; - public email?: EmailAddress; - public userName?: UserName; - public type: UserType; - public registration: Registration; - public login?: Login; - public generalInfo?: UserGeneralInfo; - public status: UserStatus; - public createdOn: UtcDateTime; - public modifiedOn: UtcDateTime; - public pushDevices?: PushDevices; - public tags?: Tag[]; + export class DecimalFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public minimum?: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public maximum?: number; - export class CampaignId extends ValueObject { - public id: string; + // @DataMember + public multipleOf?: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class CampaignBatchId extends ValueObject { - public id: string; + export class CurrencyFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public allowedCurrencies?: IReadOnlyList; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - // @DataContract - export class Recipient implements IRecipient { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - // @DataContract - export class EmailRecipient extends Recipient { - // @DataMember - public emailAddress: EmailAddress; - // @DataMember - public user?: User; + export class BooleanFieldDto extends JsonSchemaFieldDto + { - // @DataMember - public record?: Object; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - export class EmailRecipients { - public to: EmailRecipient[]; - public cc?: EmailRecipient[]; - public bcc?: EmailRecipient[]; - public startingAfter?: string; - public hasMore: boolean; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class NotificationId extends ValueObject { - public id: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class SendNotificationResult { - public id: NotificationId; - public subject: string; - public body: string; - public refId?: string; - public model?: any; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class TemplateId extends ValueObject { - public id: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export enum CampaignStatus { - Pending = 'Pending', - Registered = 'Registered', - Scheduled = 'Scheduled', - Started = 'Started', - Stopped = 'Stopped', - Processing = 'Processing', - Completed = 'Completed', - Failed = 'Failed', - } - - export class TokenKey extends ValueObject { - public value: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export enum TokenMappingResolverType { - NotSet = 'NotSet', - Custom = 'Custom', - Project = 'Project', - ProjectSocials = 'ProjectSocials', - Initiator = 'Initiator', - Recipient = 'Recipient', - SchemaRecord = 'SchemaRecord', - TargetUser = 'TargetUser', - TagDefinitions = 'TagDefinitions', - EmailSignatures = 'EmailSignatures', - Campaign = 'Campaign', - Template = 'Template', - EmailFooters = 'EmailFooters', - Old = 'Old', - New = 'New', - } - - export class TokenValue extends ValueObject { - public value: string; - public tokenMappingResolverType: TokenMappingResolverType; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class TokenMapping extends ValueObject { - public key: TokenKey; - public value: TokenValue; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - // @Flags() - export enum RespectTimeZoneSettings { - RespectToLastLoginZone = 1, - RespectToRegistrationZone = 2, - RespectToRegistrationProjectZone = 4, - } - - // @DataContract - export class CampaignDeliverySettings implements ICampaignDeliverySettings { - // @DataMember - public deliveryChannel: DeliveryChannel; - - // @DataMember - public campaignTime?: UtcDateTime; - - // @DataMember - public mappedTokens?: TokenMapping[]; - - // @DataMember - public respectTimeZoneSettings?: RespectTimeZoneSettings; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class Campaign - extends ValueObject - implements ICampaign, IBindableToSystemTokens - { - public campaignId: CampaignId; - public createdOn: UtcDateTime; - public forceCampaignLanguage: boolean; - public language?: Language; - public timeZone?: TimeZone; - public templateId: TemplateId; - public integrationId?: IntegrationId; - public forceToSendWhenHasBindErrors: boolean; - public status: CampaignStatus; - public deliverySettings: CampaignDeliverySettings; - public tokenMappingValues?: TokenMapping[]; - public notes?: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class EmailCampaign extends Campaign { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - // @DataContract - export class Template - extends ValueObject - implements IBindableToSystemTokens - { - // @DataMember - public templateId: TemplateId; - - // @DataMember - public templateName: DisplayName; - - // @DataMember - public description?: string; - - // @DataMember - public translations: MessageTranslation[]; - - // @DataMember - public isActive: boolean; - - // @DataMember - public communicationChannel: CommunicationChannel; + export class DateFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public minimum?: number; - // @DataMember - public tags?: Tag[]; + // @DataMember + public maximum?: number; - // @DataMember - public fileIntegrationId?: IntegrationId; - - public constructor(init?: Partial>) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class EmailSubject extends BindableTemplate { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class IntegerFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public minimum?: number; - export enum EmailTemplateEngine { - NotSet = 'NotSet', - Handlebars = 'Handlebars', - Mjml = 'Mjml', - Liquid = 'Liquid', - Razor = 'Razor', - Mustache = 'Mustache', - } + // @DataMember + public maximum?: number; - // @DataContract - export class EmailBody extends BindableTemplate { - // @DataMember - public structure?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember - public templateEngine: EmailTemplateEngine; + export class GeolocationFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public allowedTypes?: IReadOnlyList; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - // @DataContract - export class EmailMessageContent extends ValueObject { - // @DataMember - public subject: EmailSubject; - - // @DataMember - public body: EmailBody; - // @DataMember - public staticAttachments?: string[]; + export class TagsFieldDto extends JsonSchemaFieldDto + { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class EmailTemplate extends Template { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class FileFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public storages?: IReadOnlyList; - export class EventBase { - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class EmailSenderName extends ValueObject { - // @DataMember - public value: string; + export class TaxonomySelectionFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public taxonomyId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public multiple: boolean; - // @DataContract - export enum EmailProvider { - Smtp = 'Smtp', - SendGrid = 'SendGrid', - MailGun = 'MailGun', - AwsSes = 'AwsSes', - } + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataContract - export class EmailIntegration extends Integration { - // @DataMember - public emailAddress: EmailAddress; + export class CollectionSelectionFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public collectionId?: string; - // @DataMember - public senderDisplayName?: EmailSenderName; + // @DataMember + public displayField?: string; - // @DataMember - public provider: EmailProvider; + // @DataMember + public multiple: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class EmailSignatureId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class UserSelectionFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public multiple: boolean; - // @DataContract - export class EmailSignatureContent extends BindableTemplate { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class EmailSignatureTranslation extends MessageTranslation { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + export class RoleSelectionFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public multiple: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class EmailSignature extends ValueObject { - public id: EmailSignatureId; - public displayName?: DisplayName; - public translations: EmailSignatureTranslation[]; + export class EnumSelectionFieldDto extends JsonSchemaFieldDto + { + // @DataMember + public values?: IReadOnlyList; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public multiple: boolean; - export class EmailFooterId extends AggregateId { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class EmailFooterContent extends BindableTemplate { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class EchoResponse + { + public containerName?: string; + public ip: string; + public release: CodeMashRelease; + public runtime: CodeMashRuntime; + public managedServiceHubUrl: string; + public managedServiceApiUrl: string; + public hubUrl: string; + public apiUrl: string; + public apiVersion: string; + public hubVersion: string; + public mjmlUrl: string; + public adminUrlTemplate?: string; + public license?: EchoLicenseDto; + public askForEnterpriseLicenseEmail?: string; + public emailServiceConfigured: boolean; + public rootBootstrapPasswordSource?: string; + public regions?: EchoRegionDto[]; + public isProductionInstallation: boolean; + public licensingMode: string; + public graceDaysLeft?: number; + public installationDomain?: string; + public licensingDocsUrl?: string; + public agent?: EchoAgentDto; - // @DataContract - export class EmailFooterTranslation extends MessageTranslation { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class EmailFooter extends ValueObject { - public id: EmailFooterId; - public displayName?: DisplayName; - public translations: EmailFooterTranslation[]; + export class PublicProjectConfigDto + { + public displayName: string; + public adminPortalEnabled: boolean; + public branding?: PublicBrandDto; + public auth: PublicAuthDto; + public aiChat: PublicAiChatDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - - // @DataContract - export class PushRecipient extends Recipient { - // @DataMember - public user: User; - // @DataMember - public record?: Object; + export class PublicLegalDocumentDto + { + public kind: string; + public title?: string; + public body: string; + public available: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - } - export class PushRecipients { - public to: PushRecipient[]; - public startingAfter?: string; - public hasMore: boolean; + // @DataContract + export class IdResponse extends ResponseBase + { + // @DataMember + public id?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public status?: string; - export class PushCampaign extends Campaign { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class PushTitle extends BindableTemplate { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class ListEndUserChatAttachmentsResponse extends ResponseBase + { + public attachments: EndUserChatAttachment[] = []; - // @DataContract - export class PushBody extends BindableTemplate { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class PushMessageContent extends ValueObject { - // @DataMember - public title: PushTitle; + export class EmptyResponse extends ResponseBase + { - // @DataMember - public body: PushBody; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class PushTemplate extends Template { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + export class ListEndUserChatMemoryResponse extends ResponseBase + { + public notes: EndUserChatMemoryNote[] = []; - // @DataContract - export enum PushProvider { - AppleDevices = 'AppleDevices', - SafariWebPush = 'SafariWebPush', - CodeMashSafariExtension = 'CodeMashSafariExtension', - AndroidDevices = 'AndroidDevices', - CodeMashChromeExtension = 'CodeMashChromeExtension', - ChromeWebPush = 'ChromeWebPush', - CodeMashApp = 'CodeMashApp', - Expo = 'Expo', - } + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - export class PushIntegration extends Integration { - // @DataMember - public provider: PushProvider; + export class GetEndUserChatAvailabilityResponse extends ResponseBase + { + public enabled: boolean; + public available: boolean; + public reason?: string; + public defaultAssistantId?: string; + public assistants: EndUserChatAssistant[] = []; + public plan?: EndUserChatPlan; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - // @DataContract - export class CodeMashResponseStatus { - // @DataMember - public isSuccess: boolean; - // @DataMember - public errors?: ErrorDto[]; + export class ListEndUserChatSessionsResponse extends ResponseBase + { + public sessions: EndUserChatSession[] = []; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class ResponseBase { - // @DataMember - public responseStatus: CodeMashResponseStatus; + export class GetEndUserChatSessionResponse extends ResponseBase + { + public session?: EndUserChatSession; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class AccessInformationDto { - public ip?: string; - public date?: string; - public timeZone?: string; + export class GetEndUserChatEntriesResponse extends ResponseBase + { + public sessionId?: string; + public entries: AiChatEntryWireDto[] = []; + public lastSeq: number; + public hasMore: boolean; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class RegistrationDto { - public registrationInformation: AccessInformationDto; + export class StartEndUserChatTurnResponse extends ResponseBase + { + public turnId?: string; + public sessionId?: string; + public channel?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class LoginDto { - public needChangePasswordOnNextLogin: boolean; - public lastAccessInformation?: AccessInformationDto; + export class GetEndUserAiToolsResponse extends ResponseBase + { + public tools?: EndUserAiTool[]; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class UserDto { - public id?: string; - public type: UserType; - public email?: string; - public userName?: string; - public registration?: RegistrationDto; - public login?: LoginDto; - public userGeneralInfo?: UserGeneralInfoDto; - public roles?: string[]; - public pushDevices?: string[]; - public tags?: string[]; - public status: UserStatus; - public createdOn: string; - public modifiedOn: string; + export class InvokeEndUserAiToolResponse extends ResponseBase + { + public result?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class ResponseError { - // @DataMember(Order=1) - public errorCode: string; + export class GetUserResponse extends ResponseBase + { + public user?: AuthDto; - // @DataMember(Order=2) - public fieldName: string; - - // @DataMember(Order=3) - public message: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=4) - public meta: { [index: string]: string }; + export class GetUsersResponse extends ResponseBase + { + public list?: PaginatedResponse; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class ResponseStatus { - // @DataMember(Order=1) - public errorCode: string; + export class GetUserPreferencesResponse extends ResponseBase + { + public preferences?: UserMarketingPreferencesDto; - // @DataMember(Order=2) - public message: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=3) - public stackTrace: string; + export class PasskeyOkResponse extends ResponseBase + { - // @DataMember(Order=4) - public errors: ResponseError[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=5) - public meta: { [index: string]: string }; + export class PasskeyCeremonyOptionsResponse extends ResponseBase + { + public ceremonyId: string; + public optionsJson: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class ResponseBase_1 { - // @DataMember - public responseStatus?: ResponseStatus; + export class PasskeyAuthTokensResponse extends ResponseBase + { + public accessToken: string; + public refreshToken: string; + public expiresInSeconds: number; + public recoveryCodes?: string[]; - // @DataMember(Name="result") - public result: T; - - public constructor(init?: Partial>) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class ListResponseBase extends ResponseBase_1 { - public hasMore: boolean; - public startingAfter?: string; - public endingBefore?: string; + export class PasskeyListResponse extends ResponseBase + { + public passkeys: PasskeyListItemDto[] = []; - public constructor(init?: Partial>) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - // @DataContract - export class UserApiKey { - // @DataMember(Order=1) - public key: string; - // @DataMember(Order=2) - public keyType: string; + export class PasskeyRecoveryResponse extends ResponseBase + { + public accessToken: string; + public refreshToken: string; + public expiresInSeconds: number; + public remainingCodes: number; - // @DataMember(Order=3) - public expiryDate?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=4) - public meta: { [index: string]: string }; + export class PasskeyVerificationTokenResponse extends ResponseBase + { + public verificationToken: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - - export interface IHasDomainId { - viewId: string; - } - export interface IBindableToSystemTokens {} + export class FindMergedTermTreeResponse extends ResponseBase + { + public tree?: TermTreeDto[]; - export interface ICampaign { - campaignId: CampaignId; - language?: Language; - } + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - export interface IDecryptable {} + export class FindTaxonomyTreeResponse extends ResponseBase + { + public tree?: TaxonomyTreeDto[]; - export interface IRecipient { - language?: Language; - timeZone?: TimeZone; - userNotificationPreferences?: UserMarketingPreferences; - } + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - export interface ICampaignDeliverySettings - extends IDeliverySettings, - IPostponedCampaign { - deliveryChannel: DeliveryChannel; - respectTimeZoneSettings?: RespectTimeZoneSettings; - } + export class FindTermsResponse extends ResponseBase + { + public list?: PaginatedResponse; - export interface IDeliverySettings { - mappedTokens?: TokenMapping[]; - } + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - export interface IPostponedCampaign { - campaignTime?: UtcDateTime; - } + export class FindTermsChildrenResponse extends ResponseBase + { + public list?: PaginatedResponse; - // @DataContract - export class EmptyResponse extends ResponseBase { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class IdResponse extends ResponseBase { - // @DataMember - public id?: string; + export class FindTermTreeResponse extends ResponseBase + { + public tree?: TermTreeDto[]; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class GetUserResponse extends ResponseBase { - public user?: UserDto; + export class GetDatabaseSchemaResponse extends ResponseBase + { + public item?: SchemaDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - export class GetUsersResponse extends ResponseBase { - public list?: ListResponseBase; + export class GetDatabaseSchemasResponse extends ResponseBase + { + public list?: PaginatedResponse; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class AuthenticateResponse implements IHasSessionId, IHasBearerToken { - // @DataMember(Order=1) - public userId: string; + export class AggregateResponse extends ResponseBase + { + public result?: Object[]; - // @DataMember(Order=2) - public sessionId: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=3) - public userName: string; + export class CountResponse extends ResponseBase + { + public count: number; - // @DataMember(Order=4) - public displayName: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=5) - public referrerUrl: string; + export class DistinctResponse extends ResponseBase + { + public values?: Object[]; - // @DataMember(Order=6) - public bearerToken: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=7) - public refreshToken: string; + export class ExecuteAggregateResponse extends ResponseBase + { + public result?: Object[]; - // @DataMember(Order=8) - public refreshTokenExpiry?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=9) - public profileUrl: string; + export class FindResponse extends ResponseBase + { + public list?: PaginatedResponse; - // @DataMember(Order=10) - public roles: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=11) - public permissions: string[]; + export class FindOneResponse extends ResponseBase + { + public result?: Object; - // @DataMember(Order=12) - public responseStatus: ResponseStatus; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=13) - public meta: { [index: string]: string }; + export class GetFileInfoResponse extends ResponseBase + { + public file?: FileResourceRefDto; + public isPublic?: boolean; + public publicUrl?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class GetAccessTokenResponse { - // @DataMember(Order=1) - public accessToken: string; + export class GetSignedUrlResponse extends ResponseBase + { + public url?: string; - // @DataMember(Order=2) - public meta: { [index: string]: string }; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=3) - public responseStatus: ResponseStatus; + export class ListFilesResponse extends ResponseBase + { + public list?: PaginatedResponse; + public folders?: IList; + public publicFolders?: IList; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class GetApiKeysResponse { - // @DataMember(Order=1) - public results: UserApiKey[]; + export class RequestUploadUrlResponse extends ResponseBase + { + public url?: string; - // @DataMember(Order=2) - public meta: { [index: string]: string }; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + } - // @DataMember(Order=3) - public responseStatus: ResponseStatus; + // @DataContract + export class TestFilesIntegrationResponse extends ResponseBase + { + // @DataMember + public items?: IReadOnlyList; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - } - // @DataContract - export class RegenerateApiKeysResponse { - // @DataMember(Order=1) - public results: UserApiKey[]; + // @DataContract + export class AuthenticateResponse implements IHasSessionId, IHasBearerToken + { + // @DataMember(Order=1) + public userId?: string; - // @DataMember(Order=2) - public meta: { [index: string]: string }; + // @DataMember(Order=2) + public sessionId?: string; - // @DataMember(Order=3) - public responseStatus: ResponseStatus; + // @DataMember(Order=3) + public userName?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember(Order=4) + public displayName?: string; - // @DataContract - export class AccountCreated { - // @DataMember - public owner: AccountOwner; + // @DataMember(Order=5) + public referrerUrl?: string; - // @DataMember - public accountId: AccountId; + // @DataMember(Order=6) + public bearerToken?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AccountCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=7) + public refreshToken?: string; - export class AccountVerified { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AccountVerified'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=8) + public refreshTokenExpiry?: string; - export class AccountSetAsActive { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AccountSetAsActive'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=9) + public profileUrl?: string; - export class AccountValidationTokenIssued { - public token: ValidationToken; + // @DataMember(Order=10) + public roles?: string[]; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AccountValidationTokenIssued'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=11) + public permissions?: string[]; - export class LicenseCreated { - public license: CodeMashLicense; - public refId?: string; + // @DataMember(Order=12) + public authProvider?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'LicenseCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=13) + public responseStatus?: ResponseStatus; - export class LicenseRenewed { - public license: CodeMashLicense; - public refId?: string; + // @DataMember(Order=14) + public meta?: { [index:string]: string; }; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'LicenseRenewed'; + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class CustomerCreated { - public customerId: ExternalCustomerId; + // @DataContract + export class GetAccessTokenResponse + { + // @DataMember(Order=1) + public accessToken?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'CustomerCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=2) + public meta?: { [index:string]: string; }; - export class SubscriptionCreated { - public subscription: CodeMashManagedServiceSubscription; + // @DataMember(Order=3) + public responseStatus?: ResponseStatus; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - public getTypeName() { - return 'SubscriptionCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class ProjectCommunicationGroupSaved { - public projectId: ProjectId; - public group: GroupDefinition; - public channel: CommunicationChannel; - public originChannel?: CommunicationChannel; + // @Route("/{version}/echo", "GET") + export class Echo extends RequestBase implements IReturn + { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectCommunicationGroupSaved'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'Echo'; } + public getMethod() { return 'GET'; } + public createResponse() { return new EchoResponse(); } } - public createResponse() {} - } - export class ProjectCommunicationTagFromGroupRemoved { - public projectId: ProjectId; - public groupTag: Tag; - public removedTag: Tag; + // @Route("/{version}/public/projects/{ProjectId}/brand/{Kind}", "GET") + export class GetPublicProjectBrandAsset extends RequestBase implements IReturn + { + public projectId?: string; + public kind?: string; + public v?: string; - public constructor( - init?: Partial, - ) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetPublicProjectBrandAsset'; } + public getMethod() { return 'GET'; } + public createResponse() { return new Blob(); } } - public getTypeName() { - return 'ProjectCommunicationTagFromGroupRemoved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class ProjectCommunicationGroupDeleted { - public projectId: ProjectId; - public groupTag: Tag; + // @Route("/{version}/public/projects/{ProjectId}/config", "GET") + export class GetPublicProjectConfig extends RequestBase implements IReturn + { + public projectId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectCommunicationGroupDeleted'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetPublicProjectConfig'; } + public getMethod() { return 'GET'; } + public createResponse() { return new PublicProjectConfigDto(); } } - public createResponse() {} - } - export class ProjectCommunicationTagSaved { - public projectId: ProjectId; - public channel?: CommunicationChannel; - public groupTag?: Tag; - public tag: TagDefinition; + // @Route("/{version}/public/projects/{ProjectId}/legal/{Kind}", "GET") + export class GetPublicProjectLegal extends RequestBase implements IReturn + { + public projectId?: string; + public kind?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetPublicProjectLegal'; } + public getMethod() { return 'GET'; } + public createResponse() { return new PublicLegalDocumentDto(); } } - public getTypeName() { - return 'ProjectCommunicationTagSaved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class ProjectCommunicationTagDeleted { - public projectId: ProjectId; - public tag: Tag; + /** @description Adds a file to one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/attachments", "POST") + // @Api(Description="Adds a file to one of the caller's own AI chats.") + export class UploadEndUserChatAttachmentRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public fileName: string; + public contentType: string; + public base64Content: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectCommunicationTagDeleted'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UploadEndUserChatAttachmentRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } } - public createResponse() {} - } - // @DataContract - export class ProjectCreated { - // @DataMember - public project: Project; + /** @description Lists the files in one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/attachments", "GET") + // @Api(Description="Lists the files in one of the caller's own AI chats.") + export class ListEndUserChatAttachmentsRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; - // @DataMember - public databaseIntegration: DatabaseIntegration; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ListEndUserChatAttachmentsRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new ListEndUserChatAttachmentsResponse(); } + } + + /** @description Removes a file from one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/attachments/{AttachmentId}", "DELETE") + // @Api(Description="Removes a file from one of the caller's own AI chats.") + export class DeleteEndUserChatAttachmentRequest extends CodeMashRequestBase implements IReturn + { + public attachmentId: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class ProjectDeleted { - public projectId: ProjectId; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteEndUserChatAttachmentRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Likes, dislikes or clears one message of the caller's own AI chat. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/entries/{EntryId}/feedback", "PUT") + // @Api(Description="Likes, dislikes or clears one message of the caller's own AI chat.") + export class SetEndUserChatEntryFeedbackRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public entryId: string; + public feedback?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SetEndUserChatEntryFeedbackRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Lists what the AI chat remembers about the caller. */ + // @Route("/{version}/ai/chat/memory", "GET") + // @Api(Description="Lists what the AI chat remembers about the caller.") + export class ListEndUserChatMemoryRequest extends CodeMashRequestBase implements IReturn + { + public take?: number; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ListEndUserChatMemoryRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new ListEndUserChatMemoryResponse(); } + } + + /** @description Forgets one thing the AI chat remembers about the caller. */ + // @Route("/{version}/ai/chat/memory/{NoteId}", "DELETE") + // @Api(Description="Forgets one thing the AI chat remembers about the caller.") + export class ForgetEndUserChatMemoryRequest extends CodeMashRequestBase implements IReturn + { + public noteId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ForgetEndUserChatMemoryRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Whether the AI chat can run for the caller, and which assistants it offers. */ + // @Route("/{version}/ai/chat/availability", "GET") + // @Api(Description="Whether the AI chat can run for the caller, and which assistants it offers.") + export class GetEndUserChatAvailabilityRequest extends CodeMashRequestBase implements IReturn + { + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetEndUserChatAvailabilityRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetEndUserChatAvailabilityResponse(); } + } + + /** @description Lists the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions", "GET") + // @Api(Description="Lists the caller's own AI chats.") + export class ListEndUserChatSessionsRequest extends CodeMashRequestBase implements IReturn + { + public take?: number; + public includeArchived: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ListEndUserChatSessionsRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new ListEndUserChatSessionsResponse(); } + } + + /** @description Opens a new AI chat for the caller. */ + // @Route("/{version}/ai/chat/sessions", "POST") + // @Api(Description="Opens a new AI chat for the caller.") + export class CreateEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public assistantId?: string; + public title?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'CreateEndUserChatSessionRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Returns one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}", "GET") + // @Api(Description="Returns one of the caller's own AI chats.") + export class GetEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetEndUserChatSessionRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetEndUserChatSessionResponse(); } + } + + /** @description Renames one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}", "PATCH") + // @Api(Description="Renames one of the caller's own AI chats.") + export class RenameEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public title?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RenameEndUserChatSessionRequest'; } + public getMethod() { return 'PATCH'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Pins or unpins one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/pin", "PUT") + // @Api(Description="Pins or unpins one of the caller's own AI chats.") + export class PinEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public pinned: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'PinEndUserChatSessionRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Archives or unarchives one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/archive", "PUT") + // @Api(Description="Archives or unarchives one of the caller's own AI chats.") + export class ArchiveEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public archived: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ArchiveEndUserChatSessionRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Deletes one of the caller's own AI chats. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}", "DELETE") + // @Api(Description="Deletes one of the caller's own AI chats.") + export class DeleteEndUserChatSessionRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteEndUserChatSessionRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Returns a page of one of the caller's own AI chat transcripts. */ + // @Route("/{version}/ai/chat/sessions/{SessionId}/entries", "GET") + // @Api(Description="Returns a page of one of the caller's own AI chat transcripts.") + export class GetEndUserChatEntriesRequest extends CodeMashRequestBase implements IReturn + { + public sessionId: string; + public afterSeq?: number; + public take?: number; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetEndUserChatEntriesRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetEndUserChatEntriesResponse(); } + } + + /** @description Sends a message to the AI chat; the answer streams on the caller's channel. */ + // @Route("/{version}/ai/chat/turn", "POST") + // @Api(Description="Sends a message to the AI chat; the answer streams on the caller's channel.") + export class StartEndUserChatTurnRequest extends CodeMashRequestBase implements IReturn + { + public sessionId?: string; + public assistantId?: string; + public message: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'StartEndUserChatTurnRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new StartEndUserChatTurnResponse(); } + } + + /** @description Lists the AI tools a project user may use: only their own data (own:* toolsets). */ + // @Route("/{version}/ai/tools", "GET") + // @Api(Description="Lists the AI tools a project user may use: only their own data (own:* toolsets).") + export class GetEndUserAiToolsRequest extends RequestBase implements IReturn + { + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetEndUserAiToolsRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetEndUserAiToolsResponse(); } + } + + /** @description Invokes one own-scope AI tool as the calling project user. */ + // @Route("/{version}/ai/tools/{ToolName}", "POST") + // @Api(Description="Invokes one own-scope AI tool as the calling project user.") + export class InvokeEndUserAiToolRequest extends RequestBase implements IReturn + { + public toolName: string; + public argumentsJson?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'InvokeEndUserAiToolRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new InvokeEndUserAiToolResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/block", "PATCH") + // @Api(Description="Membership") + // @DataContract + export class BlockUserRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user to block, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to block, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'BlockUserRequest'; } + public getMethod() { return 'PATCH'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/service", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveSystemUserWithPermissions extends SaveUserWithRolesBase implements IReturn + { + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveSystemUserWithPermissions'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/guest", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveGuestUser extends SaveUser implements IReturn + { + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveGuestUser'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/user-name", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveUserNameUser extends SaveUser implements IReturn + { + // @DataMember + public password: string; + + // @DataMember + public userName: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveUserNameUser'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/email", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveEmailUser extends SaveUser implements IReturn + { + // @DataMember + public password: string; + + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveEmailUser'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/phone", "POST") + // @Api(Description="Membership") + // @DataContract + export class SavePhoneUser extends SaveUser implements IReturn + { + /** @description Phone number for the new user, in E.164 format. */ + // @DataMember + // @ApiMember(Description="Phone number for the new user, in E.164 format.", IsRequired=true) + public phone: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SavePhoneUser'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/phone-with-permissions", "POST") + // @Api(Description="Membership") + // @DataContract + export class SavePhoneUserNameWithPermissions extends SaveUserWithRolesBase implements IReturn + { + // @DataMember + public phone: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SavePhoneUserNameWithPermissions'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/email-with-permissions", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveEmailUserNameWithPermissions extends SaveUserWithRolesBase implements IReturn + { + // @DataMember + public password: string; + + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveEmailUserNameWithPermissions'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/register/user-name-with-permissions", "POST") + // @Api(Description="Membership") + // @DataContract + export class SaveUserNameWithPermissions extends SaveUserWithRolesBase implements IReturn + { + // @DataMember + public password: string; + + // @DataMember + public userName: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SaveUserNameWithPermissions'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth", "DELETE") + // @Api(Description="Membership") + // @DataContract + export class DeleteUserRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user to delete, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to delete, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteUserRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}", "GET") + // @Api(Description="Membership") + // @DataContract + export class GetUserRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user to fetch, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to fetch, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetUserRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetUserResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth", "GET") + // @Api(Description="Membership") + // @DataContract + export class GetUsersRequest extends CodeMashListPaginationRequestBase implements IReturn + { + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + /** @description Include each user's effective permissions in the result. */ + // @DataMember + // @ApiMember(Description="Include each user's effective permissions in the result.") + public includePermissions: boolean; + + /** @description Only return users that have a registered push device. */ + // @DataMember + // @ApiMember(Description="Only return users that have a registered push device.") + public userShouldHavePushDevice: boolean; + + /** @description Only return users that have an email address. */ + // @DataMember + // @ApiMember(Description="Only return users that have an email address.") + public userShouldHaveEmail: boolean; + + /** @description Include each user's metadata in the result. */ + // @DataMember + // @ApiMember(Description="Include each user's metadata in the result.") + public includeMeta: boolean; + + /** @description Filter to users that have any of these role names. */ + // @DataMember + // @ApiMember(Description="Filter to users that have any of these role names.") + public roleNames?: string[]; + + /** @description Filter to these specific user ids. */ + // @DataMember + // @ApiMember(Description="Filter to these specific user ids.") + public userIds?: string[]; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetUsersRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetUsersResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}/preferences", "GET") + // @Api(Description="Membership") + // @DataContract + export class GetUserPreferencesRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user whose preferences to fetch, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user whose preferences to fetch, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the project's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the project's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetUserPreferencesRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetUserPreferencesResponse(); } + } + + // @Route("/{version}/membership/users/{contactId}/marketing-state/{channel}/consent", "POST") + export class GrantContactConsentRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user (contact) to grant consent for. */ + // @ApiMember(Description="Id of the user (contact) to grant consent for.", IsRequired=true) + public contactId: string; + + /** @description Delivery channel to grant consent on: Email, Sms, or Push. */ + // @ApiMember(Description="Delivery channel to grant consent on: Email, Sms, or Push.", IsRequired=true) + public channel: string; + + /** @description Lawful basis for the consent, e.g. Consent. Defaults to Consent. */ + // @ApiMember(Description="Lawful basis for the consent, e.g. Consent. Defaults to Consent.") + public lawfulBasis: string; + + /** @description Source of the consent, e.g. UserOptIn. Defaults to UserOptIn. */ + // @ApiMember(Description="Source of the consent, e.g. UserOptIn. Defaults to UserOptIn.") + public source: string; + + /** @description Optional free-text reference to evidence of consent (e.g. a form submission id). */ + // @ApiMember(Description="Optional free-text reference to evidence of consent (e.g. a form submission id).") + public evidenceRef?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GrantContactConsentRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/invite", "POST") + // @Api(Description="Membership") + // @DataContract + export class InviteUserRequest extends CodeMashRequestBase implements IReturn + { + /** @description Email address the invitation is sent to. */ + // @DataMember + // @ApiMember(Description="Email address the invitation is sent to.", IsRequired=true) + public email: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'InviteUserRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/{userId}/link-identity", "POST") + // @Api(Description="Membership") + // @DataContract + export class LinkIdentityRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public userId: string; + + // @DataMember + public provider: string; + + // @DataMember + public providerToken: string; + + // @DataMember + public emailToVerify?: string; + + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'LinkIdentityRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/users/{userId}/map-auth", "POST") + // @Api(Description="Membership") + export class MapAuthToUserRequest extends CodeMashRequestBase implements IReturn + { + public userId: string; + public authId: string; + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'MapAuthToUserRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/assign-roles", "PUT") + // @Api(Description="Membership") + // @DataContract + export class AssignRolePermissionsRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user login to assign roles to, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user login to assign roles to, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + /** @description The complete new list of role names (full replacement), from get_roles. */ + // @DataMember + // @ApiMember(Description="The complete new list of role names (full replacement), from get_roles.") + public roles?: string[]; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'AssignRolePermissionsRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/users/{userId}/roles", "PUT") + // @Api(Description="Membership") + // @DataContract + export class SetContactRolesRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the human user to assign roles to. */ + // @DataMember + // @ApiMember(Description="Id of the human user to assign roles to.", IsRequired=true) + public userId: string; + + /** @description The complete new list of role ids (full replacement), from get_roles. Empty/omitted clears all roles. */ + // @DataMember + // @ApiMember(Description="The complete new list of role ids (full replacement), from get_roles. Empty/omitted clears all roles.") + public roles?: string[]; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SetContactRolesRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + // @Route("/{version}/membership/users/{contactId}/marketing-state/{commChannel}/{channel}/tags/{tag}", "PUT") + export class SetContactTagSubscriptionRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user (contact) to update. */ + // @ApiMember(Description="Id of the user (contact) to update.", IsRequired=true) + public contactId: string; + + /** @description Communication channel type: Marketing or Transactional. */ + // @ApiMember(Description="Communication channel type: Marketing or Transactional.", IsRequired=true) + public commChannel: string; + + /** @description Delivery channel: Email, Sms, or Push. */ + // @ApiMember(Description="Delivery channel: Email, Sms, or Push.", IsRequired=true) + public channel: string; + + /** @description The tag name; must already exist for the communication channel. */ + // @ApiMember(Description="The tag name; must already exist for the communication channel.", IsRequired=true) + public tag: string; + + /** @description True to subscribe (unblock) the tag, false to block it. */ + // @ApiMember(Description="True to subscribe (unblock) the tag, false to block it.") + public subscribed: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'SetContactTagSubscriptionRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/unblock", "PATCH") + // @Api(Description="Membership") + // @DataContract + export class UnblockUserRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user to unblock, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to unblock, from get_users.", IsRequired=true) + public id: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UnblockUserRequest'; } + public getMethod() { return 'PATCH'; } + public createResponse() { return new EmptyResponse(); } + } + + // @Route("/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe", "POST") + export class UnsubscribeContactRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user (contact) to unsubscribe. */ + // @ApiMember(Description="Id of the user (contact) to unsubscribe.", IsRequired=true) + public contactId: string; + + /** @description Delivery channel to unsubscribe from: Email, Sms, or Push. */ + // @ApiMember(Description="Delivery channel to unsubscribe from: Email, Sms, or Push.", IsRequired=true) + public channel: string; + + /** @description Optional suppression reason name explaining why consent was revoked. */ + // @ApiMember(Description="Optional suppression reason name explaining why consent was revoked.") + public reason?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UnsubscribeContactRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth", "PUT") + // @Api(Description="Membership") + // @DataContract + export class UpdateUserRequest extends SaveUser implements IReturn + { + /** @description Id of the user to update, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to update, from get_users.", IsRequired=true) + public id: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UpdateUserRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new IdResponse(); } + } + + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}/preferences", "PUT") + // @Api(Description="Membership") + // @DataContract + export class UpdateUserPreferencesRequest extends CodeMashRequestBase implements IReturn + { + /** @description Id of the user to update, from get_users. */ + // @DataMember + // @ApiMember(Description="Id of the user to update, from get_users.", IsRequired=true) + public id: string; + + /** @description When true, blocks all marketing messages to this user. */ + // @DataMember + // @ApiMember(Description="When true, blocks all marketing messages to this user.") + public blockAllMarketingMessages: boolean; + + /** @description Per communication channel, the set of tags blocked for this user. Full replacement. */ + // @DataMember + // @ApiMember(Description="Per communication channel, the set of tags blocked for this user. Full replacement.") + public blockedTags?: { [index:string]: HashSet; }; + + /** @description Database integration id. Optional — defaults to the project's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the project's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UpdateUserPreferencesRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/change", "POST") + // @Api(Description="Membership · Password") + // @DataContract + export class ChangePasswordRequest extends CodeMashRequestBase implements IReturn + { + /** @description The member's current password. */ + // @DataMember + // @ApiMember(Description="The member's current password.", IsRequired=true) + public currentPassword: string; + + /** @description The new password. Validated against the project's complexity policy. */ + // @DataMember + // @ApiMember(Description="The new password. Validated against the project's complexity policy.", IsRequired=true) + public newPassword: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ChangePasswordRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/reset/request", "POST") + // @Api(Description="Membership · Password") + // @DataContract + export class RequestPasswordResetRequest extends CodeMashRequestBase implements IReturn + { + /** @description Email address to send the reset link to. */ + // @DataMember + // @ApiMember(Description="Email address to send the reset link to.", IsRequired=true) + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RequestPasswordResetRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/reset/confirm", "POST") + // @Api(Description="Membership · Password") + // @DataContract + export class ConfirmPasswordResetRequest extends CodeMashRequestBase implements IReturn + { + /** @description One-time reset token from the email link. */ + // @DataMember + // @ApiMember(Description="One-time reset token from the email link.", IsRequired=true) + public token: string; + + /** @description The new password. Validated against the project's complexity policy. */ + // @DataMember + // @ApiMember(Description="The new password. Validated against the project's complexity policy.", IsRequired=true) + public newPassword: string; + + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + // @DataMember + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ConfirmPasswordResetRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/authentication-options", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class PasskeyAuthenticationOptionsRequest extends CodeMashRequestBase implements IReturn, IPasskeyCeremonyRequest + { + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'PasskeyAuthenticationOptionsRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyCeremonyOptionsResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/verify-authentication", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class VerifyPasskeyAuthenticationRequest extends CodeMashRequestBase implements IReturn, IPasskeyCeremonyRequest + { + // @DataMember + public ceremonyId: string; + + // @DataMember + public assertionResponse: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'VerifyPasskeyAuthenticationRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyAuthTokensResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys", "GET") + // @Api(Description="Membership · Passkey") + // @DataContract + export class ListPasskeysRequest extends CodeMashRequestBase implements IReturn + { + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ListPasskeysRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new PasskeyListResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/rename", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class RenamePasskeyRequest extends CodeMashRequestBase implements IReturn + { + /** @description Base64 credential id of the passkey to rename, from list_passkeys. */ + // @DataMember + // @ApiMember(Description="Base64 credential id of the passkey to rename, from list_passkeys.", IsRequired=true) + public credentialId: string; + + /** @description The new friendly name for the passkey. */ + // @DataMember + // @ApiMember(Description="The new friendly name for the passkey.", IsRequired=true) + public friendlyName: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RenamePasskeyRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/revoke", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class RevokePasskeyRequest extends CodeMashRequestBase implements IReturn + { + /** @description Base64 credential id of the passkey to revoke, from list_passkeys. */ + // @DataMember + // @ApiMember(Description="Base64 credential id of the passkey to revoke, from list_passkeys.", IsRequired=true) + public credentialId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RevokePasskeyRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/use-code", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class UseRecoveryCodeRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public email: string; + + // @DataMember + public recoveryCode: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UseRecoveryCodeRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyRecoveryResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/magic-link/request", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class RequestMagicLinkRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RequestMagicLinkRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/magic-link/consume", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class ConsumeMagicLinkRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public token: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ConsumeMagicLinkRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyRecoveryResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/has-passkey", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class HasPasskeyRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'HasPasskeyRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/email/start-verification", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class StartEmailVerificationRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'StartEmailVerificationRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/email/confirm-verification", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class ConfirmEmailVerificationRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public email: string; + + // @DataMember + public code: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ConfirmEmailVerificationRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyVerificationTokenResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/registration-options", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class PasskeyRegistrationOptionsRequest extends CodeMashRequestBase implements IReturn, IPasskeyCeremonyRequest + { + // @DataMember + public verificationToken: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'PasskeyRegistrationOptionsRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyCeremonyOptionsResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/verify-registration", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class VerifyPasskeyRegistrationRequest extends CodeMashRequestBase implements IReturn, IPasskeyCeremonyRequest + { + // @DataMember + public verificationToken: string; + + // @DataMember + public ceremonyId: string; + + // @DataMember + public attestationResponse: string; + + // @DataMember + public friendlyName?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'VerifyPasskeyRegistrationRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyAuthTokensResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/token/refresh", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class RefreshPasskeyTokenRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public refreshToken?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RefreshPasskeyTokenRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyAuthTokensResponse(); } + } + + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/logout", "POST") + // @Api(Description="Membership · Passkey") + // @DataContract + export class PasskeyLogoutRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public refreshToken?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'PasskeyLogoutRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new PasskeyOkResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/merged-tree", "GET") + // @Api(Description="Database") + // @DataContract + export class FindMergedTermTreeRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public taxonomyName: string; + + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindMergedTermTreeRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindMergedTermTreeResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/taxonomies/tree", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTaxonomyTreeRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public includeTerms: boolean; + + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindTaxonomyTreeRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindTaxonomyTreeResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermsRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public taxonomyName: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public filter?: string; + + // @DataMember + public sortDescending: boolean; + + // @DataMember + public pagingArgs?: PagingArgs; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindTermsRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindTermsResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermsChildrenRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public taxonomyName: string; + + // @DataMember + public parentId: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public filter?: string; + + // @DataMember + public pagingArgs?: PagingArgs; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindTermsChildrenRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindTermsChildrenResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/tree", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermTreeRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public taxonomyName: string; + + // @DataMember + public rootTermId?: string; + + // @DataMember + public depth?: number; + + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindTermTreeRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindTermTreeResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/schemas/{id}", "GET") + // @Api(Description="Database") + // @DataContract + export class GetDatabaseSchemaRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public id: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetDatabaseSchemaRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetDatabaseSchemaResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/schemas", "GET") + // @Api(Description="Database") + // @DataContract + export class GetDatabaseSchemasRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public pagingArgs?: PagingArgs; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetDatabaseSchemasRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetDatabaseSchemasResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/aggregate", "POST") + // @Api(Description="Database") + // @DataContract + export class AggregateRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public pipeline: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'AggregateRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new AggregateResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}/responsibility", "PUT") + // @Api(Description="Database") + // @DataContract + export class ChangeResponsibilityRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public id: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public newResponsibleUserId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ChangeResponsibilityRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/count", "GET") + // @Api(Description="Database") + // @DataContract + export class CountRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public filter?: string; + + // @DataMember + public schemaVersion?: number; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'CountRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new CountResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/many", "DELETE") + // @Api(Description="Database") + // @DataContract + export class DeleteManyRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public filter: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); + // @DataMember + public allRecords?: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteManyRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } } - public getTypeName() { - return 'ProjectDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class ProjectNameUpdated { - public projectId: ProjectId; - public name: ProjectName; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "DELETE") + // @Api(Description="Database") + // @DataContract + export class DeleteOneRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectNameUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public id: string; - export class ProjectDescriptionUpdated { - public projectId: ProjectId; - public description?: string; + // @DataMember + public databaseIntegrationId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectDescriptionUpdated'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteOneRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class ProjectUrlUpdated { - public projectId: ProjectId; - public url?: DomainUrl; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/distinct", "GET") + // @Api(Description="Database") + // @DataContract + export class DistinctRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectUrlUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public databaseIntegrationId?: string; - export class ProjectAllowedOriginsUpdated { - public origins?: DomainUrl[]; - public projectId: ProjectId; + // @DataMember + public field: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectAllowedOriginsUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public filter?: string; - export class ProjectDefaultLanguageUpdated { - public language: Language; - public projectId: ProjectId; + // @DataMember + public schemaVersion?: number; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectDefaultLanguageUpdated'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DistinctRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new DistinctResponse(); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class ProjectLanguagesUpdated { - public projectId: ProjectId; - public languages: Language[]; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectLanguagesUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute", "POST") + // @Api(Description="Database") + // @DataContract + export class ExecuteAggregateRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - export class ProjectLogoUpdated { - public projectId: ProjectId; - public logo?: ProjectLogo; + // @DataMember + public aggregateId: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectLogoUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public databaseIntegrationId?: string; - export class ProjectIconUpdated { - public projectId: ProjectId; - public icon?: ProjectIcon; + // @DataMember + public tokens?: { [index:string]: string; }; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectIconUpdated'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ExecuteAggregateRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new ExecuteAggregateResponse(); } } - public createResponse() {} - } - export class ProjectMainColorUpdated { - public projectId: ProjectId; - public color?: BrandColor; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectMainColorUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}", "GET") + // @Api(Description="Database") + // @DataContract + export class FindRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - export class ProjectAccentColorUpdated { - public projectId: ProjectId; - public color?: BrandColor; + // @DataMember + public databaseIntegrationId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectAccentColorUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public filter?: string; - export class ProjectRegionsUpdated { - public projectId: ProjectId; - public regions?: ProjectRegion[]; + // @DataMember + public schemaVersion?: number; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'ProjectRegionsUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public pagingArgs?: PagingArgs; - // @DataContract - export class AccountUserPushDeviceCreated { - // @DataMember - public userId: UserId; + // @DataMember + public sortBy?: string; - // @DataMember - public pushDevice: PushDevice; + // @DataMember + public sortOrder?: number; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AccountUserPushDeviceCreated'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindResponse(); } } - public createResponse() {} - } - /** @description Membership */ - // @Route("/{version}/membership/users/block", "PATCH") - // @Api(Description="Membership") - // @DataContract - export class BlockUser - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public id: string; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "GET") + // @Api(Description="Database") + // @DataContract + export class FindOneRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'BlockUser'; - } - public getMethod() { - return 'PATCH'; - } - public createResponse() { - return new EmptyResponse(); - } - } + // @DataMember + public id: string; - /** @description Membership */ - // @Route("/{version}/membership/users/register/service", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveSystemUserWithPermissions - extends SaveUserWithRolesBase - implements IReturn - { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SaveSystemUserWithPermissions'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } + // @DataMember + public databaseIntegrationId?: string; - /** @description Membership */ - // @Route("/{version}/membership/users/register/guest", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveGuestUser extends SaveUser implements IReturn { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindOneRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindOneResponse(); } } - public getTypeName() { - return 'SaveGuestUser'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - /** @description Membership */ - // @Route("/{version}/membership/users/register/user-name", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveUserNameUser - extends SaveUser - implements IReturn - { - // @DataMember - public password: string; - - // @DataMember - public userName: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SaveUserNameUser'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/register/email", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveEmailUser extends SaveUser implements IReturn { - // @DataMember - public password: string; - - // @DataMember - public email: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SaveEmailUser'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/register/phone", "POST") - // @Api(Description="Membership") - // @DataContract - export class SavePhoneUser extends SaveUser implements IReturn { - // @DataMember - public phone: string; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/own", "GET") + // @Api(Description="Database") + // @DataContract + export class FindOwnRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SavePhoneUser'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/register/phone-with-permissions", "POST") - // @Api(Description="Membership") - // @DataContract - export class SavePhoneUserNameWithPermissions - extends SaveUserWithRolesBase - implements IReturn - { - // @DataMember - public phone: string; + // @DataMember + public databaseIntegrationId?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SavePhoneUserNameWithPermissions'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/register/email-with-permissions", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveEmailUserNameWithPermissions - extends SaveUserWithRolesBase - implements IReturn - { - // @DataMember - public password: string; + // @DataMember + public filter?: string; - // @DataMember - public email: string; + // @DataMember + public schemaVersion?: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SaveEmailUserNameWithPermissions'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/register/user-name-with-permissions", "POST") - // @Api(Description="Membership") - // @DataContract - export class SaveUserNameWithPermissions - extends SaveUserWithRolesBase - implements IReturn - { - // @DataMember - public password: string; - - // @DataMember - public userName: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'SaveUserNameWithPermissions'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new IdResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users", "DELETE") - // @Api(Description="Membership") - // @DataContract - export class DeleteUser - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public id: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DeleteUser'; - } - public getMethod() { - return 'DELETE'; - } - public createResponse() { - return new EmptyResponse(); - } - } - - // @Route("/{version}/membership/users/{id}", "GET") - export class GetUser - extends CodeMashRequestBase - implements IReturn - { - public id: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'GetUser'; - } - public getMethod() { - return 'GET'; - } - public createResponse() { - return new GetUserResponse(); - } - } - - // @Route("/{version}/membership/users", "GET") - export class GetUsers - extends CodeMashListPaginationRequestBase - implements IReturn - { - public includePermissions: boolean; - public userShouldHavePushDevice: boolean; - public userShouldHaveEmail: boolean; - public includeMeta: boolean; - public roleNames?: string[]; - public userIds?: string[]; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'GetUsers'; - } - public getMethod() { - return 'GET'; - } - public createResponse() { - return new GetUsersResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/invite", "POST") - // @Api(Description="Membership") - // @DataContract - export class InviteUser - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public email: string; + // @DataMember + public pagingArgs?: PagingArgs; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'FindOwnRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new FindResponse(); } } - public getTypeName() { - return 'InviteUser'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new EmptyResponse(); - } - } - - /** @description Membership */ - // @Route("/{version}/membership/users/assign-roles", "PUT") - // @Api(Description="Membership") - // @DataContract - export class AssignRolePermissions - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public id: string; - // @DataMember - public roles?: RoleName[]; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/many", "POST") + // @Api(Description="Database") + // @DataContract + export class InsertManyRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'AssignRolePermissions'; - } - public getMethod() { - return 'PUT'; - } - public createResponse() { - return new EmptyResponse(); - } - } + // @DataMember + public databaseIntegrationId?: string; - /** @description Membership */ - // @Route("/{version}/membership/users/unblock", "PATCH") - // @Api(Description="Membership") - // @DataContract - export class UnblockUser - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public id: string; + // @DataMember + public documents: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UnblockUser'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'InsertManyRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } } - public getMethod() { - return 'PATCH'; - } - public createResponse() { - return new EmptyResponse(); - } - } - /** @description Membership */ - // @Route("/{version}/membership/users", "PUT") - // @Api(Description="Membership") - // @DataContract - export class UpdateUser extends SaveUser implements IReturn { - // @DataMember - public id: string; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UpdateUser'; - } - public getMethod() { - return 'PUT'; - } - public createResponse() { - return new IdResponse(); - } - } + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}", "POST") + // @Api(Description="Database") + // @DataContract + export class InsertOneRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - export class MembershipEstablished { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipEstablished'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public databaseIntegrationId?: string; - export class MembershipEnabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public document: string; - export class MembershipDisabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipDisabled'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'InsertOneRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new IdResponse(); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - export class PolicyCreated { - public policyPermissions: CustomPolicyPermissions; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}/replace", "PUT") + // @Api(Description="Database") + // @DataContract + export class ReplaceOneRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PolicyCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public id: string; + + // @DataMember + public databaseIntegrationId?: string; - export class PolicyUpdated { - public policyName: DisplayName; - public description?: string; - public policyPermissions: CustomPolicyPermissions; + // @DataMember + public replacement: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PolicyUpdated'; - } - public getMethod() { - return 'POST'; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ReplaceOneRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } } - public createResponse() {} - } - export class PolicyDeleted { - public policyId: CustomPolicyId; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/many", "PUT") + // @Api(Description="Database") + // @DataContract + export class UpdateManyRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public databaseIntegrationId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PolicyDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public filter: string; - export class RoleCreated { - public roleName: RoleName; - public description?: string; - public policyIds?: CustomPolicyId[]; + // @DataMember + public allRecords?: boolean; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'RoleCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public update: string; - export class RoleUpdated { - public roleName: RoleName; - public description?: string; - public policyIds?: CustomPolicyId[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UpdateManyRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "PUT") + // @Api(Description="Database") + // @DataContract + export class UpdateOneRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public collectionName: string; + + // @DataMember + public id: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'RoleUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember + public databaseIntegrationId?: string; - export class RoleDeleted { - public roleName: RoleName; + // @DataMember + public update: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'UpdateOneRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/commit", "POST") + // @Api(Description="Files") + // @DataContract + export class CommitUploadRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + // @DataMember + public contentType?: string; + + // @DataMember + public sizeBytes?: number; + + // @DataMember + public fileName?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'CommitUploadRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/content", "GET") + // @Api(Description="Files") + // @DataContract + export class GetFileContentRequest extends RequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + // @DataMember + public token?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetFileContentRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new Blob(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/content", "PUT") + // @Api(Description="Files") + // @DataContract + export class PutFileContentRequest extends RequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + // @DataMember + public token?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'PutFileContentRequest'; } + public getMethod() { return 'PUT'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}", "DELETE") + // @Api(Description="Files") + // @DataContract + export class DeleteFileApiRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteFileApiRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/bulk", "DELETE") + // @Api(Description="Files") + // @DataContract + export class DeleteManyFilesApiRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember(Name="paths[]") + public paths__: string[] = []; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DeleteManyFilesApiRequest'; } + public getMethod() { return 'DELETE'; } + public createResponse() { return new EmptyResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/download", "GET") + // @Api(Description="Files") + // @DataContract + export class DownloadFileApiRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'DownloadFileApiRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new Blob(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/info", "GET") + // @Api(Description="Files") + // @DataContract + export class GetFileInfoRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetFileInfoRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetFileInfoResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/sign", "GET") + // @Api(Description="Files") + // @DataContract + export class GetSignedUrlRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + // @DataMember + public expirationSeconds?: number; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetSignedUrlRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new GetSignedUrlResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}", "GET") + // @Api(Description="Files") + // @DataContract + export class ListFilesRequest extends CodeMashListPaginationRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'ListFilesRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new ListFilesResponse(); } + } + + /** @description Files */ + // @Route("/{version}/files/public/{PublicId}/{Name*}", "GET") + // @Api(Description="Files") + // @DataContract + export class GetPublicFileRequest extends RequestBase implements IReturn + { + // @DataMember + public publicId?: string; + + // @DataMember + public name?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'GetPublicFileRequest'; } + public getMethod() { return 'GET'; } + public createResponse() { return new Blob(); } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/upload-url", "POST") + // @Api(Description="Files") + // @DataContract + export class RequestUploadUrlRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public path: string; + + // @DataMember + public contentType: string; + + // @DataMember + public expirationSeconds?: number; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'RequestUploadUrlRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new RequestUploadUrlResponse(); } + } - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'RoleDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/test", "POST") + // @Api(Description="Files") + // @DataContract + export class TestFilesIntegrationRequest extends CodeMashRequestBase implements IReturn + { + // @DataMember + public filesIntegrationId: string; - // @DataContract - export class MembershipTriggerCalled { - // @DataMember - public userId: UserId; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } + public getTypeName() { return 'TestFilesIntegrationRequest'; } + public getMethod() { return 'POST'; } + public createResponse() { return new TestFilesIntegrationResponse(); } + } + + /** @description Sign In */ + // @Route("/auth", "GET,POST") + // @Route("/auth/{provider}", "GET,POST") + // @Route("/v3/auth", "POST,GET,OPTIONS") + // @Route("/v3/auth/{provider}", "POST,GET,OPTIONS") + // @Api(Description="Sign In") + // @DataContract + export class Authenticate implements IReturn, IPost + { + /** @description AuthProvider, e.g. credentials */ + // @DataMember(Order=1) + public provider?: string; - // @DataMember - public from?: UserGeneralInfo; + // @DataMember(Order=2) + public userName?: string; - // @DataMember - public to?: UserGeneralInfo; + // @DataMember(Order=3) + public password?: string; - // @DataMember - public emailAddress?: EmailAddress; + // @DataMember(Order=4) + public rememberMe?: boolean; - // @DataMember - public correlationId: string; + // @DataMember(Order=5) + public accessToken?: string; - // @DataMember - public trigger: MembershipTrigger; + // @DataMember(Order=6) + public accessTokenSecret?: string; + + // @DataMember(Order=7) + public returnUrl?: string; - // @DataMember - public createdOn: UtcDateTime; + // @DataMember(Order=8) + public errorView?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerCalled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=9) + public meta?: { [index:string]: string; }; - // @DataContract - export class MembershipTriggerCreated { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerCreated'; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + public getTypeName() { return 'Authenticate'; } + public getMethod() { return 'POST'; } + public createResponse() { return new AuthenticateResponse(); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - // @DataContract - export class MembershipTriggerChanged { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerChanged'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @Route("/access-token") + // @DataContract + export class GetAccessToken implements IReturn, IPost + { + // @DataMember(Order=1) + public refreshToken?: string; - // @DataContract - export class MembershipTriggerEnabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } + // @DataMember(Order=2) + public meta?: { [index:string]: string; }; - // @DataContract - export class MembershipTriggerDisabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerDisabled'; + public constructor(init?: Partial) { (Object as any).assign(this, init); } + public getTypeName() { return 'GetAccessToken'; } + public getMethod() { return 'POST'; } + public createResponse() { return new GetAccessTokenResponse(); } } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggerDeleted { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggersProcessingStarted extends TriggersProcessingStarted { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggersProcessingStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggerStarted extends TriggerStarted { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggerFailed extends TriggerFailed { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerFailed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggerFinished extends TriggerFinished { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggerFinished'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - // @DataContract - export class MembershipTriggersProcessingStopped extends TriggersProcessingStopped { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'MembershipTriggersProcessingStopped'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserRegistered { - public user: User; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserRegistered'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserUpdated { - public userId: UserId; - public from: UserGeneralInfo; - public to: UserGeneralInfo; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserBlocked { - public user?: UserGeneralInfo; - public userId: UserId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserBlocked'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserUnblocked { - public user?: UserGeneralInfo; - public userId: UserId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserUnblocked'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserInvited { - public emailAddress: EmailAddress; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserInvited'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserVerified { - public userId: UserId; - public user?: UserGeneralInfo; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserVerified'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserDeleted { - public user?: UserGeneralInfo; - public userId: UserId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class UserNotificationsDeliveryPreferencesSaved { - public userId: UserId; - public blockAllMarketingMessages: boolean; - public subscribedToTags?: { [index: string]: Tag[] }; - - public constructor( - init?: Partial, - ) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'UserNotificationsDeliveryPreferencesSaved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseEstablished { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseEstablished'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseEnabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseDisabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationCreated { - public integration: DatabaseIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationChanged { - public integration: DatabaseIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationChanged'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationSetAsDefault { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationSetAsDefault'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationDeleted { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationEnabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class DatabaseIntegrationDisabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'DatabaseIntegrationDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailBatchRegistered { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public startingAfter?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailBatchRegistered'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailBatchStarted { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public recipients: EmailRecipients; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailBatchStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailBatchCompleted { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailBatchCompleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailBatchFailed { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailBatchFailed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailNotificationProcessed { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public campaignBatchNotificationId: NotificationId; - public sendNotificationResult?: SendNotificationResult; - public recipients: EmailRecipients; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailNotificationProcessed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailNotificationRead { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public notificationId: NotificationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailNotificationRead'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailNotificationClicked { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public notificationId: NotificationId; - public sourceId?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailNotificationClicked'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignCreated extends EventBase { - public campaign: EmailCampaign; - public emailTemplate: EmailTemplate; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignScheduled { - public campaignId: CampaignId; - public dateTime: UtcDateTime; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignScheduled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignStarted { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignStopped { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignStopped'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignCompleted { - public campaignId: CampaignId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignCompleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignFailed { - public campaignId: CampaignId; - public errors: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignFailed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailCampaignDeleted { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailCampaignDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailServiceEstablished { - public defaultTemplates?: EmailTemplate[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailServiceEstablished'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailServiceEnabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailServiceEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailServiceDisabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailServiceDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationCreated { - public integration: EmailIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationUpdated { - public integration?: EmailIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationSetAsDefault { - public integrationId?: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationSetAsDefault'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationDeleted { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationEnabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailIntegrationDisabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailIntegrationDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailSignatureSaved { - public signature: EmailSignature; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailSignatureSaved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailSignatureDeleted { - public id: EmailSignatureId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailSignatureDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateCreated { - public template: EmailTemplate; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateUpdated { - public template: EmailTemplate; - public filesToBeDeleted?: string[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateDeleted { - public templateId: TemplateId; - public filesToBeDeleted?: string[]; - public fileIntegrationId?: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateArchived { - public templateId: TemplateId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateArchived'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateUnArchived { - public templateId: TemplateId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateUnArchived'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailTemplateCloned { - public templateIdFrom: TemplateId; - public template: EmailTemplate; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailTemplateCloned'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailFooterSaved { - public footer: EmailFooter; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailFooterSaved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class EmailFooterDeleted { - public id: EmailFooterId; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'EmailFooterDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushBatchRegistered { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public startingAfter?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushBatchRegistered'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushBatchStarted { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public recipients: PushRecipients; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushBatchStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushBatchCompleted { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushBatchCompleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushBatchFailed { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushBatchFailed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushNotificationProcessed { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public campaignBatchNotificationId: NotificationId; - public sendNotificationResult?: SendNotificationResult; - public recipients: PushRecipients; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushNotificationProcessed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushNotificationRead { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public notificationId: NotificationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushNotificationRead'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushNotificationClicked { - public campaignId: CampaignId; - public campaignBatchId: CampaignBatchId; - public notificationId: NotificationId; - public sourceId?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushNotificationClicked'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignCreated { - public campaign: PushCampaign; - public pushTemplate: PushTemplate; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignScheduled { - public campaignId: CampaignId; - public dateTime: UtcDateTime; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignScheduled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignStarted { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignStarted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignStopped { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignStopped'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignCompleted { - public campaignId: CampaignId; - public errors?: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignCompleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignFailed { - public campaignId: CampaignId; - public errors: ErrorDto[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignFailed'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushCampaignDeleted { - public campaignId: CampaignId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushCampaignDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushDeviceCreated { - public pushDevice: PushDevice; - public userId: UserId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushDeviceCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationCreated { - public integration: PushIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationUpdated { - public integration?: PushIntegration; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationSetAsDefault { - public integrationId?: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationSetAsDefault'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationDeleted { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationEnabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushIntegrationDisabled { - public integrationId: IntegrationId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushIntegrationDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushServiceEstablished { - public defaultTemplates?: PushTemplate[]; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushServiceEstablished'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushServiceEnabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushServiceEnabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushServiceDisabled { - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushServiceDisabled'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushModuleTagSaved { - public tag: TagDefinition; - public communicationChannel: CommunicationChannel; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushModuleTagSaved'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushModuleTagDeleted { - public tag: Tag; - public communicationChannel: CommunicationChannel; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushModuleTagDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushTemplateCreated { - public template: PushTemplate; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushTemplateCreated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushTemplateUpdated { - public template: PushTemplate; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushTemplateUpdated'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushTemplateDeleted { - public templateId: TemplateId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushTemplateDeleted'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushTemplateArchived { - public templateId: TemplateId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushTemplateArchived'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - export class PushTemplateUnArchived { - public templateId: TemplateId; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'PushTemplateUnArchived'; - } - public getMethod() { - return 'POST'; - } - public createResponse() {} - } - - /** @description Sign In */ - // @Route("/auth", "GET,POST") - // @Route("/auth/{provider}", "GET,POST") - // @Api(Description="Sign In") - // @DataContract - export class Authenticate implements IReturn, IPost { - /** @description AuthProvider, e.g. credentials */ - // @DataMember(Order=1) - public provider: string; - - // @DataMember(Order=2) - public userName: string; - - // @DataMember(Order=3) - public password: string; - - // @DataMember(Order=4) - public rememberMe?: boolean; - - // @DataMember(Order=5) - public accessToken: string; - - // @DataMember(Order=6) - public accessTokenSecret: string; - - // @DataMember(Order=7) - public returnUrl: string; - - // @DataMember(Order=8) - public errorView: string; - - // @DataMember(Order=9) - public meta: { [index: string]: string }; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'Authenticate'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new AuthenticateResponse(); - } - } - - // @Route("/access-token") - // @DataContract - export class GetAccessToken - implements IReturn, IPost - { - // @DataMember(Order=1) - public refreshToken: string; - - // @DataMember(Order=2) - public meta: { [index: string]: string }; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'GetAccessToken'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new GetAccessTokenResponse(); - } - } - - // @Route("/apikeys") - // @Route("/apikeys/{Environment}") - // @DataContract - export class GetApiKeys implements IReturn, IGet { - // @DataMember(Order=1) - public environment: string; - - // @DataMember(Order=2) - public meta: { [index: string]: string }; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'GetApiKeys'; - } - public getMethod() { - return 'GET'; - } - public createResponse() { - return new GetApiKeysResponse(); - } - } - - // @Route("/apikeys/regenerate") - // @Route("/apikeys/regenerate/{Environment}") - // @DataContract - export class RegenerateApiKeys - implements IReturn, IPost - { - // @DataMember(Order=1) - public environment: string; - - // @DataMember(Order=2) - public meta: { [index: string]: string }; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - public getTypeName() { - return 'RegenerateApiKeys'; - } - public getMethod() { - return 'POST'; - } - public createResponse() { - return new RegenerateApiKeysResponse(); - } - } } + diff --git a/references/api_dtos.py b/references/api_dtos.py index e390126..1779480 100644 --- a/references/api_dtos.py +++ b/references/api_dtos.py @@ -310,6 +310,21 @@ class PublicAuthDto: password_policy: Optional[PublicPasswordPolicyDto] = None +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class PublicAiAssistantDto: + id: Optional[str] = None + name: Optional[str] = None + welcome: Optional[str] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class PublicAiChatDto: + enabled: bool = False + assistants: List[PublicAiAssistantDto] = field(default_factory=list) + + @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ErrorDto: @@ -332,6 +347,99 @@ class ResponseBase: response_status: Optional[CodeMashResponseStatus] = None +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserChatAttachment: + id: Optional[str] = None + session_id: Optional[str] = None + file_name: Optional[str] = None + content_type: Optional[str] = None + kind: Optional[str] = None + size: int = 0 + summary: Optional[str] = None + created_at_utc: datetime.datetime = datetime.datetime(1, 1, 1) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserChatMemoryNote: + id: Optional[str] = None + session_id: Optional[str] = None + kind: Optional[str] = None + text: Optional[str] = None + created_at_utc: datetime.datetime = datetime.datetime(1, 1, 1) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserChatAssistant: + id: Optional[str] = None + name: Optional[str] = None + welcome_message: Optional[str] = None + is_default: bool = False + memory_enabled: bool = False + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserChatPlan: + id: Optional[str] = None + name: Optional[str] = None + quota_unit: Optional[str] = None + monthly_quota: int = 0 + used: int = 0 + remaining: int = 0 + attachments: bool = False + rag: bool = False + memory: bool = False + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserChatSession: + id: Optional[str] = None + assistant_id: Optional[str] = None + title: Optional[str] = None + is_pinned: bool = False + is_archived: bool = False + last_seq: int = 0 + created_at_utc: datetime.datetime = datetime.datetime(1, 1, 1) + updated_at_utc: datetime.datetime = datetime.datetime(1, 1, 1) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class AiChatEntryWireDto: + kind: Optional[str] = None + id: Optional[str] = None + seq: int = 0 + at_utc: datetime.datetime = datetime.datetime(1, 1, 1) + ref_entry_id: Optional[str] = None + work_item_id: Optional[str] = None + feedback: Optional[str] = None + feedback_at_utc: Optional[datetime.datetime] = None + feedback_by_user_auth_id: Optional[str] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserAiToolParameter: + name: Optional[str] = None + type: Optional[str] = None + required: bool = False + description: Optional[str] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class EndUserAiTool: + name: Optional[str] = None + description: Optional[str] = None + toolsets: List[str] = field(default_factory=list) + requires_confirmation: bool = False + parameters: List[EndUserAiToolParameter] = field(default_factory=list) + + class AuthType(str, Enum): SERVICE = 'Service' EMAIL = 'Email' @@ -501,11 +609,21 @@ class SchemaSettingsDto: description: Optional[str] = None +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class SchemaEmbedSettingsDto: + enabled: bool = False + fields: List[str] = field(default_factory=list) + embedding_integration_id: Optional[str] = None + per_user: bool = False + + class TriggerType(str, Enum): MEMBERSHIP = 'Membership' SCHEMA = 'Schema' FILES = 'Files' PAYMENTS = 'Payments' + AI = 'Ai' class TriggerActionType(str, Enum): @@ -550,6 +668,7 @@ class SchemaDto(IHasViewId): visual_schema: Optional[VisualSchemaDto] = None published_at: datetime.datetime = datetime.datetime(1, 1, 1) settings: Optional[SchemaSettingsDto] = None + embed: Optional[SchemaEmbedSettingsDto] = None triggers: Optional[List[TriggerDto]] = None @@ -563,6 +682,7 @@ class SchemaListProjection(IHasViewId): has_draft: bool = False meta_schema_version: int = 0 description: Optional[str] = None + env: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -766,6 +886,7 @@ class PublicProjectConfigDto: admin_portal_enabled: bool = False branding: Optional[PublicBrandDto] = None auth: Optional[PublicAuthDto] = None + ai_chat: Optional[PublicAiChatDto] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -777,6 +898,70 @@ class PublicLegalDocumentDto: available: bool = False +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatAttachmentsResponse(ResponseBase): + attachments: List[EndUserChatAttachment] = field(default_factory=list) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatMemoryResponse(ResponseBase): + notes: List[EndUserChatMemoryNote] = field(default_factory=list) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatAvailabilityResponse(ResponseBase): + enabled: bool = False + available: bool = False + reason: Optional[str] = None + default_assistant_id: Optional[str] = None + assistants: List[EndUserChatAssistant] = field(default_factory=list) + plan: Optional[EndUserChatPlan] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatSessionsResponse(ResponseBase): + sessions: List[EndUserChatSession] = field(default_factory=list) + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatSessionResponse(ResponseBase): + session: Optional[EndUserChatSession] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatEntriesResponse(ResponseBase): + session_id: Optional[str] = None + entries: List[AiChatEntryWireDto] = field(default_factory=list) + last_seq: int = 0 + has_more: bool = False + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class StartEndUserChatTurnResponse(ResponseBase): + turn_id: Optional[str] = None + session_id: Optional[str] = None + channel: Optional[str] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserAiToolsResponse(ResponseBase): + tools: Optional[List[EndUserAiTool]] = None + + +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class InvokeEndUserAiToolResponse(ResponseBase): + result: Optional[str] = None + + @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class GetUserResponse(ResponseBase): @@ -957,6 +1142,15 @@ class Echo(RequestBase, IReturn[EchoResponse]): pass +# @Route("/{version}/public/projects/{ProjectId}/brand/{Kind}", "GET") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetPublicProjectBrandAsset(RequestBase, IReturn[bytes]): + project_id: Optional[str] = None + kind: Optional[str] = None + v: Optional[str] = None + + # @Route("/{version}/public/projects/{ProjectId}/config", "GET") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass @@ -972,6 +1166,237 @@ class GetPublicProjectLegal(RequestBase, IReturn[PublicLegalDocumentDto]): kind: Optional[str] = None +# @Route("/{version}/ai/chat/sessions/{SessionId}/attachments", "POST") +# @Api(Description="Adds a file to one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class UploadEndUserChatAttachmentRequest(CodeMashRequestBase, IReturn[IdResponse]): + """ + Adds a file to one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + file_name: Optional[str] = None + content_type: Optional[str] = None + base64_content: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}/attachments", "GET") +# @Api(Description="Lists the files in one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatAttachmentsRequest(CodeMashRequestBase, IReturn[ListEndUserChatAttachmentsResponse]): + """ + Lists the files in one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + + +# @Route("/{version}/ai/chat/attachments/{AttachmentId}", "DELETE") +# @Api(Description="Removes a file from one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class DeleteEndUserChatAttachmentRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Removes a file from one of the caller's own AI chats. + """ + + attachment_id: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}/entries/{EntryId}/feedback", "PUT") +# @Api(Description="Likes, dislikes or clears one message of the caller's own AI chat.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class SetEndUserChatEntryFeedbackRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Likes, dislikes or clears one message of the caller's own AI chat. + """ + + session_id: Optional[str] = None + entry_id: Optional[str] = None + feedback: Optional[str] = None + + +# @Route("/{version}/ai/chat/memory", "GET") +# @Api(Description="Lists what the AI chat remembers about the caller.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatMemoryRequest(CodeMashRequestBase, IReturn[ListEndUserChatMemoryResponse]): + """ + Lists what the AI chat remembers about the caller. + """ + + take: Optional[int] = None + + +# @Route("/{version}/ai/chat/memory/{NoteId}", "DELETE") +# @Api(Description="Forgets one thing the AI chat remembers about the caller.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ForgetEndUserChatMemoryRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Forgets one thing the AI chat remembers about the caller. + """ + + note_id: Optional[str] = None + + +# @Route("/{version}/ai/chat/availability", "GET") +# @Api(Description="Whether the AI chat can run for the caller, and which assistants it offers.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatAvailabilityRequest(CodeMashRequestBase, IReturn[GetEndUserChatAvailabilityResponse]): + """ + Whether the AI chat can run for the caller, and which assistants it offers. + """ + + pass + + +# @Route("/{version}/ai/chat/sessions", "GET") +# @Api(Description="Lists the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ListEndUserChatSessionsRequest(CodeMashRequestBase, IReturn[ListEndUserChatSessionsResponse]): + """ + Lists the caller's own AI chats. + """ + + take: Optional[int] = None + include_archived: bool = False + + +# @Route("/{version}/ai/chat/sessions", "POST") +# @Api(Description="Opens a new AI chat for the caller.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class CreateEndUserChatSessionRequest(CodeMashRequestBase, IReturn[IdResponse]): + """ + Opens a new AI chat for the caller. + """ + + assistant_id: Optional[str] = None + title: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}", "GET") +# @Api(Description="Returns one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatSessionRequest(CodeMashRequestBase, IReturn[GetEndUserChatSessionResponse]): + """ + Returns one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}", "PATCH") +# @Api(Description="Renames one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class RenameEndUserChatSessionRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Renames one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + title: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}/pin", "PUT") +# @Api(Description="Pins or unpins one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class PinEndUserChatSessionRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Pins or unpins one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + pinned: bool = False + + +# @Route("/{version}/ai/chat/sessions/{SessionId}/archive", "PUT") +# @Api(Description="Archives or unarchives one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class ArchiveEndUserChatSessionRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Archives or unarchives one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + archived: bool = False + + +# @Route("/{version}/ai/chat/sessions/{SessionId}", "DELETE") +# @Api(Description="Deletes one of the caller's own AI chats.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class DeleteEndUserChatSessionRequest(CodeMashRequestBase, IReturn[EmptyResponse]): + """ + Deletes one of the caller's own AI chats. + """ + + session_id: Optional[str] = None + + +# @Route("/{version}/ai/chat/sessions/{SessionId}/entries", "GET") +# @Api(Description="Returns a page of one of the caller's own AI chat transcripts.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserChatEntriesRequest(CodeMashRequestBase, IReturn[GetEndUserChatEntriesResponse]): + """ + Returns a page of one of the caller's own AI chat transcripts. + """ + + session_id: Optional[str] = None + after_seq: Optional[int] = None + take: Optional[int] = None + + +# @Route("/{version}/ai/chat/turn", "POST") +# @Api(Description="Sends a message to the AI chat; the answer streams on the caller's channel.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class StartEndUserChatTurnRequest(CodeMashRequestBase, IReturn[StartEndUserChatTurnResponse]): + """ + Sends a message to the AI chat; the answer streams on the caller's channel. + """ + + session_id: Optional[str] = None + assistant_id: Optional[str] = None + message: Optional[str] = None + + +# @Route("/{version}/ai/tools", "GET") +# @Api(Description="Lists the AI tools a project user may use: only their own data (own:* toolsets).") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class GetEndUserAiToolsRequest(RequestBase, IReturn[GetEndUserAiToolsResponse]): + """ + Lists the AI tools a project user may use: only their own data (own:* toolsets). + """ + + pass + + +# @Route("/{version}/ai/tools/{ToolName}", "POST") +# @Api(Description="Invokes one own-scope AI tool as the calling project user.") +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class InvokeEndUserAiToolRequest(RequestBase, IReturn[InvokeEndUserAiToolResponse]): + """ + Invokes one own-scope AI tool as the calling project user. + """ + + tool_name: Optional[str] = None + arguments_json: Optional[str] = None + + # @Route("/{version}/membership/auth/block", "PATCH") # @Api(Description="Membership") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -1948,6 +2373,7 @@ class DeleteManyRequest(CodeMashRequestBase, IReturn[EmptyResponse]): collection_name: Optional[str] = None database_integration_id: Optional[str] = None filter: Optional[str] = None + all_records: Optional[bool] = None # @Route("/{version}/database/collections/{collectionName}/{id}", "DELETE") @@ -2098,6 +2524,7 @@ class UpdateManyRequest(CodeMashRequestBase, IReturn[EmptyResponse]): collection_name: Optional[str] = None database_integration_id: Optional[str] = None filter: Optional[str] = None + all_records: Optional[bool] = None update: Optional[str] = None diff --git a/references/hub2.dtos.ts b/references/hub2.dtos.ts index 7ef9f37..0e10cd1 100644 --- a/references/hub2.dtos.ts +++ b/references/hub2.dtos.ts @@ -1381,6 +1381,9 @@ export class TemplateDto implements IHasViewId, IHasDatabaseId // @DataMember public tags?: string[]; + // @DataMember + public env?: string; + public constructor(init?: Partial) { (Object as any).assign(this, init); } } @@ -2756,6 +2759,7 @@ export class LocalFilesIntegrationDto extends FilesIntegrationDto export class DatabaseIntegrationDto extends IntegrationDto { public provider: DatabaseProvider; + public isSystemOwned: boolean; public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } @@ -3075,6 +3079,9 @@ export class SchedulerTaskDto // @DataMember public stopOnError: boolean; + // @DataMember + public env?: string; + // @DataMember public createdAtUnix?: number; @@ -3248,6 +3255,9 @@ export class MongoDbAggregateDto implements IHasViewId // @DataMember public pipeline: string; + // @DataMember + public joinedCollections?: string[]; + public constructor(init?: Partial) { (Object as any).assign(this, init); } } @@ -4225,31 +4235,6 @@ export class ImportColumnMappingDto public constructor(init?: Partial) { (Object as any).assign(this, init); } } -export class AggregateId -{ - public value: string; - - public constructor(init?: Partial) { (Object as any).assign(this, init); } -} - -export class ProjectId extends AggregateId implements IHasDomainEntityId -{ - - public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } -} - -export class IntegrationId extends AggregateId implements IHasDomainEntityId -{ - - public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } -} - -export class TaxonomyId extends AggregateId implements IHasDomainEntityId -{ - - public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } -} - // @DataContract export enum EmailValidationProvider { @@ -4817,6 +4802,9 @@ export class PromotionResultDto // @DataMember public integrationsSeeded: PromotionItemDto[] = []; + // @DataMember + public integrationsToProvision: PromotionItemDto[] = []; + // @DataMember public integrationsSkipped: PromotionItemDto[] = []; @@ -5071,6 +5059,9 @@ export class SchemaTriggerDto extends TriggerDto // @DataMember public configurationCode?: string; + // @DataMember + public env?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } @@ -6396,6 +6387,9 @@ export class SchemaTriggerProjectionList extends TriggerProjectionList // @DataMember public type: SchemaTriggerType; + // @DataMember + public env?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } @@ -6455,6 +6449,17 @@ export class TaxonomyDto implements IHasViewId public constructor(init?: Partial) { (Object as any).assign(this, init); } } +export class TaxonomyRef +{ + // @DataMember + public id: string; + + // @DataMember + public name?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } +} + export class TaxonomyListProjection implements IHasViewId { // @DataMember @@ -6479,7 +6484,7 @@ export class TaxonomyListProjection implements IHasViewId public parentName?: string; // @DataMember - public dependencyNames?: string[]; + public dependencyRefs?: TaxonomyRef[]; public constructor(init?: Partial) { (Object as any).assign(this, init); } } @@ -6832,6 +6837,9 @@ export class DatabaseIntegrationListProjection extends IntegrationListProjection // @DataMember public provider: DatabaseProvider; + // @DataMember + public env?: string; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } @@ -7099,6 +7107,9 @@ export class TemplateListProjection implements IHasViewId, IHasDatabaseId // @DataMember public tags?: string[]; + // @DataMember + public env?: string; + public constructor(init?: Partial) { (Object as any).assign(this, init); } } @@ -9226,11 +9237,6 @@ export interface IHasRazorTemplateCode { } -export interface IHasDomainEntityId -{ - viewId: string; -} - export interface IHasResponsibleUserId { userId: string; @@ -14466,9 +14472,9 @@ export class GetDatabaseTaxonomyTreeRequest extends CodeMashRequestBase implemen // @DataContract export class SaveDatabaseTaxonomyRequest extends CodeMashRequestBase implements IReturn { - /** @description Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. */ + /** @description Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. An update replaces the whole taxonomy: send every field you want to keep (parentId, dependencies, description, schemas). */ // @DataMember - // @ApiMember(Description="Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it.") + // @ApiMember(Description="Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. An update replaces the whole taxonomy: send every field you want to keep (parentId, dependencies, description, schemas).") public viewId?: string; /** @description Human-entered taxonomy title (e.g. "Countries"); a slug is derived server-side. */ @@ -14915,11 +14921,6 @@ export class RenameDatabaseSchemaRequest extends CodeMashRequestBase implements // @ApiMember(Description="New human-entered title (e.g. \"Company Employees\"); the slug is derived server-side.", IsRequired=true) public title: string; - /** @description When true (default), rejects the rename if another schema already owns the derived slug. Leave true unless explicitly asked to bypass the uniqueness check. */ - // @DataMember - // @ApiMember(Description="When true (default), rejects the rename if another schema already owns the derived slug. Leave true unless explicitly asked to bypass the uniqueness check.") - public renameUniqueName: boolean; - public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { return 'RenameDatabaseSchemaRequest'; } public getMethod() { return 'PUT'; } @@ -14977,9 +14978,9 @@ export class UpdateDatabaseSchemaDraftRequest extends CodeMashRequestBase implem // @ApiMember(Description="Raw JSON string matching the Norbix data meta-schema (https://norbix.ai/schemas/meta/v1.json) for the draft's data schema.") public dataSchema?: string; - /** @description Raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. */ + /** @description OPTIONAL raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. If omitted or invalid, the backend auto-generates a flat-list form from the data schema. */ // @DataMember - // @ApiMember(Description="Raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form.") + // @ApiMember(Description="OPTIONAL raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. If omitted or invalid, the backend auto-generates a flat-list form from the data schema.") public visualSchema?: string; public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } @@ -15130,10 +15131,14 @@ export class DeleteManyRecords extends CodeMashRequestBase implements IReturn) { super(init); (Object as any).assign(this, init); } public getTypeName() { return 'DeleteManyRecords'; } public getMethod() { return 'DELETE'; } @@ -15375,10 +15380,14 @@ export class UpdateManyRecords extends CodeMashRequestBase implements IReturn) { (Object as any).assign(this, init); } - public getTypeName() { return 'ProcessCollectionImport'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - -export class TermInserted -{ - public projectId: ProjectId; - public databaseIntegrationId: IntegrationId; - public taxonomyId: TaxonomyId; - public id: string; - public document: Object; - - public constructor(init?: Partial) { (Object as any).assign(this, init); } - public getTypeName() { return 'TermInserted'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - -export class TermUpdated -{ - public projectId: ProjectId; - public databaseIntegrationId: IntegrationId; - public taxonomyId: TaxonomyId; - public id: string; - public from: Object; - public to: Object; - - public constructor(init?: Partial) { (Object as any).assign(this, init); } - public getTypeName() { return 'TermUpdated'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - -export class TermDeleted -{ - public projectId: ProjectId; - public databaseIntegrationId: IntegrationId; - public taxonomyId: TaxonomyId; - public id: string; - public document: Object; - - public constructor(init?: Partial) { (Object as any).assign(this, init); } - public getTypeName() { return 'TermDeleted'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - -export class TermsDeleted -{ - public projectId: ProjectId; - public databaseIntegrationId: IntegrationId; - public taxonomyId: TaxonomyId; - public deletedCount: number; - public filter: Object; - - public constructor(init?: Partial) { (Object as any).assign(this, init); } - public getTypeName() { return 'TermsDeleted'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - // @Route("/{version}/files/disable", "PUT") export class DisableFiles extends CodeMashRequestBase implements IReturn { @@ -16882,8 +16820,8 @@ export class GetEmailCampaigns extends CodeMashListPaginationRequestBase impleme // @Api(Description="Get email campaign batches") export class GetEmailCampaignBatches extends CodeMashListPaginationRequestBase implements IReturn { - /** @description The email campaign id to list batches for. Get it from get_all_email_campaigns. */ - // @ApiMember(Description="The email campaign id to list batches for. Get it from get_all_email_campaigns.", IsRequired=true) + /** @description The email campaign id to list batches for. Get it from get_email_campaigns. */ + // @ApiMember(Description="The email campaign id to list batches for. Get it from get_email_campaigns.", IsRequired=true) public id: string; /** @description Optional. Omit to use the project default database integration (resolved per environment). */ @@ -16909,8 +16847,8 @@ export class GetEmailCampaignBatches extends CodeMashListPaginationRequestBase i // @Api(Description="Get an email campaign batch notification") export class GetEmailCampaignBatchNotification extends CodeMashListPaginationRequestBase implements IReturn { - /** @description The email campaign id. Get it from get_all_email_campaigns. */ - // @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + /** @description The email campaign id. Get it from get_email_campaigns. */ + // @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) public id: string; /** @description The campaign batch id. Get it from get_email_campaign_batches. */ @@ -16936,8 +16874,8 @@ export class GetEmailCampaignBatchNotification extends CodeMashListPaginationReq // @Api(Description="Get email campaign batch notifications") export class GetEmailCampaignBatchNotifications extends CodeMashListPaginationRequestBase implements IReturn { - /** @description The email campaign id. Get it from get_all_email_campaigns. */ - // @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + /** @description The email campaign id. Get it from get_email_campaigns. */ + // @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) public id: string; /** @description The campaign batch id to list notifications for. Get it from get_email_campaign_batches. */ @@ -16959,8 +16897,8 @@ export class GetEmailCampaignBatchNotifications extends CodeMashListPaginationRe // @Api(Description="Get email campaign statistics") export class GetEmailCampaignStatistics extends CodeMashRequestBase implements IReturn { - /** @description The email campaign id to get statistics for. Get it from get_all_email_campaigns. */ - // @ApiMember(Description="The email campaign id to get statistics for. Get it from get_all_email_campaigns.", IsRequired=true) + /** @description The email campaign id to get statistics for. Get it from get_email_campaigns. */ + // @ApiMember(Description="The email campaign id to get statistics for. Get it from get_email_campaigns.", IsRequired=true) public id: string; /** @description Optional. Omit to use the project default database integration (resolved per environment). */ @@ -17023,8 +16961,8 @@ export class StopEmailCampaignRequest extends CodeMashRequestBase implements IRe // @Api(Description="Get email campaign messages") export class GetEmailCampaignMessagesRequest extends CodeMashListPaginationRequestBase implements IReturn { - /** @description The email campaign id. Get it from get_all_email_campaigns. */ - // @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + /** @description The email campaign id. Get it from get_email_campaigns. */ + // @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) public campaignId: string; /** @description The campaign batch id to list messages for. Get it from get_email_campaign_batches. */ @@ -19694,27 +19632,6 @@ export class TestMcpIntegration extends CodeMashRequestBase implements IReturn) { (Object as any).assign(this, init); } - public getTypeName() { return 'IngestSourceMessage'; } - public getMethod() { return 'POST'; } - public createResponse() {} -} - /** @description Gets the project's webhook integration */ // @Route("/{version}/webhooks/integration", "GET") // @Api(Description="Gets the project's webhook integration") diff --git a/references/hub_dtos.py b/references/hub_dtos.py index 9a2d7c6..931ec34 100644 --- a/references/hub_dtos.py +++ b/references/hub_dtos.py @@ -1214,6 +1214,7 @@ class TemplateDto(IHasViewId, IHasDatabaseId): medium: Optional[NotificationMedium] = None is_active: bool = False tags: Optional[List[str]] = None + env: Optional[str] = None class EmailTemplateEngine(str, Enum): @@ -2232,6 +2233,7 @@ class LocalFilesIntegrationDto(FilesIntegrationDto): @dataclass class DatabaseIntegrationDto(IntegrationDto): provider: Optional[DatabaseProvider] = None + is_system_owned: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -2489,6 +2491,7 @@ class SchedulerTaskDto: initiator_id: Optional[str] = None is_enabled: bool = False stop_on_error: bool = False + env: Optional[str] = None created_at_unix: Optional[int] = None updated_at_unix: Optional[int] = None @@ -2642,6 +2645,7 @@ class MongoDbAggregateDto(IHasViewId): description: Optional[str] = None schema_view_id: Optional[str] = None pipeline: Optional[str] = None + joined_collections: Optional[List[str]] = None class MarketplaceTransport(str, Enum): @@ -3339,30 +3343,6 @@ class ImportColumnMappingDto: dont_import_on_error: bool = False -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class AggregateId: - value: Optional[str] = None - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class ProjectId(AggregateId, IHasDomainEntityId): - pass - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class IntegrationId(AggregateId, IHasDomainEntityId): - pass - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class TaxonomyId(AggregateId, IHasDomainEntityId): - pass - - class EmailValidationProvider(IntEnum): ZERO_BOUNCE = 1 NEVER_BOUNCE = 2 @@ -3796,6 +3776,7 @@ class PromotionResultDto: content_mirrored: List[PromotionItemDto] = field(default_factory=list) content_deleted: List[PromotionItemDto] = field(default_factory=list) integrations_seeded: List[PromotionItemDto] = field(default_factory=list) + integrations_to_provision: List[PromotionItemDto] = field(default_factory=list) integrations_skipped: List[PromotionItemDto] = field(default_factory=list) blockers: List[PromotionBlockerDto] = field(default_factory=list) from_version: Optional[int] = None @@ -3936,6 +3917,7 @@ class SchemaTriggerDto(TriggerDto): schema_id: Optional[str] = None when: Optional[SchemaTriggerType] = None configuration_code: Optional[str] = None + env: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -4698,6 +4680,7 @@ class MembershipAuthenticationViewDto: @dataclass class SchemaTriggerProjectionList(TriggerProjectionList): type: Optional[SchemaTriggerType] = None + env: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -4732,6 +4715,13 @@ class TaxonomyDto(IHasViewId): dependencies: Optional[List[str]] = None +@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) +@dataclass +class TaxonomyRef: + id: Optional[str] = None + name: Optional[str] = None + + @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class TaxonomyListProjection(IHasViewId): @@ -4742,7 +4732,7 @@ class TaxonomyListProjection(IHasViewId): description: Optional[str] = None dependencies: Optional[List[str]] = None parent_name: Optional[str] = None - dependency_names: Optional[List[str]] = None + dependency_refs: Optional[List[TaxonomyRef]] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -4912,6 +4902,7 @@ class SeedCollectionRecordsResultDto: @dataclass class DatabaseIntegrationListProjection(IntegrationListProjection): provider: Optional[DatabaseProvider] = None + env: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -5048,6 +5039,7 @@ class TemplateListProjection(IHasViewId, IHasDatabaseId): is_active: bool = False type: Optional[CommunicationChannel] = None tags: Optional[List[str]] = None + env: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @@ -6418,10 +6410,6 @@ class IHasRazorTemplateCode: pass -class IHasDomainEntityId: - view_id: Optional[str] = None - - class IHasResponsibleUserId: user_id: Optional[str] = None @@ -11131,10 +11119,10 @@ class SaveDatabaseTaxonomyRequest(CodeMashRequestBase, IReturn[IdResponse]): Creates or updates a database taxonomy """ - # @ApiMember(Description="Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it.") + # @ApiMember(Description="Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. An update replaces the whole taxonomy: send every field you want to keep (parentId, dependencies, description, schemas).") view_id: Optional[str] = None """ - Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. + Empty to create a new taxonomy; set to an existing taxonomy id (from get_database_taxonomies) to update it. An update replaces the whole taxonomy: send every field you want to keep (parentId, dependencies, description, schemas). """ @@ -11617,13 +11605,6 @@ class RenameDatabaseSchemaRequest(CodeMashRequestBase, IReturn[EmptyResponse]): """ - # @ApiMember(Description="When true (default), rejects the rename if another schema already owns the derived slug. Leave true unless explicitly asked to bypass the uniqueness check.") - rename_unique_name: bool = False - """ - When true (default), rejects the rename if another schema already owns the derived slug. Leave true unless explicitly asked to bypass the uniqueness check. - """ - - # @Route("/{version}/database/schemas", "POST") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass @@ -11686,10 +11667,10 @@ class UpdateDatabaseSchemaDraftRequest(CodeMashRequestBase, IReturn[EmptyRespons """ - # @ApiMember(Description="Raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form.") + # @ApiMember(Description="OPTIONAL raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. If omitted or invalid, the backend auto-generates a flat-list form from the data schema.") visual_schema: Optional[str] = None """ - Raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. + OPTIONAL raw JSON string matching the Norbix UI/visual meta-schema (https://norbix.ai/schemas/ui/v1.json) for the draft's record form. If omitted or invalid, the backend auto-generates a flat-list form from the data schema. """ @@ -11861,10 +11842,17 @@ class DeleteManyRecords(CodeMashRequestBase, IReturn[EmptyResponse]): database_integration_id: Optional[str] = None - # @ApiMember(Description="The match filter as a MongoDB extended-JSON document. Required.", IsRequired=true) + # @ApiMember(Description="The match filter as a MongoDB extended-JSON document. Required. An empty object ({}) matches every record and is refused unless AllRecords is true.", IsRequired=true) filter: Optional[str] = None """ - The match filter as a MongoDB extended-JSON document. Required. + The match filter as a MongoDB extended-JSON document. Required. An empty object ({}) matches every record and is refused unless AllRecords is true. + """ + + + # @ApiMember(Description="Set to true to delete EVERY record of the collection with an empty filter ({}). Without it an empty filter is refused (CM-ERRORS-DATABASE-037).") + all_records: Optional[bool] = None + """ + Set to true to delete EVERY record of the collection with an empty filter ({}). Without it an empty filter is refused (CM-ERRORS-DATABASE-037). """ @@ -12161,10 +12149,17 @@ class UpdateManyRecords(CodeMashRequestBase, IReturn[EmptyResponse]): database_integration_id: Optional[str] = None - # @ApiMember(Description="The match filter as a MongoDB extended-JSON document. Empty object means match all.", IsRequired=true) + # @ApiMember(Description="The match filter as a MongoDB extended-JSON document. An empty object ({}) matches every record and is refused unless AllRecords is true.", IsRequired=true) filter: Optional[str] = None """ - The match filter as a MongoDB extended-JSON document. Empty object means match all. + The match filter as a MongoDB extended-JSON document. An empty object ({}) matches every record and is refused unless AllRecords is true. + """ + + + # @ApiMember(Description="Set to true to update EVERY record of the collection with an empty filter ({}). Without it an empty filter is refused (CM-ERRORS-DATABASE-037).") + all_records: Optional[bool] = None + """ + Set to true to update EVERY record of the collection with an empty filter ({}). Without it an empty filter is refused (CM-ERRORS-DATABASE-037). """ @@ -12634,57 +12629,6 @@ class TestDatabaseAggregateRequest(CodeMashRequestBase, IReturn[TestDatabaseAggr """ -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class ProcessCollectionImport: - import_id: Optional[str] = None - project_id: Optional[str] = None - account_id: Optional[str] = None - database_integration_id: Optional[str] = None - env: Optional[str] = None - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class TermInserted: - project_id: Optional[ProjectId] = None - database_integration_id: Optional[IntegrationId] = None - taxonomy_id: Optional[TaxonomyId] = None - id: Optional[str] = None - document: Optional[Object] = None - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class TermUpdated: - project_id: Optional[ProjectId] = None - database_integration_id: Optional[IntegrationId] = None - taxonomy_id: Optional[TaxonomyId] = None - id: Optional[str] = None - from_: Optional[Object] = field(metadata=config(field_name='from'), default=None) - to: Optional[Object] = None - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class TermDeleted: - project_id: Optional[ProjectId] = None - database_integration_id: Optional[IntegrationId] = None - taxonomy_id: Optional[TaxonomyId] = None - id: Optional[str] = None - document: Optional[Object] = None - - -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class TermsDeleted: - project_id: Optional[ProjectId] = None - database_integration_id: Optional[IntegrationId] = None - taxonomy_id: Optional[TaxonomyId] = None - deleted_count: int = 0 - filter: Optional[Object] = None - - # @Route("/{version}/files/disable", "PUT") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass @@ -13705,10 +13649,10 @@ class GetEmailCampaignBatches(CodeMashListPaginationRequestBase, IReturn[GetEmai Get email campaign batches """ - # @ApiMember(Description="The email campaign id to list batches for. Get it from get_all_email_campaigns.", IsRequired=true) + # @ApiMember(Description="The email campaign id to list batches for. Get it from get_email_campaigns.", IsRequired=true) id: Optional[str] = None """ - The email campaign id to list batches for. Get it from get_all_email_campaigns. + The email campaign id to list batches for. Get it from get_email_campaigns. """ @@ -13742,10 +13686,10 @@ class GetEmailCampaignBatchNotification(CodeMashListPaginationRequestBase, IRetu Get an email campaign batch notification """ - # @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + # @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) id: Optional[str] = None """ - The email campaign id. Get it from get_all_email_campaigns. + The email campaign id. Get it from get_email_campaigns. """ @@ -13779,10 +13723,10 @@ class GetEmailCampaignBatchNotifications(CodeMashListPaginationRequestBase, IRet Get email campaign batch notifications """ - # @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + # @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) id: Optional[str] = None """ - The email campaign id. Get it from get_all_email_campaigns. + The email campaign id. Get it from get_email_campaigns. """ @@ -13809,10 +13753,10 @@ class GetEmailCampaignStatistics(CodeMashRequestBase, IReturn[GetEmailCampaignSt Get email campaign statistics """ - # @ApiMember(Description="The email campaign id to get statistics for. Get it from get_all_email_campaigns.", IsRequired=true) + # @ApiMember(Description="The email campaign id to get statistics for. Get it from get_email_campaigns.", IsRequired=true) id: Optional[str] = None """ - The email campaign id to get statistics for. Get it from get_all_email_campaigns. + The email campaign id to get statistics for. Get it from get_email_campaigns. """ @@ -13885,10 +13829,10 @@ class GetEmailCampaignMessagesRequest(CodeMashListPaginationRequestBase, IReturn Get email campaign messages """ - # @ApiMember(Description="The email campaign id. Get it from get_all_email_campaigns.", IsRequired=true) + # @ApiMember(Description="The email campaign id. Get it from get_email_campaigns.", IsRequired=true) campaign_id: Optional[str] = None """ - The email campaign id. Get it from get_all_email_campaigns. + The email campaign id. Get it from get_email_campaigns. """ @@ -16689,23 +16633,6 @@ class TestMcpIntegration(CodeMashRequestBase, IReturn[TestLlmIntegrationResponse """ -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) -@dataclass -class IngestSourceMessage: - project_id: Optional[str] = None - env: Optional[str] = None - owner_auth_id: Optional[str] = None - source_kind: Optional[str] = None - source_id: Optional[str] = None - title: Optional[str] = None - content_type: Optional[str] = None - content: Optional[str] = None - embedding_integration_id: Optional[str] = None - removed: bool = False - metadata: Optional[Dict[str, str]] = None - owner_required: bool = False - - # @Route("/{version}/webhooks/integration", "GET") # @Api(Description="Gets the project's webhook integration") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) From 0db5057ec24de073550f2754f25bd42f555a3110 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Mon, 5 Oct 2026 23:55:09 +0300 Subject: [PATCH 2/5] feat(database): collection import methods [2] The Hub serves six /database/imports routes (create, list, get, delete, upload URL, analyze) that the Python SDK had no method for; the JS SDK has them. Added sync and async, plus the rows in docs/hub/database.md. Every Database route of the Hub and Api hosts now has a method. Task file docs/tasks/database-last-wave.md. Co-Authored-By: Claude Opus 5.5 --- docs/hub/database.md | 6 ++ docs/tasks/database-last-wave.md | 73 ++++++++++++++ src/norbix_python/hub/database.py | 156 ++++++++++++++++++++++++++++++ 3 files changed, 235 insertions(+) create mode 100644 docs/tasks/database-last-wave.md diff --git a/docs/hub/database.md b/docs/hub/database.md index b61b8bc..abbcb34 100644 --- a/docs/hub/database.md +++ b/docs/hub/database.md @@ -45,6 +45,12 @@ Access with `norbix.hub.database`. | `get_database_aggregates` | `GET` | `/{version}/database/aggregates` | `project` | | `save_database_aggregate` | `POST` | `/{version}/database/aggregates` | `project` | | `test_database_aggregate` | `POST` | `/{version}/database/aggregates/test` | `project` | +| `create_collection_import` | `POST` | `/{version}/database/imports` | `project` | +| `get_collection_imports` | `GET` | `/{version}/database/imports` | `project` | +| `get_collection_import` | `GET` | `/{version}/database/imports/{Id}` | `project` | +| `delete_collection_import` | `DELETE` | `/{version}/database/imports/{Id}` | `project` | +| `request_import_upload_url` | `POST` | `/{version}/database/imports/upload-url` | `project` | +| `analyze_import_file` | `POST` | `/{version}/database/imports/analyze` | `project` | | `get_allowed_flex_tiers` | `GET` | `/{version}/database/integrations/flex-tiers` | `project` | | `test_database_integration` | `POST` | `/{version}/database/integrations/test` | `project` | | `reveal_managed_flex_connection_string` | `GET` | `/{version}/database/integrations/{Id}/connection-string` | `project` | diff --git a/docs/tasks/database-last-wave.md b/docs/tasks/database-last-wave.md new file mode 100644 index 0000000..1ae90f7 --- /dev/null +++ b/docs/tasks/database-last-wave.md @@ -0,0 +1,73 @@ +# Database last wave — Python SDK side of the gateway contract changes + +## Goal + +The Python SDK follows the Database contract changes now on gateway +`refactoringV2` (records, taxonomies, triggers, schemas, aggregates): fresh +DTO references, every Database method matches the gateway's routes, tests and +docs cover each change, the full suite is green, the branch is shipped. + +Not in scope: typed request / response classes (the Python SDK is untyped by +design — every request field is a keyword argument that goes to the wire as +given); other modules than Database. + +## Plan + +1. chore(references): refresh `references/{hub,api}_dtos.py` and + `references/{hub,api}2.dtos.ts` from the running Community Hub + (`localhost:64964`) and Api (`localhost:64965`) built from + `origin/refactoringV2` — done +2. feat(database): add the 6 collection-import methods the Hub serves but the + SDK did not have (`/database/imports…`), sync and async, so every Database + route of both hosts has a method — done +3. test(database): tests with a capture transport for every contract change + that reaches the wire: `allRecords` on update/delete many (Hub + Api), + rename without `renameUniqueName`, schema triggers per env (`norbix-env` + header), the import routes, a route check of every Database method + against the hosts' routes, and the new error codes surfacing as + `NorbixError.error_code` — done +4. docs(database): Hub and Api database pages — bulk writes (empty filter, + `allRecords`, own-scope bulk calls, `$` operators refused, record + document errors, soft-deleted rows), change owner, aggregate test rights, + schema delete blockers, `joinedCollections`, rename, schema triggers per + env, taxonomy `dependencyRefs`, term-read rights and new error codes — done +5. Full suite (`uv run pytest`, `make typecheck`, `make lint`) green; ship + with `nbx-ship --wait-release --cleanup` — doing + +## Changes + +| file | what changed | plan step # | +|---|---|---| +| `references/hub_dtos.py`, `references/hub2.dtos.ts` | refreshed from Hub `/types/python` and `/types/typescript` | 1 | +| `references/api_dtos.py`, `references/api2.dtos.ts` | refreshed from Api; the `.ts` was last taken from ServiceStack 8.30, so its diff is large | 1 | +| `src/norbix_python/hub/database.py` | `create_collection_import`, `get_collection_imports`, `get_collection_import`, `delete_collection_import`, `request_import_upload_url`, `analyze_import_file` (sync + async) | 2 | +| `tests/hub/test_database_last_wave.py` | new: request shapes for the contract changes, import routes, route check against the hosts' routes | 3 | +| `tests/api/test_database_last_wave.py` | new: `allRecords` on Api update/delete many, change owner error, `$where` refused on terms | 3 | +| `docs/hub/database.md` | import methods in the table; new sections for every contract change | 4 | +| `docs/api/database.md` | bulk writes, change owner, term reads and the new error codes | 4 | + +## Findings + +- The Python SDK had no method for the 6 Hub collection-import routes + (`/database/imports`, `/imports/{Id}`, `/imports/upload-url`, + `/imports/analyze`); `norbix-js` has them. Fixed here (step 2). +- `references/api2.dtos.ts` was a year old (ServiceStack 8.30, 2025-10-22). + Refreshed here (step 1). +- The SDK forwards keyword arguments by their given name: `all_records=True` + would go out as `all_records`, which the gateway does not read. The docs + and tests use the wire name `allRecords=True`, the same way the rest of the + SDK uses `pageSize`. Left as is (this is the SDK's documented rule). + +## Rejected / moved out + +- A local guard that refuses an empty filter before sending. The gateway owns + this rule (CM-ERRORS-DATABASE-037); a copy in the SDK would drift. + +## Needs you + +- Nothing. The import methods are new methods (a minor release), no existing + method changed its name, parameters or return type. + +## Open questions + +- None. diff --git a/src/norbix_python/hub/database.py b/src/norbix_python/hub/database.py index 8358c73..152f57e 100644 --- a/src/norbix_python/hub/database.py +++ b/src/norbix_python/hub/database.py @@ -542,6 +542,84 @@ def test_database_aggregate(self, *, timeout: float | None = None, bearer_token: bearer_token=bearer_token, ) + def create_collection_import(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports""" + return self._transport.send( + target="hub", + path="/{version}/database/imports", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + def get_collection_imports(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """GET /{version}/database/imports""" + return self._transport.send( + target="hub", + path="/{version}/database/imports", + method="GET", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + def get_collection_import(self, id: str, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """GET /{version}/database/imports/{Id}""" + return self._transport.send( + target="hub", + path="/{version}/database/imports/{Id}", + method="GET", + path_params={"Id": id}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + def delete_collection_import(self, id: str, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """DELETE /{version}/database/imports/{Id}""" + return self._transport.send( + target="hub", + path="/{version}/database/imports/{Id}", + method="DELETE", + path_params={"Id": id}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + def request_import_upload_url(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports/upload-url""" + return self._transport.send( + target="hub", + path="/{version}/database/imports/upload-url", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + def analyze_import_file(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports/analyze""" + return self._transport.send( + target="hub", + path="/{version}/database/imports/analyze", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + def get_allowed_flex_tiers(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """GET /{version}/database/integrations/flex-tiers""" return self._transport.send( @@ -1418,6 +1496,84 @@ async def test_database_aggregate(self, *, timeout: float | None = None, bearer_ bearer_token=bearer_token, ) + async def create_collection_import(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + async def get_collection_imports(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """GET /{version}/database/imports""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports", + method="GET", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + async def get_collection_import(self, id: str, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """GET /{version}/database/imports/{Id}""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports/{Id}", + method="GET", + path_params={"Id": id}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + async def delete_collection_import(self, id: str, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """DELETE /{version}/database/imports/{Id}""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports/{Id}", + method="DELETE", + path_params={"Id": id}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + async def request_import_upload_url(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports/upload-url""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports/upload-url", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + + async def analyze_import_file(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: + """POST /{version}/database/imports/analyze""" + return await self._transport.send( + target="hub", + path="/{version}/database/imports/analyze", + method="POST", + path_params={}, + request=request, + scope="project", + timeout=timeout, + bearer_token=bearer_token, + ) + async def get_allowed_flex_tiers(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """GET /{version}/database/integrations/flex-tiers""" return await self._transport.send( From 5be62c5591e30358ca373445594d71540568afd4 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Mon, 5 Oct 2026 23:58:13 +0300 Subject: [PATCH 3/5] test(database): pin the gateway's last Database wave [3] Every Database route of the Community Hub (73) and Api (22) has exactly one method with the gateway's verb and path, sync and async (route lists taken from /types/metadata of hosts built from refactoringV2). allRecords goes in the body on update many and in the query on delete many; rename sends only the title; schema trigger calls carry the norbix-env header; the new error codes (DATABASE-031/035/036/037, MEMBERSHIP-USERS-012, SCHEMA-002/018, TAXONOMIES-005/010/011, TRIGGERS-002) reach the caller with their context; taxonomy rows keep dependencyRefs and aggregates keep joinedCollections. Co-Authored-By: Claude Opus 5.5 --- tests/api/test_database_last_wave.py | 197 ++++++++++++ tests/hub/test_database_last_wave.py | 454 +++++++++++++++++++++++++++ 2 files changed, 651 insertions(+) create mode 100644 tests/api/test_database_last_wave.py create mode 100644 tests/hub/test_database_last_wave.py diff --git a/tests/api/test_database_last_wave.py b/tests/api/test_database_last_wave.py new file mode 100644 index 0000000..2693300 --- /dev/null +++ b/tests/api/test_database_last_wave.py @@ -0,0 +1,197 @@ +"""Api Database — the gateway's last Database wave, seen from the SDK. + +Same idea as ``tests/hub/test_database_last_wave.py``: every Database route the +Community Api serves has a method with the gateway's verb and path (list taken +from the Api's ``/types/metadata``, gateway ``refactoringV2``), the new +``allRecords`` field lands where the gateway reads it, and the new error codes +reach the caller. Every call goes to a fake transport. +""" + +from __future__ import annotations + +import asyncio +import inspect +import json +import re +from typing import Any +from urllib.parse import parse_qs, urlparse + +import httpx +import pytest + +from norbix_python import AsyncNorbix, Norbix, NorbixError + +from ..helpers import CaptureTransport + +API_DATABASE_ROUTES: list[tuple[str, str]] = [ + ("GET", "/{version}/database/collections/{collectionName}"), + ("POST", "/{version}/database/collections/{collectionName}"), + ("POST", "/{version}/database/collections/{collectionName}/aggregate"), + ("POST", "/{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute"), + ("GET", "/{version}/database/collections/{collectionName}/count"), + ("GET", "/{version}/database/collections/{collectionName}/distinct"), + ("DELETE", "/{version}/database/collections/{collectionName}/many"), + ("POST", "/{version}/database/collections/{collectionName}/many"), + ("PUT", "/{version}/database/collections/{collectionName}/many"), + ("GET", "/{version}/database/collections/{collectionName}/own"), + ("DELETE", "/{version}/database/collections/{collectionName}/{id}"), + ("GET", "/{version}/database/collections/{collectionName}/{id}"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}/replace"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}/responsibility"), + ("GET", "/{version}/database/schemas"), + ("GET", "/{version}/database/schemas/{id}"), + ("GET", "/{version}/database/taxonomies/tree"), + ("GET", "/{version}/database/taxonomies/{taxonomyName}/merged-tree"), + ("GET", "/{version}/database/taxonomies/{taxonomyName}/terms"), + ("GET", "/{version}/database/taxonomies/{taxonomyName}/terms/tree"), + ("GET", "/{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children"), +] + +_DOC = re.compile(r"^(GET|POST|PUT|PATCH|DELETE) (/\S+)$") +_TOKEN = re.compile(r"\{([^}]+)\}") + + +def _documented_routes(module: Any) -> dict[str, tuple[str, str]]: + out: dict[str, tuple[str, str]] = {} + for name, fn in inspect.getmembers(module, callable): + if name.startswith("_"): + continue + match = _DOC.match((fn.__doc__ or "").strip()) + if match: + out[name] = (match.group(1), match.group(2)) + return out + + +def _client() -> tuple[Norbix, CaptureTransport]: + transport = CaptureTransport() + client = Norbix( + project_id="test-project", + bearer_token="test-token", + http_client=httpx.Client(transport=transport), + ) + return client, transport + + +def _answering(status: int, code: str, message: str, context: dict[str, Any] | None = None) -> Norbix: + error: dict[str, Any] = {"message": message, "errorCode": code} + if context is not None: + error["context"] = context + body = {"responseStatus": {"isSuccess": False, "errors": [error]}} + + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response(status, json=body) + + return Norbix( + project_id="test-project", + bearer_token="test-token", + http_client=httpx.Client(transport=httpx.MockTransport(handler)), + ) + + +def test_every_api_database_route_has_exactly_one_method() -> None: + client, _ = _client() + documented = _documented_routes(client.api.database) + by_route: dict[tuple[str, str], list[str]] = {} + for name, (verb, path) in documented.items(): + by_route.setdefault((verb, _TOKEN.sub("{}", path)), []).append(name) + assert set(by_route) == {(verb, _TOKEN.sub("{}", path)) for verb, path in API_DATABASE_ROUTES} + assert {route: names for route, names in by_route.items() if len(names) > 1} == {} + + +def test_every_api_database_method_sends_its_documented_verb_and_path() -> None: + client, transport = _client() + module = client.api.database + for name, (verb, path) in sorted(_documented_routes(module).items()): + fn = getattr(module, name) + args = [ + f"p-{p.name}" + for p in inspect.signature(fn).parameters.values() + if p.kind is inspect.Parameter.POSITIONAL_OR_KEYWORD + ] + fn(*args) + assert transport.last_request is not None + assert transport.last_request["method"] == verb, name + sent = urlparse(transport.last_request["url"]).path + pattern = "^" + _TOKEN.sub("[^/]+", path.replace("{version}", "v2")) + "$" + assert re.match(pattern, sent), (name, sent) + + +def test_async_api_database_has_the_same_methods_as_sync() -> None: + sync_client, _ = _client() + async_client = AsyncNorbix(project_id="test-project", bearer_token="test-token") + assert _documented_routes(async_client.api.database) == _documented_routes(sync_client.api.database) + + +def test_update_many_sends_all_records_in_the_body() -> None: + client, transport = _client() + client.api.database.update_many("products", filter="{}", update='{"seen": true}', allRecords=True) + assert transport.last_request is not None + assert transport.last_request["method"] == "PUT" + assert urlparse(transport.last_request["url"]).path == "/v2/database/collections/products/many" + assert json.loads(transport.last_request["body"]) == { + "filter": "{}", + "update": '{"seen": true}', + "allRecords": True, + } + + +def test_delete_many_sends_all_records_in_the_query() -> None: + client, transport = _client() + client.api.database.delete_many("products", filter="{}", allRecords=True) + assert transport.last_request is not None + url = urlparse(transport.last_request["url"]) + assert transport.last_request["method"] == "DELETE" + assert parse_qs(url.query) == {"filter": ["{}"], "allRecords": ["true"]} + + +def test_async_update_and_delete_many_send_all_records() -> None: + seen: list[httpx.Request] = [] + + def handler(request: httpx.Request) -> httpx.Response: + seen.append(request) + return httpx.Response(200, json={}) + + async def run() -> None: + client = AsyncNorbix( + project_id="test-project", + bearer_token="test-token", + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)), + ) + try: + await client.api.database.update_many("products", filter="{}", update="{}", allRecords=True) + await client.api.database.delete_many("products", filter="{}", allRecords=True) + finally: + await client.aclose() + + asyncio.run(run()) + assert json.loads(seen[0].content)["allRecords"] is True + assert parse_qs(urlparse(str(seen[1].url)).query)["allRecords"] == ["true"] + + +@pytest.mark.parametrize( + ("call", "code"), + [ + (lambda db: db.delete_many("products", filter="{}"), "CM-ERRORS-DATABASE-037"), + (lambda db: db.update_one("products", "rec_1", update='{"$inc": {"n": 1}}'), "CM-ERRORS-DATABASE-035"), + (lambda db: db.insert_one("products", document="{bad"), "CM-ERRORS-DATABASE-036"), + (lambda db: db.change_responsibility("products", "rec_1", newResponsibleUserId="usr_x"), "CM-ERRORS-MEMBERSHIP-USERS-012"), + (lambda db: db.find_terms("services", filter='{"$where": "1"}'), "CM-ERRORS-DATABASE-031"), + (lambda db: db.find_terms_children("services", "term_1", filter='{"$where": "1"}'), "CM-ERRORS-DATABASE-031"), + (lambda db: db.find_term_tree("a" * 41), "CM-ERRORS-TAXONOMIES-005"), + (lambda db: db.find_merged_term_tree("unknown"), "CM-ERRORS-TAXONOMIES-010"), + (lambda db: db.find_term_tree("huge"), "CM-ERRORS-TAXONOMIES-011"), + ], +) +def test_new_error_codes_reach_the_caller(call: Any, code: str) -> None: + client = _answering(400, code, "refused") + with pytest.raises(NorbixError) as caught: + call(client.api.database) + assert caught.value.error_code == code + + +def test_insert_many_invalid_document_error_keeps_the_index() -> None: + client = _answering(400, "CM-ERRORS-DATABASE-036", "Invalid record document", {"Index": 1}) + with pytest.raises(NorbixError) as caught: + client.api.database.insert_many("products", documents=["{}", "{bad"]) + assert caught.value.errors[0].context == {"Index": 1} diff --git a/tests/hub/test_database_last_wave.py b/tests/hub/test_database_last_wave.py new file mode 100644 index 0000000..2e47ce6 --- /dev/null +++ b/tests/hub/test_database_last_wave.py @@ -0,0 +1,454 @@ +"""Hub Database — the gateway's last Database wave, seen from the SDK. + +The Python SDK is untyped: every request field is a keyword argument that goes +to the wire with the name the caller gives it (``allRecords=True``, like +``pageSize=20`` elsewhere). So a gateway change reaches the SDK in three +places, and each one is pinned here: + +- the routes: every Database route the Community Hub serves has a method, and + every method's verb and path is the gateway's (the list below is taken from + the Hub's ``/types/metadata``, built from gateway ``refactoringV2``); +- the request: new fields (``allRecords``) land where the gateway reads them + (query on DELETE, JSON body on PUT), and the per-environment calls carry the + ``norbix-env`` header; +- the errors: the new error codes reach the caller as ``error_code``, with the + gateway's metadata in ``errors[0].context``. + +Every call goes to a fake transport; no server is contacted. +""" + +from __future__ import annotations + +import asyncio +import inspect +import json +import re +from typing import Any +from urllib.parse import parse_qs, urlparse + +import httpx +import pytest + +from norbix_python import AsyncNorbix, Norbix, NorbixError + +from ..helpers import CaptureTransport + +# Every Database route of the Community Hub (verb, path), from /types/metadata. +HUB_DATABASE_ROUTES: list[tuple[str, str]] = [ + ("GET", "/{version}/database/aggregates"), + ("POST", "/{version}/database/aggregates"), + ("POST", "/{version}/database/aggregates/test"), + ("DELETE", "/{version}/database/aggregates/{Id}"), + ("GET", "/{version}/database/aggregates/{Id}"), + ("POST", "/{version}/database/collections/seed"), + ("GET", "/{version}/database/collections/{collectionName}"), + ("POST", "/{version}/database/collections/{collectionName}"), + ("POST", "/{version}/database/collections/{collectionName}/aggregate"), + ("POST", "/{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute"), + ("GET", "/{version}/database/collections/{collectionName}/count"), + ("GET", "/{version}/database/collections/{collectionName}/distinct"), + ("GET", "/{version}/database/collections/{collectionName}/indexes"), + ("DELETE", "/{version}/database/collections/{collectionName}/many"), + ("POST", "/{version}/database/collections/{collectionName}/many"), + ("PUT", "/{version}/database/collections/{collectionName}/many"), + ("DELETE", "/{version}/database/collections/{collectionName}/{id}"), + ("GET", "/{version}/database/collections/{collectionName}/{id}"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}/replace"), + ("PUT", "/{version}/database/collections/{collectionName}/{id}/responsibility"), + ("PUT", "/{version}/database/disable"), + ("PUT", "/{version}/database/enable"), + ("GET", "/{version}/database/imports"), + ("POST", "/{version}/database/imports"), + ("POST", "/{version}/database/imports/analyze"), + ("POST", "/{version}/database/imports/upload-url"), + ("DELETE", "/{version}/database/imports/{Id}"), + ("GET", "/{version}/database/imports/{Id}"), + ("GET", "/{version}/database/integrations"), + ("POST", "/{version}/database/integrations"), + ("GET", "/{version}/database/integrations/flex-tiers"), + ("POST", "/{version}/database/integrations/test"), + ("DELETE", "/{version}/database/integrations/{Id}"), + ("GET", "/{version}/database/integrations/{Id}/connection-string"), + ("PUT", "/{version}/database/integrations/{Id}/default"), + ("PUT", "/{version}/database/integrations/{Id}/disable"), + ("PUT", "/{version}/database/integrations/{Id}/enable"), + ("GET", "/{version}/database/integrations/{id}"), + ("GET", "/{version}/database/schemas"), + ("POST", "/{version}/database/schemas"), + ("POST", "/{version}/database/schemas/apply-bundle"), + ("GET", "/{version}/database/schemas/triggers"), + ("POST", "/{version}/database/schemas/triggers"), + ("GET", "/{version}/database/schemas/triggers/{id}"), + ("DELETE", "/{version}/database/schemas/triggers/{triggerId}"), + ("PATCH", "/{version}/database/schemas/triggers/{triggerId}/disable"), + ("PATCH", "/{version}/database/schemas/triggers/{triggerId}/enable"), + ("DELETE", "/{version}/database/schemas/{Id}"), + ("DELETE", "/{version}/database/schemas/{Id}/draft"), + ("GET", "/{version}/database/schemas/{Id}/draft"), + ("PUT", "/{version}/database/schemas/{Id}/draft"), + ("PUT", "/{version}/database/schemas/{Id}/embed"), + ("GET", "/{version}/database/schemas/{Id}/list-settings"), + ("PUT", "/{version}/database/schemas/{Id}/list-settings"), + ("POST", "/{version}/database/schemas/{Id}/publish"), + ("PUT", "/{version}/database/schemas/{Id}/rename"), + ("PUT", "/{version}/database/schemas/{Id}/settings"), + ("GET", "/{version}/database/schemas/{Id}/versions"), + ("GET", "/{version}/database/schemas/{Id}/versions/diff"), + ("GET", "/{version}/database/schemas/{id}"), + ("GET", "/{version}/database/taxonomies"), + ("POST", "/{version}/database/taxonomies"), + ("GET", "/{version}/database/taxonomies/tree"), + ("DELETE", "/{version}/database/taxonomies/{Id}"), + ("POST", "/{version}/database/taxonomies/{TaxonomyId}/terms"), + ("DELETE", "/{version}/database/taxonomies/{TaxonomyId}/terms/many"), + ("DELETE", "/{version}/database/taxonomies/{TaxonomyId}/terms/{Id}"), + ("GET", "/{version}/database/taxonomies/{TaxonomyId}/terms/{Id}"), + ("PUT", "/{version}/database/taxonomies/{TaxonomyId}/terms/{Id}"), + ("GET", "/{version}/database/taxonomies/{TaxonomyName}/merged-tree"), + ("GET", "/{version}/database/taxonomies/{TaxonomyName}/terms/tree"), + ("GET", "/{version}/database/taxonomies/{id}"), +] + +_DOC = re.compile(r"^(GET|POST|PUT|PATCH|DELETE) (/\S+)$") +_TOKEN = re.compile(r"\{([^}]+)\}") + + +def _documented_routes(module: Any) -> dict[str, tuple[str, str]]: + """method name -> (verb, path), read from each method's one-line docstring.""" + out: dict[str, tuple[str, str]] = {} + for name, fn in inspect.getmembers(module, callable): + if name.startswith("_"): + continue + match = _DOC.match((fn.__doc__ or "").strip()) + if match: + out[name] = (match.group(1), match.group(2)) + return out + + +def _norm(path: str) -> str: + # Path tokens are matched by place, not by spelling ({Id} vs {id}). + return _TOKEN.sub("{}", path) + + +def _client(env: str | None = None) -> tuple[Norbix, CaptureTransport]: + transport = CaptureTransport() + client = Norbix( + project_id="test-project", + bearer_token="test-token", + env=env, + http_client=httpx.Client(transport=transport), + ) + return client, transport + + +def _answering(status: int, body: dict[str, Any]) -> Norbix: + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response(status, json=body) + + return Norbix( + project_id="test-project", + bearer_token="test-token", + http_client=httpx.Client(transport=httpx.MockTransport(handler)), + ) + + +def _failure(code: str, message: str, context: dict[str, Any] | None = None) -> dict[str, Any]: + error: dict[str, Any] = {"message": message, "errorCode": code} + if context is not None: + error["context"] = context + return {"responseStatus": {"isSuccess": False, "errors": [error]}} + + +# --- routes ------------------------------------------------------------------ + + +def test_every_hub_database_route_has_exactly_one_method() -> None: + client, _ = _client() + documented = _documented_routes(client.hub.database) + by_route: dict[tuple[str, str], list[str]] = {} + for name, (verb, path) in documented.items(): + by_route.setdefault((verb, _norm(path)), []).append(name) + + expected = {(verb, _norm(path)) for verb, path in HUB_DATABASE_ROUTES} + assert set(by_route) == expected + assert {route: names for route, names in by_route.items() if len(names) > 1} == {} + + +def test_every_hub_database_method_sends_its_documented_verb_and_path() -> None: + client, transport = _client() + module = client.hub.database + for name, (verb, path) in sorted(_documented_routes(module).items()): + fn = getattr(module, name) + args = [ + f"p-{p.name}" + for p in inspect.signature(fn).parameters.values() + if p.kind is inspect.Parameter.POSITIONAL_OR_KEYWORD + ] + fn(*args) + assert transport.last_request is not None + assert transport.last_request["method"] == verb, name + pattern = "^" + _TOKEN.sub("[^/]+", path.replace("{version}", "v2")) + "$" + sent = urlparse(transport.last_request["url"]).path + assert re.match(pattern, sent), (name, sent) + for arg in args: + assert arg in sent, (name, sent) + + +def test_async_hub_database_has_the_same_methods_as_sync() -> None: + sync_client, _ = _client() + async_client = AsyncNorbix(project_id="test-project", bearer_token="test-token") + sync_routes = _documented_routes(sync_client.hub.database) + async_routes = _documented_routes(async_client.hub.database) + assert async_routes == sync_routes + for name in async_routes: + assert inspect.iscoroutinefunction(getattr(async_client.hub.database, name)), name + + +# --- collection imports (new methods) ------------------------------------------- + + +@pytest.mark.parametrize( + ("call", "verb", "path"), + [ + (lambda db: db.create_collection_import(schemaId="sch_1", fileKey="k"), "POST", "/v2/database/imports"), + (lambda db: db.get_collection_imports(), "GET", "/v2/database/imports"), + (lambda db: db.get_collection_import("imp_1"), "GET", "/v2/database/imports/imp_1"), + (lambda db: db.delete_collection_import("imp_1"), "DELETE", "/v2/database/imports/imp_1"), + (lambda db: db.request_import_upload_url(fileName="a.csv"), "POST", "/v2/database/imports/upload-url"), + (lambda db: db.analyze_import_file(fileKey="k"), "POST", "/v2/database/imports/analyze"), + ], +) +def test_collection_import_methods(call: Any, verb: str, path: str) -> None: + client, transport = _client() + call(client.hub.database) + assert transport.last_request is not None + assert transport.last_request["method"] == verb + assert urlparse(transport.last_request["url"]).path == path + + +# --- records: empty filter needs allRecords ------------------------------------- + + +def test_update_many_records_sends_all_records_in_the_body() -> None: + client, transport = _client() + client.hub.database.update_many_records( + "products", filter="{}", update='{"status": "archived"}', allRecords=True + ) + assert transport.last_request is not None + assert transport.last_request["method"] == "PUT" + assert urlparse(transport.last_request["url"]).path == "/v2/database/collections/products/many" + assert json.loads(transport.last_request["body"]) == { + "filter": "{}", + "update": '{"status": "archived"}', + "allRecords": True, + } + + +def test_update_many_records_without_filter_sends_no_filter() -> None: + # The gateway now reads a missing filter as {} (and refuses it without allRecords). + client, transport = _client() + client.hub.database.update_many_records("products", update='{"status": "x"}') + assert transport.last_request is not None + assert json.loads(transport.last_request["body"]) == {"update": '{"status": "x"}'} + + +def test_delete_many_records_sends_all_records_in_the_query() -> None: + client, transport = _client() + client.hub.database.delete_many_records("products", filter="{}", allRecords=True) + assert transport.last_request is not None + url = urlparse(transport.last_request["url"]) + assert transport.last_request["method"] == "DELETE" + assert url.path == "/v2/database/collections/products/many" + assert parse_qs(url.query) == {"filter": ["{}"], "allRecords": ["true"]} + + +def test_async_update_and_delete_many_records_send_all_records() -> None: + seen: list[httpx.Request] = [] + + def handler(request: httpx.Request) -> httpx.Response: + seen.append(request) + return httpx.Response(200, json={}) + + async def run() -> None: + client = AsyncNorbix( + project_id="test-project", + bearer_token="test-token", + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)), + ) + try: + await client.hub.database.update_many_records("products", filter="{}", update="{}", allRecords=True) + await client.hub.database.delete_many_records("products", filter="{}", allRecords=True) + finally: + await client.aclose() + + asyncio.run(run()) + assert json.loads(seen[0].content)["allRecords"] is True + assert parse_qs(urlparse(str(seen[1].url)).query)["allRecords"] == ["true"] + + +@pytest.mark.parametrize( + ("code", "message"), + [ + ("CM-ERRORS-DATABASE-037", "An empty filter matches every record. Set AllRecords to true to change all records."), + ("CM-ERRORS-DATABASE-035", "Update operators ($inc, $set, ...) are not allowed in the update document."), + ("CM-ERRORS-DATABASE-036", "Invalid record document"), + ], +) +def test_new_record_write_errors_reach_the_caller(code: str, message: str) -> None: + client = _answering(400, _failure(code, message)) + with pytest.raises(NorbixError) as caught: + client.hub.database.update_many_records("products", filter="{}", update="{}") + assert caught.value.error_code == code + assert caught.value.message == message + + +def test_insert_many_invalid_document_error_keeps_the_index() -> None: + client = _answering(400, _failure("CM-ERRORS-DATABASE-036", "Invalid record document", {"Index": 2})) + with pytest.raises(NorbixError) as caught: + client.hub.database.insert_many_records("products", documents=["{}", "{}", "{bad"]) + assert caught.value.error_code == "CM-ERRORS-DATABASE-036" + assert caught.value.errors[0].context == {"Index": 2} + + +def test_change_owner_to_a_non_user_reaches_the_caller() -> None: + client = _answering(400, _failure("CM-ERRORS-MEMBERSHIP-USERS-012", "User not found in this project")) + with pytest.raises(NorbixError) as caught: + client.hub.database.change_record_responsibility("products", "rec_1", newResponsibleUserId="usr_x") + assert caught.value.error_code == "CM-ERRORS-MEMBERSHIP-USERS-012" + + +# --- schemas ----------------------------------------------------------------------- + + +def test_rename_schema_sends_only_the_new_name() -> None: + client, transport = _client() + client.hub.database.rename_database_schema("sch_1", title="Products") + assert transport.last_request is not None + assert transport.last_request["method"] == "PUT" + assert urlparse(transport.last_request["url"]).path == "/v2/database/schemas/sch_1/rename" + assert json.loads(transport.last_request["body"]) == {"title": "Products"} + + +def test_rename_schema_to_a_taken_name_reaches_the_caller() -> None: + client = _answering(400, _failure("CM-ERRORS-SCHEMA-002", "A schema named 'Products' already exists")) + with pytest.raises(NorbixError) as caught: + client.hub.database.rename_database_schema("sch_1", title="Products") + assert caught.value.error_code == "CM-ERRORS-SCHEMA-002" + + +def test_delete_schema_used_by_an_aggregate_names_the_aggregates() -> None: + context = {"SchemaId": "sch_1", "BlockerAggregateIds": ["agg_1"], "BlockerAggregateNames": ["Orders by month"]} + client = _answering( + 400, + _failure( + "CM-ERRORS-SCHEMA-018", + "Schema sch_1 is still used by 1 MongoDB aggregate(s) ('Orders by month') as the start or a joined collection", + context, + ), + ) + with pytest.raises(NorbixError) as caught: + client.hub.database.delete_database_schema("sch_1") + assert caught.value.error_code == "CM-ERRORS-SCHEMA-018" + assert caught.value.errors[0].context["BlockerAggregateNames"] == ["Orders by month"] + + +# --- schema triggers per environment ---------------------------------------------- + + +@pytest.mark.parametrize( + ("call", "verb", "path"), + [ + (lambda db: db.get_schema_triggers(), "GET", "/v2/database/schemas/triggers"), + (lambda db: db.get_schema_trigger("trg_1"), "GET", "/v2/database/schemas/triggers/trg_1"), + (lambda db: db.save_schema_trigger(schemaId="sch_1"), "POST", "/v2/database/schemas/triggers"), + (lambda db: db.enable_schema_trigger("trg_1"), "PATCH", "/v2/database/schemas/triggers/trg_1/enable"), + (lambda db: db.disable_schema_trigger("trg_1"), "PATCH", "/v2/database/schemas/triggers/trg_1/disable"), + (lambda db: db.delete_schema_trigger("trg_1"), "DELETE", "/v2/database/schemas/triggers/trg_1"), + ], +) +def test_schema_trigger_calls_carry_the_client_env(call: Any, verb: str, path: str) -> None: + client, transport = _client(env="TEST") + call(client.hub.database) + assert transport.last_request is not None + assert transport.last_request["method"] == verb + assert urlparse(transport.last_request["url"]).path == path + assert transport.last_request["headers"]["norbix-env"] == "TEST" + + +def test_schema_trigger_calls_without_env_send_no_env_header() -> None: + # No header = PROD on the gateway: the list shows only PROD rows, and + # enable / disable / delete act on the PROD copy. + client, transport = _client() + client.hub.database.enable_schema_trigger("trg_1") + assert transport.last_request is not None + assert "norbix-env" not in transport.last_request["headers"] + + +def test_schema_trigger_missing_in_the_env_reaches_the_caller() -> None: + client = _answering(404, _failure("CM-ERRORS-TRIGGERS-002", "Trigger not found")) + with pytest.raises(NorbixError) as caught: + client.hub.database.delete_schema_trigger("trg_1") + assert caught.value.error_code == "CM-ERRORS-TRIGGERS-002" + + +# --- taxonomies -------------------------------------------------------------------- + + +def test_taxonomy_list_rows_come_back_with_dependency_refs() -> None: + body = { + "list": { + "items": [ + { + "id": "tax_cities", + "name": "cities", + "dependencies": ["tax_countries", "tax_gone"], + "dependencyRefs": [{"id": "tax_countries", "name": "countries"}, {"id": "tax_gone", "name": None}], + } + ] + } + } + client = _answering(200, body) + result = client.hub.database.get_database_taxonomies() + row = result["list"]["items"][0] + assert "dependencyNames" not in row + assert row["dependencyRefs"] == [{"id": "tax_countries", "name": "countries"}, {"id": "tax_gone", "name": None}] + + +@pytest.mark.parametrize( + "code", + ["CM-ERRORS-TAXONOMIES-010", "CM-ERRORS-TAXONOMIES-011", "CM-ERRORS-TAXONOMIES-005"], +) +def test_new_taxonomy_term_read_errors_reach_the_caller(code: str) -> None: + client = _answering(400, _failure(code, "refused")) + with pytest.raises(NorbixError) as caught: + client.hub.database.get_database_merged_term_tree("services") + assert caught.value.error_code == code + + +def test_taxonomy_tree_with_terms_sends_include_terms() -> None: + client, transport = _client() + client.hub.database.get_database_taxonomy_tree(includeTerms=True) + assert transport.last_request is not None + url = urlparse(transport.last_request["url"]) + assert url.path == "/v2/database/taxonomies/tree" + assert parse_qs(url.query) == {"includeTerms": ["true"]} + + +# --- aggregates ------------------------------------------------------------------------ + + +def test_aggregate_rows_come_back_with_joined_collections() -> None: + client = _answering( + 200, {"result": {"id": "agg_1", "schemaId": "sch_orders", "joinedCollections": ["sch_customers"]}} + ) + result = client.hub.database.get_database_aggregate("agg_1") + assert result["result"]["joinedCollections"] == ["sch_customers"] + + +def test_test_aggregate_without_write_rights_reaches_the_caller() -> None: + # Testing an aggregate now needs database:create or database:update, plus read. + client = _answering(403, {"responseStatus": {"isSuccess": False, "message": "Forbidden"}}) + with pytest.raises(NorbixError) as caught: + client.hub.database.test_database_aggregate(schemaId="sch_1", query="[]") + assert caught.value.status == 403 From ac771fa38e009d132e67363a47042038d1926159 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Tue, 6 Oct 2026 00:00:52 +0300 Subject: [PATCH 4/5] test(database): import tests use the real request fields [3] The collection import tests now send file (a file reference) like the CreateCollectionImport and AnalyzeImportFileRequest DTOs, not an invented fileKey. Co-Authored-By: Claude Opus 5.5 --- tests/hub/test_database_last_wave.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hub/test_database_last_wave.py b/tests/hub/test_database_last_wave.py index 2e47ce6..55f191f 100644 --- a/tests/hub/test_database_last_wave.py +++ b/tests/hub/test_database_last_wave.py @@ -211,12 +211,12 @@ def test_async_hub_database_has_the_same_methods_as_sync() -> None: @pytest.mark.parametrize( ("call", "verb", "path"), [ - (lambda db: db.create_collection_import(schemaId="sch_1", fileKey="k"), "POST", "/v2/database/imports"), + (lambda db: db.create_collection_import(schemaId="sch_1", file={"path": "imports/a.csv"}), "POST", "/v2/database/imports"), (lambda db: db.get_collection_imports(), "GET", "/v2/database/imports"), (lambda db: db.get_collection_import("imp_1"), "GET", "/v2/database/imports/imp_1"), (lambda db: db.delete_collection_import("imp_1"), "DELETE", "/v2/database/imports/imp_1"), (lambda db: db.request_import_upload_url(fileName="a.csv"), "POST", "/v2/database/imports/upload-url"), - (lambda db: db.analyze_import_file(fileKey="k"), "POST", "/v2/database/imports/analyze"), + (lambda db: db.analyze_import_file(file={"path": "imports/a.csv"}), "POST", "/v2/database/imports/analyze"), ], ) def test_collection_import_methods(call: Any, verb: str, path: str) -> None: From 22889a2223e6a5cf48da1c34bd2aa19db082e9b3 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Tue, 6 Oct 2026 00:00:44 +0300 Subject: [PATCH 5/5] docs(database): the gateway's last Database wave [4] Hub and Api database pages: empty filter needs allRecords (DATABASE-037), own-record rights may call the bulk methods, no $ operators in updates (035), broken record documents (036 with Index), soft-deleted records not found, change owner needs a project user (MEMBERSHIP-USERS-012), aggregate joins and joinedCollections, test aggregate rights, rename without renameUniqueName (SCHEMA-002), delete blocked by aggregates (SCHEMA-018), integrations and schema triggers per env, taxonomy dependencyRefs, term-read rights and TAXONOMIES-005/010/011, collection imports. Examples that used a $set update or snake_case request names are fixed. Task file updated. Co-Authored-By: Claude Opus 5.5 --- docs/api/database.md | 71 +++++++++++++- docs/hub/database.md | 154 ++++++++++++++++++++++++++++++- docs/tasks/database-last-wave.md | 9 +- 3 files changed, 230 insertions(+), 4 deletions(-) diff --git a/docs/api/database.md b/docs/api/database.md index 9a0bd5b..38ad432 100644 --- a/docs/api/database.md +++ b/docs/api/database.md @@ -280,7 +280,7 @@ This is the **taxonomy** tree, not the term tree: nodes are taxonomies. Every `t **Goal:** same structure, but also pull each taxonomy's terms in the same call. ```python -structure = norbix.api.database.find_taxonomy_tree(include_terms=True) +structure = norbix.api.database.find_taxonomy_tree(includeTerms=True) ``` ```json @@ -316,7 +316,7 @@ structure = norbix.api.database.find_taxonomy_tree(include_terms=True) Now each taxonomy node's `terms` holds that taxonomy's full term tree (same shape as `find_term_tree`) — *Countries* carries its countries, *Cities* carries its cities. -> Every term-reading call also accepts an optional `database_integration_id` to target a non-default database. +> Every term-reading call also accepts an optional `databaseIntegrationId` to target a non-default database. --- @@ -337,3 +337,70 @@ roots, and the terms of its child taxonomies nest under them. ```python tree = norbix.api.database.find_merged_term_tree("services") ``` + +--- + +## Changing many records + +`update_many` and `delete_many` change every record that matches `filter`. An +empty filter (`'{}'`) matches **every** record of the collection, so the +gateway refuses it with `CM-ERRORS-DATABASE-037` unless you also send +`allRecords=True`. For `update_many` a missing filter counts as `'{}'`. + +```python +norbix.api.database.update_many("products", filter='{"status": "draft"}', update='{"status": "live"}') +norbix.api.database.delete_many("products", filter="{}", allRecords=True) # every record +``` + +Pass the flag with its wire name, `allRecords` (the SDK sends keyword +arguments as given). + +- **Own-record rights are enough.** A caller with only `createAsUser`, + `updateOwn` or `deleteOwn` may call `insert_many`, `update_many` and + `delete_many`; the call changes only the caller's own records (before, it + was refused with 403). +- **No `$` operators in an update.** `update_one` / `update_many` take the new + values as a plain document (`'{"price": 10}'`). `$inc`, `$set` and the like + are refused with `CM-ERRORS-DATABASE-035`. +- **A broken record document** on `insert_one`, `insert_many` or `replace_one` + is refused with `CM-ERRORS-DATABASE-036` "Invalid record document" (before, + `005`). For `insert_many`, `err.errors[0].context["Index"]` is the position + of the bad document. +- **Soft-deleted records are not found** by update, replace and change owner; + a bulk update skips them. +- **Change owner** (`change_responsibility`) refuses a new owner who is not a + user of the project in the request environment, with + `CM-ERRORS-MEMBERSHIP-USERS-012`. + +```python +from norbix_python import NorbixError + +try: + norbix.api.database.delete_many("products", filter="{}") +except NorbixError as err: + assert err.error_code == "CM-ERRORS-DATABASE-037" +``` + +## Term reads: rights and errors + +- Term reads by taxonomy name (`find_terms`, `find_terms_children`, + `find_term_tree`, `find_merged_term_tree`) check `database:read` on + `database:term:{taxonomy id}`. The merged tree checks it on every nested + taxonomy too. +- `find_terms` and `find_terms_children` refuse `$where`, `$function` and + `$accumulator` in `filter` with `CM-ERRORS-DATABASE-031`. +- `CM-ERRORS-TAXONOMIES-010`: the taxonomy name is unknown (the merged tree + used to answer `-003`). +- `CM-ERRORS-TAXONOMIES-011`: the term tree has more than 5000 terms (whole + taxonomy, merged tree, `find_taxonomy_tree(includeTerms=True)`). +- `CM-ERRORS-TAXONOMIES-005`: a taxonomy name longer than 40 characters. +- `find_taxonomy_tree(includeTerms=True)` fails when reading the terms fails. + Before, it returned the taxonomies without terms. + +## Aggregates + +`aggregate` and `execute_aggregate` refuse a pipeline that joins a collection +the caller cannot read (`CM-ERRORS-DATABASE-033`), a name that is not a schema +in the request environment (`032`), or a join into another database (`034`). +`execute_aggregate` also needs `database:read` on the collection, and refuses +a saved `$out` / `$merge` / JavaScript stage (`031`). diff --git a/docs/hub/database.md b/docs/hub/database.md index abbcb34..c1f286c 100644 --- a/docs/hub/database.md +++ b/docs/hub/database.md @@ -91,7 +91,7 @@ extended-JSON **strings**. products = norbix.hub.database.find_records("products", filter='{"status": "active"}', pageSize=20) one = norbix.hub.database.find_one_record("products", "rec_1") created = norbix.hub.database.insert_record("products", document='{"title": "Lamp", "price": 12}') -norbix.hub.database.update_one_record("products", "rec_1", update='{"$set": {"price": 10}}') +norbix.hub.database.update_one_record("products", "rec_1", update='{"price": 10}') norbix.hub.database.delete_record("products", "rec_1") total = norbix.hub.database.count_records("products", filter='{"status": "active"}') indexes = norbix.hub.database.get_collection_indexes("products") @@ -111,6 +111,158 @@ update no longer matches. test_schemas = Norbix(project_id="...", api_key="...", env="TEST").hub.database.get_database_schemas() ``` +## Changing many records + +`update_many_records` and `delete_many_records` change every record that +matches `filter`. An empty filter (`'{}'`) matches **every** record of the +collection, so the gateway refuses it with `CM-ERRORS-DATABASE-037` unless +you also send `allRecords=True`. For `update_many_records` a missing filter +counts as `'{}'`. + +```python +# Only the matching records: +norbix.hub.database.update_many_records("products", filter='{"status": "draft"}', update='{"status": "live"}') +# Every record — the flag says you mean it: +norbix.hub.database.delete_many_records("products", filter="{}", allRecords=True) +``` + +Pass the flag with its wire name, `allRecords` (the SDK sends keyword +arguments as given; on `update_many_records` it goes in the JSON body, on +`delete_many_records` in the query). The marketplace built-ins `db.update` and +`db.delete` take the same flag as the `allRecords` argument. + +Other rules for record writes: + +- **Who may call the bulk methods.** A caller with only own-record rights + (`createAsUser`, `updateOwn`, `deleteOwn`) may now call `insert_many_records`, + `update_many_records` and `delete_many_records`. The call changes only the + caller's own records (before, it was refused with 403). +- **No `$` operators in an update.** `update_one_record` / `update_many_records` + take the new values as a plain document. An update with `$inc`, `$set` and + the like is refused with `CM-ERRORS-DATABASE-035` (before, MongoDB failed + at run time). +- **A broken record document** on insert one, insert many or replace is + refused with `CM-ERRORS-DATABASE-036` "Invalid record document" (before, + `005` "Invalid filter document"). For insert many, + `err.errors[0].context["Index"]` is the position of the bad document. +- **Soft-deleted records are not found.** Update, replace and change owner + no longer match a soft-deleted record: it answers "not found", and a bulk + update skips it. +- **Change owner** (`change_record_responsibility`) refuses a new owner who is + not a user of the project in the request environment, with + `CM-ERRORS-MEMBERSHIP-USERS-012`. + +## Aggregates + +- `get_database_aggregate(id)` returns `joinedCollections`: the schemas the + pipeline joins (`$lookup` / `$graphLookup` / `$unionWith`), next to the + start `schemaId`. The aggregate list rows do not carry it. +- `save_database_aggregate(...)` refuses `$out`, `$merge`, `$where`, + `$function` and `$accumulator` (`CM-ERRORS-DATABASE-031`) and a join it + cannot follow (`034`); a pipeline that does not parse is refused with + `CM-ERRORS-AGGREGATES-002`. +- A pipeline (run, test or saved-and-executed) that joins a collection the + caller cannot read is refused with `033`; a join to a name that is not a + schema in the request environment with `032`. +- `test_database_aggregate(...)` needs `database:create` **or** + `database:update` on `database:aggregate:{schemaId}`, plus read. A caller + with read rights only gets 403. + +## Schemas: rename and delete + +- `rename_database_schema(id, title="...")` sends only the new title. The old + `renameUniqueName` switch is gone: a name that another schema in the same + environment already uses is always refused with `CM-ERRORS-SCHEMA-002` + ("Two schemas cannot share one collection"); the error context carries + `SchemaName`. The schema name is the MongoDB collection name, so two schemas + can never share it. +- `delete_database_schema(id)` is also refused while a saved aggregate starts + from the schema or joins it: `CM-ERRORS-SCHEMA-018`. The message names the + aggregates; `err.errors[0].context` has `BlockerAggregateIds` and + `BlockerAggregateNames`. (A schema that a trigger uses is refused with + `CM-ERRORS-SCHEMA-017`, `BlockerTriggerIds`.) +- `save_database_schema(viewId=...)` with an id that is not a schema of the + request environment answers "schema not found". +- `update_database_schema_list_settings(...)` refusals all use + `CM-ERRORS-SCHEMA-034`; the context's `Rule` says which rule failed. +- `apply_database_schema_bundle(...)`: a refused step keeps its own error code + and context. + +## Database integrations per environment + +`get_database_integrations()` lists only the integrations of the client's +environment (`PROD` when no `env` is set); each row has `env`. A saved +integration has `isSystemOwned` (read only). Saving into an environment the +project does not have is refused. An integration whose secret is empty in the +request environment answers `CM-ERRORS-DATABASE-038`. + +## Schema triggers per environment + +Schema triggers are kept per environment. Every schema-trigger call works on +the client's environment (the `norbix-env` header; `PROD` when none is set): + +- `get_schema_triggers()` lists only that environment's triggers; each row + has `env`. +- `get_schema_trigger(id)` returns `env`, and `schemaId` is now the owning + schema's id (`sch_…`). Before, it wrongly held the trigger's own id + (`trg_…`). +- `enable_schema_trigger`, `disable_schema_trigger` and `delete_schema_trigger` + act on the copy in that environment. No copy there answers + `CM-ERRORS-TRIGGERS-002` (not found). +- `save_schema_trigger(id=..., schemaId=...)` with the id of a trigger that + belongs to another schema answers `CM-ERRORS-TRIGGERS-002`. + +```python +test = Norbix(project_id="...", api_key="...", env="TEST") +test.hub.database.disable_schema_trigger("trg_1") # the TEST copy only +``` + +## Taxonomies + +- `get_database_taxonomies()` rows have `dependencyRefs` in place of the old + `dependencyNames`: one `{"id": ..., "name": ...}` pair per entry of + `dependencies`, in the same order. A dependency that no longer exists keeps + its place with `"name": None`. + + ```python + for row in norbix.hub.database.get_database_taxonomies()["list"]["items"]: + names = [ref["name"] or f"(deleted {ref['id']})" for ref in row.get("dependencyRefs") or []] + ``` + +- `save_database_taxonomy(viewId=...)` with the id of an existing taxonomy is + an update and needs `database:update` on `database:taxonomy:{viewId}`. + Without `viewId` (or with an unknown one) it is a create and needs + `database:create`. An update replaces the whole taxonomy: send every field + you want to keep. +- Term reads by taxonomy name (term tree, merged tree) check + `database:read` on `database:term:{taxonomy id}`; the merged tree checks it + on every nested taxonomy too. +- `get_database_taxonomy_tree(includeTerms=True)` now fails when reading the + terms fails. Before, it returned the taxonomies without terms. +- Errors on term reads: `CM-ERRORS-TAXONOMIES-010` the taxonomy name is + unknown (the merged tree used to answer `-003`); `-011` the term tree has + more than 5000 terms (whole taxonomy, merged tree, `includeTerms`); `-005` + a taxonomy name longer than 40 characters. + +## Collection imports + +Import CSV rows into a collection: ask for an upload URL, upload the file, +analyze it, then create the import and follow it. + +```python +target = norbix.hub.database.request_import_upload_url(fileName="products.csv")["result"] +httpx.put(target["url"], content=csv_bytes, headers={"Content-Type": target["contentType"]}) +preview = norbix.hub.database.analyze_import_file(file=target["file"], hasHeader=True) +created = norbix.hub.database.create_collection_import(file=target["file"], schemaId="sch_1", hasHeader=True) +status = norbix.hub.database.get_collection_import(created["id"]) +imports = norbix.hub.database.get_collection_imports() +norbix.hub.database.delete_collection_import(created["id"]) +``` + +The request fields are listed under `RequestImportUploadUrlRequest`, +`AnalyzeImportFileRequest` and `CreateCollectionImport` in +`references/hub_dtos.py`. + ## Trees, list settings, embed and bundles - `get_database_taxonomy_tree()` — the taxonomy structure as a tree. diff --git a/docs/tasks/database-last-wave.md b/docs/tasks/database-last-wave.md index 1ae90f7..59fc71f 100644 --- a/docs/tasks/database-last-wave.md +++ b/docs/tasks/database-last-wave.md @@ -32,7 +32,8 @@ given); other modules than Database. schema delete blockers, `joinedCollections`, rename, schema triggers per env, taxonomy `dependencyRefs`, term-read rights and new error codes — done 5. Full suite (`uv run pytest`, `make typecheck`, `make lint`) green; ship - with `nbx-ship --wait-release --cleanup` — doing + with `nbx-ship --wait-release --cleanup` — done (993 passed, mypy and ruff + clean) ## Changes @@ -57,6 +58,12 @@ given); other modules than Database. would go out as `all_records`, which the gateway does not read. The docs and tests use the wire name `allRecords=True`, the same way the rest of the SDK uses `pageSize`. Left as is (this is the SDK's documented rule). +- `docs/api/database.md` showed `find_taxonomy_tree(include_terms=True)` and + "an optional `database_integration_id`": by the rule above those go out + under the snake_case name, which the gateway's request names + (`includeTerms`, `databaseIntegrationId`) do not match. Fixed here (step 4). +- `docs/hub/database.md` showed `update_one_record(..., update='{"$set": ...}')`, + which the gateway now refuses (`CM-ERRORS-DATABASE-035`). Fixed here (step 4). ## Rejected / moved out