From 489e03f2b71c6f59a3ed5d97a7fd71227a7807e6 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Wed, 14 Oct 2026 18:47:28 +0300 Subject: [PATCH 1/3] chore(hub): mark getMarketplaceFunctionRunDetails as hand-written so a regeneration keeps it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit generate-endpoints now carries a // @hand-written:begin … :end block and imports ending in // @hand-written over to the regenerated module (sdks/typegen 5e7c21a). Co-Authored-By: Claude Opus 5.5 --- src/hub/code.ts | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/hub/code.ts b/src/hub/code.ts index 8503dd2..5b63545 100644 --- a/src/hub/code.ts +++ b/src/hub/code.ts @@ -1,7 +1,7 @@ import type { RequestOverrideOptions, Transport } from '../client/transport.js'; import type { CodeMashHub2 } from '../types/hub2.dtos.js'; -import { LogsModule } from './logs.js'; +import { LogsModule } from './logs.js'; // @hand-written /** * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` @@ -754,28 +754,6 @@ export class CodeModule { }); }; - /** - * Hand-written helper (not from `generate-endpoints` — keep it when the - * module is regenerated). The details of one marketplace function run: the - * project log lines filed under the run's correlation id - * (`marketplace:run:started` / `step` / `completed` | `failed` | `skipped`). - * - * Pass `row.correlationId` of a run from `getMarketplaceFunctionRuns`. Only a - * row with `hasDetails: true` has lines — they are written only while the - * environment's Norbix Logging is on; otherwise the list comes back empty. - * Same call as `norbix.hub.logs.getLogsByCorrelationId({ targetCorrelationId })` - * (GET /{version}/logs/audit). - */ - getMarketplaceFunctionRunDetails = ( - correlationId: string, - options: RequestOverrideOptions = {}, - ): Promise => { - return new LogsModule(this.transport).getLogsByCorrelationId( - { targetCorrelationId: correlationId }, - options, - ); - }; - /** * GET /{version}/code/functions * Request DTO: GetCodeFunctions @@ -870,4 +848,29 @@ export class CodeModule { ...options, }); }; + + // @hand-written:begin + /** + * Hand-written helper (not from `generate-endpoints`; the generator keeps + * the `@hand-written` block and import when it regenerates this module). + * The details of one marketplace function run: the project log lines filed + * under the run's correlation id + * (`marketplace:run:started` / `step` / `completed` | `failed` | `skipped`). + * + * Pass `row.correlationId` of a run from `getMarketplaceFunctionRuns`. Only a + * row with `hasDetails: true` has lines — they are written only while the + * environment's Norbix Logging is on; otherwise the list comes back empty. + * Same call as `norbix.hub.logs.getLogsByCorrelationId({ targetCorrelationId })` + * (GET /{version}/logs/audit). + */ + getMarketplaceFunctionRunDetails = ( + correlationId: string, + options: RequestOverrideOptions = {}, + ): Promise => { + return new LogsModule(this.transport).getLogsByCorrelationId( + { targetCorrelationId: correlationId }, + options, + ); + }; + // @hand-written:end } From 17997b176972a7dd1c4c1a0864b114d823710661 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Wed, 14 Oct 2026 18:47:46 +0300 Subject: [PATCH 2/3] test(types): fail when an sdk dto patch type leaves its namespace A stale sync-types copy put the @sdk-dto-patches block after the namespace's closing brace: CodeMashHub2.GetApiKeys and 9 others stopped resolving and the type file threw "ReferenceError: ResponseBase is not defined" on load. 20 checks: every hub and api patch type resolves, and neither file declares a class outside its namespace. Co-Authored-By: Claude Opus 5.5 --- tests/types-sdk-dto-patches.test.ts | 65 +++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/types-sdk-dto-patches.test.ts diff --git a/tests/types-sdk-dto-patches.test.ts b/tests/types-sdk-dto-patches.test.ts new file mode 100644 index 0000000..9587085 --- /dev/null +++ b/tests/types-sdk-dto-patches.test.ts @@ -0,0 +1,65 @@ +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; + +import { describe, expect, it } from 'vitest'; + +import { CodeMashApi2 } from '../src/types/api2.dtos.js'; +import { CodeMashHub2 } from '../src/types/hub2.dtos.js'; + +/** + * The `@sdk-dto-patches` block in the type files holds request / response + * types the gateway metadata does not carry (`scripts/sync-types.mjs`, + * maintained in sdks/typegen). A stale copy of that script put the block + * AFTER the namespace's closing brace: the classes were still in the file, but + * `CodeMashHub2.GetApiKeys` and nine others no longer resolved, so a + * regeneration looked like "the gateway lost 9 types". These checks fail the + * moment a patch type leaves its namespace again. + */ +const HUB_PATCHES = [ + 'UserApiKey', + 'GetUserEmailPreferencesResponse', + 'GetApiKeysResponse', + 'RegenerateApiKeysResponse', + 'GetUserNotificationPreferences', + 'UpdateUserNotificationsPreferences', + 'GetApiKeys', + 'RegenerateApiKeys', + 'GrantContactConsentRequest', + 'UnsubscribeContactRequest', +] as const; + +const API_PATCHES = [ + 'UserApiKey', + 'GetApiKeysResponse', + 'RegenerateApiKeysResponse', + 'GetApiKeys', + 'RegenerateApiKeys', + 'ChangePasswordRequest', + 'RequestPasswordResetRequest', + 'ConfirmPasswordResetRequest', +] as const; + +function typeFile(name: string): string { + return readFileSync(fileURLToPath(new URL(`../src/types/${name}`, import.meta.url)), 'utf8'); +} + +describe('sdk dto patches stay inside their namespace', () => { + it.each(HUB_PATCHES)('CodeMashHub2.%s resolves', (name) => { + expect(typeof (CodeMashHub2 as unknown as Record)[name]).toBe('function'); + }); + + it.each(API_PATCHES)('CodeMashApi2.%s resolves', (name) => { + expect(typeof (CodeMashApi2 as unknown as Record)[name]).toBe('function'); + }); + + it.each(['hub2.dtos.ts', 'api2.dtos.ts'])( + '%s: no class declared outside the namespace', + (file) => { + const src = typeFile(file); + expect(src).toContain('@sdk-dto-patches'); + // Everything inside `export module … {` is indented; a top-level class is + // one that landed after the closing brace. + expect(src.match(/^export class \w+/gm) ?? []).toEqual([]); + }, + ); +}); From df16231fdfb19b9d79164523a814375c7c240b2a Mon Sep 17 00:00:00 2001 From: CodeMash Date: Wed, 14 Oct 2026 19:56:03 +0300 Subject: [PATCH 3/3] feat(types): regenerate api/hub types from gateway refactoringV2 0f17f5718 + the type-export fix Regenerated with the maintained sdks/typegen scripts (325b2a8) against a private gateway stack built from refactoringV2 0f17f5718 plus the type-export fix (shipped as 77bca10db + 16c8b93cf). No type and no public method is lost (checked: class names per namespace, method signatures, scopes and exports against the previous commit). - The 10 @sdk-dto-patches types (GetApiKeys, RegenerateApiKeys, UserApiKey, GetUserNotificationPreferences, GrantContactConsentRequest, ...) stay inside their namespace. They seemed to vanish only because the old local sync-types.mjs put the patch block after the namespace's closing brace. - api2 keeps the 17 data schema field kinds (gateway 77bca10db exports them on the Api host too). - Picks up the gateway changes on refactoringV2: IdResponse.warnings, the users-list filters, list-settings primary / linkReference, new endpoints (files useFile, membership setUserAiPlan, account AI plans, ...). - verifyAccount and resendAccountVerificationToken are POST now (gateway 4ece218e6); verifyAccount sends accountId and token in the body. The two hand-written tests follow. - Deprecated, kept: hub/api apikeys.getApiKeys / regenerateApiKeys (the gateway has no /apikeys route), hub.notifications.getUserNotificationPreferences / updateUserNotificationsPreferences (moved to api.membership, different shape). hub.notifications.grantContactConsent / unsubscribeContact now call their real API route (/membership/users/{contactId}/marketing-state/...) and are deprecated in favour of api.membership. - Hand-written code in generated files (scheduler typed inputs, the run-details helper, docs sections, a logs test) is wrapped in @hand-written blocks, which the generator now keeps. Co-Authored-By: Claude Opus 5.5 --- docs/README.md | 4 +- docs/api/_index.md | 25 +- docs/api/apikeys.md | 4 + docs/api/database.md | 10 +- docs/api/files.md | 25 +- docs/api/membership.md | 47 +- docs/api/notifications.md | 173 + docs/api/public.md | 33 +- docs/hub/_index.md | 18 +- docs/hub/account.md | 530 ++- docs/hub/ai.md | 142 + docs/hub/apikeys.md | 4 + docs/hub/auth.md | 90 +- docs/hub/code.md | 4 + docs/hub/database.md | 33 +- docs/hub/email.md | 43 +- docs/hub/files.md | 26 +- docs/hub/logs.md | 12 +- docs/hub/membership.md | 85 + docs/hub/notifications.md | 308 +- docs/hub/public.md | 33 +- docs/hub/scheduler.md | 256 +- docs/hub/webhooks.md | 24 +- src/api/apikeys.ts | 2 + src/api/files.ts | 21 +- src/api/membership.ts | 51 +- src/api/public.ts | 22 +- src/hub/account.ts | 240 +- src/hub/ai.ts | 116 +- src/hub/apikeys.ts | 2 + src/hub/auth.ts | 78 +- src/hub/database.ts | 2 +- src/hub/email.ts | 45 +- src/hub/files.ts | 21 +- src/hub/index.ts | 2 + src/hub/membership.ts | 59 +- src/hub/notifications.ts | 54 +- src/hub/public.ts | 22 +- src/hub/scheduler.ts | 4 + src/types/api2.contract.json | 8 + src/types/api2.dtos.ts | 6435 ++++++++++++++------------- src/types/hub2.contract.json | 16 + src/types/hub2.dtos.ts | 1225 +++-- tests/api/files.test.ts | 28 +- tests/api/membership.test.ts | 48 +- tests/api/public.test.ts | 28 +- tests/client.test.ts | 2 +- tests/hub/account-anonymous.test.ts | 13 +- tests/hub/account.test.ts | 351 +- tests/hub/ai.test.ts | 148 +- tests/hub/auth.test.ts | 100 +- tests/hub/database.test.ts | 27 +- tests/hub/email.test.ts | 48 +- tests/hub/files.test.ts | 28 +- tests/hub/logs.test.ts | 34 +- tests/hub/membership.test.ts | 100 +- tests/hub/notifications.test.ts | 64 +- tests/hub/public.test.ts | 28 +- tests/hub/scheduler.test.ts | 574 +-- 59 files changed, 7089 insertions(+), 4886 deletions(-) create mode 100644 docs/api/notifications.md diff --git a/docs/README.md b/docs/README.md index 3641cd9..45e170f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,8 +8,8 @@ integration guides live under `integrations/`. | Surface | Modules | Description | | ------------------------ | -------------------------: | ------------------------------------------------------------------------------------------------ | -| [`API`](./api/_index.md) | 9 modules · 101 endpoints | Project-scoped data operations: database collections, users, AI chat, auth, API keys. | -| [`Hub`](./hub/_index.md) | 27 modules · 538 endpoints | Project & account configuration: schemas, integrations, team management, billing, observability. | +| [`API`](./api/_index.md) | 10 modules · 112 endpoints | Project-scoped data operations: database collections, users, AI chat, auth, API keys. | +| [`Hub`](./hub/_index.md) | 27 modules · 575 endpoints | Project & account configuration: schemas, integrations, team management, billing, observability. | ## Integration guides diff --git a/docs/api/_index.md b/docs/api/_index.md index 2e2c07d..af19e55 100644 --- a/docs/api/_index.md +++ b/docs/api/_index.md @@ -4,17 +4,18 @@ Project-scoped data operations: database collections, users, AI chat, auth, API keys. -**101 endpoints across 9 modules.** Click a module +**112 endpoints across 10 modules.** Click a module name for the full method reference and TypeScript examples. -| Module | Endpoints | Description | -| ---------------------------------- | --------: | ---------------------------------------------------------------------------------------------------------------------------------------- | -| [`accessToken`](./access_token.md) | 1 | Refresh-token exchange to get a new bearer token. | -| [`ai`](./ai.md) | 18 | | -| [`apikeys`](./apikeys.md) | 2 | List and regenerate per-environment API keys for service auth. | -| [`auth`](./auth.md) | 1 | Sign-in / sign-out and federated provider flows. Most apps prefer `norbix.login(...)` over calling these directly. | -| [`database`](./database.md) | 22 | Database schemas, integrations, triggers, taxonomies, and module on/off switches. For data-level CRUD on collections see `api.database`. | -| [`echo`](./echo.md) | 1 | Echo helpers used by the gateway smoke checks. | -| [`files`](./files.md) | 13 | File storage integrations and triggers. Upload + download is in `api.database` (FileResource fields). | -| [`membership`](./membership.md) | 42 | Roles, policies, and user preferences (Hub side). For user CRUD and registration see `api.membership`. | -| [`public`](./public.md) | 2 | | +| Module | Endpoints | Description | +| ------------------------------------- | --------: | ---------------------------------------------------------------------------------------------------------------------------------------- | +| [`accessToken`](./access_token.md) | 1 | Refresh-token exchange to get a new bearer token. | +| [`ai`](./ai.md) | 18 | | +| [`apikeys`](./apikeys.md) | 2 | List and regenerate per-environment API keys for service auth. | +| [`auth`](./auth.md) | 1 | Sign-in / sign-out and federated provider flows. Most apps prefer `norbix.login(...)` over calling these directly. | +| [`database`](./database.md) | 22 | Database schemas, integrations, triggers, taxonomies, and module on/off switches. For data-level CRUD on collections see `api.database`. | +| [`echo`](./echo.md) | 1 | Echo helpers used by the gateway smoke checks. | +| [`files`](./files.md) | 14 | File storage integrations and triggers. Upload + download is in `api.database` (FileResource fields). | +| [`membership`](./membership.md) | 43 | Roles, policies, and user preferences (Hub side). For user CRUD and registration see `api.membership`. | +| [`notifications`](./notifications.md) | 7 | Email and push templates, integrations, campaigns, devices, signatures, footers, and one-click unsubscribe. | +| [`public`](./public.md) | 3 | | diff --git a/docs/api/apikeys.md b/docs/api/apikeys.md index 94181ef..87567be 100644 --- a/docs/api/apikeys.md +++ b/docs/api/apikeys.md @@ -21,6 +21,8 @@ Accessed as `norbix.api.apikeys` on the [`Norbix`](../../README.md#authenticatio Fetch a single item by ID. +> **Deprecated.** The gateway has no `/apikeys` endpoint, so this call fails. Use service-user API keys (`norbix.hub.membership.listServiceUserApiKeys`). + **Request DTO**: `CodeMashApi2.GetApiKeys` **Response**: `CodeMashApi2.GetApiKeysResponse` @@ -41,6 +43,8 @@ const result = await norbix.api.apikeys.getApiKeys({ `POST` `/apikeys/regenerate` +> **Deprecated.** The gateway has no `/apikeys/regenerate` endpoint, so this call fails. Use `norbix.hub.membership.issueServiceUserApiKey`. + **Request DTO**: `CodeMashApi2.RegenerateApiKeys` **Response**: `CodeMashApi2.RegenerateApiKeysResponse` diff --git a/docs/api/database.md b/docs/api/database.md index bd1cfca..af949a5 100644 --- a/docs/api/database.md +++ b/docs/api/database.md @@ -359,7 +359,7 @@ const result = await norbix.api.database.executeAggregate({ `GET` `/{version}/database/collections/{collectionName}` -Search / paginate items. Takes `expandReferences: true` to read every reference field as `{ id, display }` — see [Reading references](../database-rules.md#reading-references--expandreferences). +Search / paginate items. **Request DTO**: `CodeMashApi2.FindRequest` **Response**: `CodeMashApi2.FindResponse` @@ -382,7 +382,7 @@ const result = await norbix.api.database.find({ `GET` `/{version}/database/collections/{collectionName}/{id}` -Fetch one record by id. Takes `expandReferences: true` to read every reference field as `{ id, display }` — see [Reading references](../database-rules.md#reading-references--expandreferences). +Search / paginate items. **Request DTO**: `CodeMashApi2.FindOneRequest` **Response**: `CodeMashApi2.FindOneResponse` @@ -406,7 +406,7 @@ const result = await norbix.api.database.findOne({ `GET` `/{version}/database/collections/{collectionName}/own` -Search / paginate items. Takes `expandReferences: true` to read every reference field as `{ id, display }` — see [Reading references](../database-rules.md#reading-references--expandreferences). +Search / paginate items. **Request DTO**: `CodeMashApi2.FindOwnRequest` **Response**: `CodeMashApi2.FindResponse` @@ -499,7 +499,7 @@ const result = await norbix.api.database.replaceOne({ `PUT` `/{version}/database/collections/{collectionName}/many` -Update an existing item. Keys may be nested paths; `arrayFilters` picks the list elements a `$[name]` path changes — see [Nested documents and arrays](../database-rules.md#nested-documents-and-arrays). +Update an existing item. **Request DTO**: `CodeMashApi2.UpdateManyRequest` **Response**: `CodeMashApi2.EmptyResponse` @@ -522,7 +522,7 @@ const result = await norbix.api.database.updateMany({ `PUT` `/{version}/database/collections/{collectionName}/{id}` -Update an existing item. Keys may be nested paths; `arrayFilters` picks the list elements a `$[name]` path changes — see [Nested documents and arrays](../database-rules.md#nested-documents-and-arrays). +Update an existing item. **Request DTO**: `CodeMashApi2.UpdateOneRequest` **Response**: `CodeMashApi2.EmptyResponse` diff --git a/docs/api/files.md b/docs/api/files.md index 5596bef..dd184d2 100644 --- a/docs/api/files.md +++ b/docs/api/files.md @@ -23,6 +23,7 @@ Accessed as `norbix.api.files` on the [`Norbix`](../../README.md#authentication) | [`getPublicFile`](#getpublicfile) | `GET` | `/{version}/files/public/{PublicId}/{Name*}` | `project` | | [`requestUploadUrl`](#requestuploadurl) | `POST` | `/{version}/files/{filesIntegrationId}/upload-url` | `project` | | [`testFilesIntegration`](#testfilesintegration) | `POST` | `/{version}/files/{filesIntegrationId}/test` | `project` | +| [`useFile`](#usefile) | `POST` | `/{version}/files/{filesIntegrationId}/use` | `project` | ## Reference @@ -162,7 +163,7 @@ const result = await norbix.api.files.downloadFileApi({ `GET` `/{version}/files/{filesIntegrationId}/by-id/{id}` -Fetch one file by its stable id — the id a file field on a record stores, and the `id` an expanded reference (`expandReferences: true`) returns. The answer carries the file's `resource`, `path`, `isPublic` and `publicUrl`. An id no storage of the integration holds answers not found. +Fetch a single item by ID. **Request DTO**: `CodeMashApi2.GetFileByIdRequest` **Response**: `CodeMashApi2.GetFileByIdResponse` @@ -175,6 +176,7 @@ const norbix = new Norbix(); const result = await norbix.api.files.getFileById({ filesIntegrationId: 'filesIntegrationId-here', id: 'id-here', + // Other fields: see CodeMash type for the full request shape. }); // → typed as CodeMashApi2.GetFileByIdResponse ``` @@ -315,3 +317,24 @@ const result = await norbix.api.files.testFilesIntegration({ ``` [↑ Top](#endpoints) + +### useFile + +`POST` `/{version}/files/{filesIntegrationId}/use` + +**Request DTO**: `CodeMashApi2.UseFileRequest` +**Response**: `CodeMashApi2.IdResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.files.useFile({ + filesIntegrationId: 'filesIntegrationId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.IdResponse +``` + +[↑ Top](#endpoints) diff --git a/docs/api/membership.md b/docs/api/membership.md index 60675fb..0294b54 100644 --- a/docs/api/membership.md +++ b/docs/api/membership.md @@ -13,9 +13,9 @@ Accessed as `norbix.api.membership` on the [`Norbix`](../../README.md#authentica | [`blockUser`](#blockuser) | `PATCH` | `/{version}/membership/auth/block` | `project` | | [`saveSystemUserWithPermissions`](#savesystemuserwithpermissions) | `POST` | `/{version}/membership/auth/register/service` | `project` | | [`saveGuestUser`](#saveguestuser) | `POST` | `/{version}/membership/auth/register/guest` | `project` | +| [`savePhoneUser`](#savephoneuser) | `POST` | `/{version}/membership/auth/register/phone` | `project` | | [`saveUserNameUser`](#saveusernameuser) | `POST` | `/{version}/membership/auth/register/user-name` | `project` | | [`saveEmailUser`](#saveemailuser) | `POST` | `/{version}/membership/auth/register/email` | `project` | -| [`savePhoneUser`](#savephoneuser) | `POST` | `/{version}/membership/auth/register/phone` | `project` | | [`savePhoneUserNameWithPermissions`](#savephoneusernamewithpermissions) | `POST` | `/{version}/membership/auth/register/phone-with-permissions` | `project` | | [`saveEmailUserNameWithPermissions`](#saveemailusernamewithpermissions) | `POST` | `/{version}/membership/auth/register/email-with-permissions` | `project` | | [`saveUserNameWithPermissions`](#saveusernamewithpermissions) | `POST` | `/{version}/membership/auth/register/user-name-with-permissions` | `project` | @@ -25,6 +25,7 @@ Accessed as `norbix.api.membership` on the [`Norbix`](../../README.md#authentica | [`getUserPreferences`](#getuserpreferences) | `GET` | `/{version}/membership/auth/{id}/preferences` | `project` | | [`grantContactConsent`](#grantcontactconsent) | `POST` | `/{version}/membership/users/{contactId}/marketing-state/{channel}/consent` | `project` | | [`inviteUser`](#inviteuser) | `POST` | `/{version}/membership/auth/invite` | `project` | +| [`finishInvitation`](#finishinvitation) | `POST` | `/{version}/membership/auth/invitation/finish` | `project` | | [`linkIdentity`](#linkidentity) | `POST` | `/{version}/membership/auth/{userId}/link-identity` | `project` | | [`mapAuthToUser`](#mapauthtouser) | `POST` | `/{version}/membership/users/{userId}/map-auth` | `project` | | [`assignRolePermissions`](#assignrolepermissions) | `PUT` | `/{version}/membership/auth/assign-roles` | `project` | @@ -121,13 +122,13 @@ const result = await norbix.api.membership.saveGuestUser({ [↑ Top](#endpoints) -### saveUserNameUser +### savePhoneUser -`POST` `/{version}/membership/auth/register/user-name` +`POST` `/{version}/membership/auth/register/phone` Upsert an item (create or update). -**Request DTO**: `CodeMashApi2.SaveUserNameUser` +**Request DTO**: `CodeMashApi2.SavePhoneUser` **Response**: `CodeMashApi2.IdResponse` ```ts @@ -135,7 +136,7 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const result = await norbix.api.membership.saveUserNameUser({ +const result = await norbix.api.membership.savePhoneUser({ // See CodeMash type for the full request shape. }); // → typed as CodeMashApi2.IdResponse @@ -143,13 +144,13 @@ const result = await norbix.api.membership.saveUserNameUser({ [↑ Top](#endpoints) -### saveEmailUser +### saveUserNameUser -`POST` `/{version}/membership/auth/register/email` +`POST` `/{version}/membership/auth/register/user-name` Upsert an item (create or update). -**Request DTO**: `CodeMashApi2.SaveEmailUser` +**Request DTO**: `CodeMashApi2.SaveUserNameUser` **Response**: `CodeMashApi2.IdResponse` ```ts @@ -157,7 +158,7 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const result = await norbix.api.membership.saveEmailUser({ +const result = await norbix.api.membership.saveUserNameUser({ // See CodeMash type for the full request shape. }); // → typed as CodeMashApi2.IdResponse @@ -165,13 +166,13 @@ const result = await norbix.api.membership.saveEmailUser({ [↑ Top](#endpoints) -### savePhoneUser +### saveEmailUser -`POST` `/{version}/membership/auth/register/phone` +`POST` `/{version}/membership/auth/register/email` Upsert an item (create or update). -**Request DTO**: `CodeMashApi2.SavePhoneUser` +**Request DTO**: `CodeMashApi2.SaveEmailUser` **Response**: `CodeMashApi2.IdResponse` ```ts @@ -179,7 +180,7 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const result = await norbix.api.membership.savePhoneUser({ +const result = await norbix.api.membership.saveEmailUser({ // See CodeMash type for the full request shape. }); // → typed as CodeMashApi2.IdResponse @@ -385,6 +386,26 @@ const result = await norbix.api.membership.inviteUser({ [↑ Top](#endpoints) +### finishInvitation + +`POST` `/{version}/membership/auth/invitation/finish` + +**Request DTO**: `CodeMashApi2.FinishInvitationRequest` +**Response**: `CodeMashApi2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.membership.finishInvitation({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.EmptyResponse +``` + +[↑ Top](#endpoints) + ### linkIdentity `POST` `/{version}/membership/auth/{userId}/link-identity` diff --git a/docs/api/notifications.md b/docs/api/notifications.md new file mode 100644 index 0000000..d9d0648 --- /dev/null +++ b/docs/api/notifications.md @@ -0,0 +1,173 @@ +# API · Notifications + +[← Back to API index](./_index.md) · [↑ Back to project README](../../README.md) + +Email and push templates, integrations, campaigns, devices, signatures, footers, and one-click unsubscribe. + +Accessed as `norbix.api.notifications` on the [`Norbix`](../../README.md#authentication) client. + +## Endpoints + +| Method | Verb | Path | Scope | +| ----------------------------------------------------------- | -------- | -------------------------------------------------- | --------- | +| [`registerOwnPushDevice`](#registerownpushdevice) | `POST` | `/{version}/notifications/push/devices` | `project` | +| [`getOwnPushDevices`](#getownpushdevices) | `GET` | `/{version}/notifications/push/devices` | `project` | +| [`deleteOwnPushDevice`](#deleteownpushdevice) | `DELETE` | `/{version}/notifications/push/devices/{Id}` | `project` | +| [`deleteOwnPushDeviceByToken`](#deleteownpushdevicebytoken) | `DELETE` | `/{version}/notifications/push/devices` | `project` | +| [`getOwnPushMessages`](#getownpushmessages) | `GET` | `/{version}/notifications/push/messages` | `project` | +| [`markOwnPushMessageRead`](#markownpushmessageread) | `POST` | `/{version}/notifications/push/messages/{Id}/read` | `project` | +| [`markAllOwnPushMessagesRead`](#markallownpushmessagesread) | `POST` | `/{version}/notifications/push/messages/read` | `project` | + +## Reference + +### registerOwnPushDevice + +`POST` `/{version}/notifications/push/devices` + +Register a new entry. + +**Request DTO**: `CodeMashApi2.RegisterOwnPushDeviceRequest` +**Response**: `CodeMashApi2.IdResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.registerOwnPushDevice({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.IdResponse +``` + +[↑ Top](#endpoints) + +### getOwnPushDevices + +`GET` `/{version}/notifications/push/devices` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashApi2.GetOwnPushDevicesRequest` +**Response**: `CodeMashApi2.GetOwnPushDevicesResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.getOwnPushDevices({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.GetOwnPushDevicesResponse +``` + +[↑ Top](#endpoints) + +### deleteOwnPushDevice + +`DELETE` `/{version}/notifications/push/devices/{Id}` + +Delete an item. + +**Request DTO**: `CodeMashApi2.DeleteOwnPushDeviceRequest` +**Response**: `CodeMashApi2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.deleteOwnPushDevice({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### deleteOwnPushDeviceByToken + +`DELETE` `/{version}/notifications/push/devices` + +Delete an item. + +**Request DTO**: `CodeMashApi2.DeleteOwnPushDeviceByTokenRequest` +**Response**: `CodeMashApi2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.deleteOwnPushDeviceByToken({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### getOwnPushMessages + +`GET` `/{version}/notifications/push/messages` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashApi2.GetOwnPushMessagesRequest` +**Response**: `CodeMashApi2.GetOwnPushMessagesResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.getOwnPushMessages({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.GetOwnPushMessagesResponse +``` + +[↑ Top](#endpoints) + +### markOwnPushMessageRead + +`POST` `/{version}/notifications/push/messages/{Id}/read` + +**Request DTO**: `CodeMashApi2.MarkOwnPushMessageReadRequest` +**Response**: `CodeMashApi2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.markOwnPushMessageRead({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### markAllOwnPushMessagesRead + +`POST` `/{version}/notifications/push/messages/read` + +**Request DTO**: `CodeMashApi2.MarkAllOwnPushMessagesReadRequest` +**Response**: `CodeMashApi2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.notifications.markAllOwnPushMessagesRead({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.EmptyResponse +``` + +[↑ Top](#endpoints) diff --git a/docs/api/public.md b/docs/api/public.md index 72bc4bc..042e5c2 100644 --- a/docs/api/public.md +++ b/docs/api/public.md @@ -6,13 +6,38 @@ Accessed as `norbix.api.public` on the [`Norbix`](../../README.md#authentication ## Endpoints -| Method | Verb | Path | Scope | -| --------------------------------------------------- | ----- | ----------------------------------------------------- | --------- | -| [`getPublicProjectConfig`](#getpublicprojectconfig) | `GET` | `/{version}/public/projects/{ProjectId}/config` | `project` | -| [`getPublicProjectLegal`](#getpublicprojectlegal) | `GET` | `/{version}/public/projects/{ProjectId}/legal/{Kind}` | `project` | +| Method | Verb | Path | Scope | +| ----------------------------------------------------------- | ----- | ----------------------------------------------------- | --------- | +| [`getPublicProjectBrandAsset`](#getpublicprojectbrandasset) | `GET` | `/{version}/public/projects/{ProjectId}/brand/{Kind}` | `project` | +| [`getPublicProjectConfig`](#getpublicprojectconfig) | `GET` | `/{version}/public/projects/{ProjectId}/config` | `project` | +| [`getPublicProjectLegal`](#getpublicprojectlegal) | `GET` | `/{version}/public/projects/{ProjectId}/legal/{Kind}` | `project` | ## Reference +### getPublicProjectBrandAsset + +`GET` `/{version}/public/projects/{ProjectId}/brand/{Kind}` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashApi2.GetPublicProjectBrandAsset` +**Response**: `CodeMashApi2.Blob` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.api.public.getPublicProjectBrandAsset({ + ProjectId: 'ProjectId-here', + Kind: 'Kind-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashApi2.Blob +``` + +[↑ Top](#endpoints) + ### getPublicProjectConfig `GET` `/{version}/public/projects/{ProjectId}/config` diff --git a/docs/hub/_index.md b/docs/hub/_index.md index 8b770b5..2dffeee 100644 --- a/docs/hub/_index.md +++ b/docs/hub/_index.md @@ -4,32 +4,32 @@ Project & account configuration: schemas, integrations, team management, billing, observability. -**538 endpoints across 27 modules.** Click a module +**575 endpoints across 27 modules.** Click a module name for the full method reference and TypeScript examples. | Module | Endpoints | Description | | ------------------------------------- | --------: | ---------------------------------------------------------------------------------------------------------------------------------------- | | [`accessToken`](./access_token.md) | 1 | Refresh-token exchange to get a new bearer token. | -| [`account`](./account.md) | 113 | Account profile, status, verification, team invites, and Stripe billing portal. Most write endpoints require `accountId` on the client. | -| [`ai`](./ai.md) | 20 | | +| [`account`](./account.md) | 121 | Account profile, status, verification, team invites, and Stripe billing portal. Most write endpoints require `accountId` on the client. | +| [`ai`](./ai.md) | 26 | | | [`apikeys`](./apikeys.md) | 2 | List and regenerate per-environment API keys for service auth. | -| [`auth`](./auth.md) | 1 | Sign-in / sign-out and federated provider flows. Most apps prefer `norbix.login(...)` over calling these directly. | -| [`code`](./code.md) | 33 | | +| [`auth`](./auth.md) | 5 | Sign-in / sign-out and federated provider flows. Most apps prefer `norbix.login(...)` over calling these directly. | +| [`code`](./code.md) | 44 | | | [`compliance`](./compliance.md) | 18 | | -| [`database`](./database.md) | 73 | Database schemas, integrations, triggers, taxonomies, and module on/off switches. For data-level CRUD on collections see `api.database`. | +| [`database`](./database.md) | 74 | Database schemas, integrations, triggers, taxonomies, and module on/off switches. For data-level CRUD on collections see `api.database`. | | [`diagnostics`](./diagnostics.md) | 7 | | | [`echo`](./echo.md) | 1 | Echo helpers used by the gateway smoke checks. | | [`email`](./email.md) | 2 | | -| [`files`](./files.md) | 23 | File storage integrations and triggers. Upload + download is in `api.database` (FileResource fields). | +| [`files`](./files.md) | 24 | File storage integrations and triggers. Upload + download is in `api.database` (FileResource fields). | | [`internal`](./internal.md) | 1 | | | [`licensing`](./licensing.md) | 3 | | | [`logs`](./logs.md) | 14 | Logging integrations and module on/off switches. | -| [`membership`](./membership.md) | 44 | Roles, policies, and user preferences (Hub side). For user CRUD and registration see `api.membership`. | +| [`membership`](./membership.md) | 48 | Roles, policies, and user preferences (Hub side). For user CRUD and registration see `api.membership`. | | [`notifications`](./notifications.md) | 124 | Email and push templates, integrations, campaigns, devices, signatures, footers, and one-click unsubscribe. | | [`oauth`](./oauth.md) | 6 | | | [`payments`](./payments.md) | 17 | Payment provider integrations and triggers (Stripe, etc.). | | [`projects`](./projects.md) | 5 | | -| [`public`](./public.md) | 2 | | +| [`public`](./public.md) | 3 | | | [`resources`](./resources.md) | 1 | | | [`scheduler`](./scheduler.md) | 9 | | | [`support`](./support.md) | 7 | | diff --git a/docs/hub/account.md b/docs/hub/account.md index 91dd91d..8623500 100644 --- a/docs/hub/account.md +++ b/docs/hub/account.md @@ -2,127 +2,135 @@ [← Back to Hub index](./_index.md) · [↑ Back to project README](../../README.md) -Account profile, status, verification, team invites, and Stripe billing portal. Most write endpoints require `accountId` on the client. Sign-up (`createAccount`), accepting an invitation (`createTeamMemberFromInvitation`), listing regions (`getAccountRegions`) and verifying the account (`verifyAccount`) need no token and no `accountId`. +Account profile, status, verification, team invites, and Stripe billing portal. Most write endpoints require `accountId` on the client. Accessed as `norbix.hub.account` on the [`Norbix`](../../README.md#authentication) client. ## Endpoints -| Method | Verb | Path | Scope | -| ----------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------- | ----------------- | -| [`getAccountProfile`](#getaccountprofile) | `GET` | `/{version}/account/profile` | `project` | -| [`updateAccountProfile`](#updateaccountprofile) | `PUT` | `/{version}/account/profile` | `project` | -| [`resendAccountVerificationToken`](#resendaccountverificationtoken) | `GET` | `/{version}/account/verify/resend` | `project` | -| [`getAccountStatus`](#getaccountstatus) | `GET` | `/{version}/account/status` | `project` | -| [`createStripeCheckoutSession`](#createstripecheckoutsession) | `POST` | `/{version}/account/stripe/create-checkout-session` | `project` | -| [`getStripeBillingPortalUrl`](#getstripebillingportalurl) | `POST` | `/{version}/account/stripe/get-portal-url` | `project` | -| [`createTeamMemberFromInvitation`](#createteammemberfrominvitation) | `POST` | `/{version}/account/team/member` | `unauthenticated` | -| [`getAccountUsageBilling`](#getaccountusagebilling) | `GET` | `/{version}/account/usage-billing` | `project` | -| [`verifyAccount`](#verifyaccount) | `GET` | `/{version}/account/verify` | `unauthenticated` | -| [`deleteNotificationsGroup`](#deletenotificationsgroup) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/group` | `project` | -| [`deleteNotificationsTag`](#deletenotificationstag) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/tag` | `project` | -| [`removeTagFromNotificationsGroup`](#removetagfromnotificationsgroup) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/group/tag` | `project` | -| [`saveNotificationsGroup`](#savenotificationsgroup) | `POST` | `/{version}/account/projects/{projectId}/notifications/settings/group` | `project` | -| [`saveNotificationsTag`](#savenotificationstag) | `POST` | `/{version}/account/projects/{projectId}/notifications/settings/tag` | `project` | -| [`createProject`](#createproject) | `POST` | `/{version}/account/projects` | `project` | -| [`deleteProject`](#deleteproject) | `DELETE` | `/{version}/account/projects/{projectId}` | `project` | -| [`createProjectEnvironment`](#createprojectenvironment) | `POST` | `/{version}/account/projects/environments` | `project` | -| [`deleteProjectEnvironment`](#deleteprojectenvironment) | `DELETE` | `/{version}/account/projects/environments/{environmentName}` | `project` | -| [`setEnvironmentRank`](#setenvironmentrank) | `PATCH` | `/{version}/account/projects/environments/{environmentName}/rank` | `project` | -| [`promoteEnvironment`](#promoteenvironment) | `POST` | `/{version}/account/projects/environments/promote` | `project` | -| [`rollbackPromotion`](#rollbackpromotion) | `POST` | `/{version}/account/projects/environments/promote/rollback` | `project` | -| [`getProjectEnvironments`](#getprojectenvironments) | `GET` | `/{version}/account/projects/environments` | `project` | -| [`getProject`](#getproject) | `GET` | `/{version}/account/projects/{projectId}` | `project` | -| [`getProjects`](#getprojects) | `GET` | `/{version}/account/projects` | `project` | -| [`getAccountRegions`](#getaccountregions) | `GET` | `/{version}/account/regions` | `unauthenticated` | -| [`waitForProjectActive`](#waitforprojectactive) | `GET` | `/{version}/account/projects/{projectId}/wait-active` | `project` | -| [`getProjectTokens`](#getprojecttokens) | `GET` | `/{version}/account/projects/{projectId}/tokens` | `project` | -| [`setAdminPortalEnabled`](#setadminportalenabled) | `PUT` | `/{version}/account/projects/{projectId}/admin-portal/enabled` | `project` | -| [`assignAdminPortalServiceUser`](#assignadminportalserviceuser) | `PUT` | `/{version}/account/projects/{projectId}/settings/admin-portal/service-user` | `project` | -| [`getAdminPortalStructure`](#getadminportalstructure) | `GET` | `/{version}/account/projects/{projectId}/admin-portal/structure` | `project` | -| [`updateProjectAdminUrl`](#updateprojectadminurl) | `PATCH` | `/{version}/account/projects/{projectId}/settings/admin-url` | `project` | -| [`getProjectAiSettings`](#getprojectaisettings) | `GET` | `/{version}/account/projects/{projectId}/ai/settings` | `project` | -| [`updateProjectAiSettings`](#updateprojectaisettings) | `PUT` | `/{version}/account/projects/{projectId}/ai/settings` | `project` | -| [`createProjectAiAssistant`](#createprojectaiassistant) | `POST` | `/{version}/account/projects/{projectId}/ai/assistants` | `project` | -| [`updateProjectAiAssistant`](#updateprojectaiassistant) | `PUT` | `/{version}/account/projects/{projectId}/ai/assistants/{assistantId}` | `project` | -| [`deleteProjectAiAssistant`](#deleteprojectaiassistant) | `DELETE` | `/{version}/account/projects/{projectId}/ai/assistants/{assistantId}` | `project` | -| [`getProjectAiUsage`](#getprojectaiusage) | `GET` | `/{version}/account/projects/{projectId}/ai/usage` | `project` | -| [`updateProjectAccentColor`](#updateprojectaccentcolor) | `PATCH` | `/{version}/account/projects/{projectId}/settings/accent-color` | `project` | -| [`updateProjectIcon`](#updateprojecticon) | `PATCH` | `/{version}/account/projects/{projectId}/settings/icon` | `project` | -| [`updateProjectLogo`](#updateprojectlogo) | `PATCH` | `/{version}/account/projects/{projectId}/settings/logo` | `project` | -| [`updateProjectMainColor`](#updateprojectmaincolor) | `PATCH` | `/{version}/account/projects/{projectId}/settings/main-color` | `project` | -| [`updateProjectAllowedOrigins`](#updateprojectallowedorigins) | `PATCH` | `/{version}/account/projects/{projectId}/settings/origins` | `project` | -| [`updateProjectDefaultLanguage`](#updateprojectdefaultlanguage) | `PATCH` | `/{version}/account/projects/{projectId}/settings/default-language` | `project` | -| [`updateProjectDescription`](#updateprojectdescription) | `PATCH` | `/{version}/account/projects/{projectId}/settings/description` | `project` | -| [`disableProject`](#disableproject) | `PATCH` | `/{version}/account/projects/{projectId}/disable` | `project` | -| [`enableProject`](#enableproject) | `PATCH` | `/{version}/account/projects/{projectId}/enable` | `project` | -| [`updateProjectLanguages`](#updateprojectlanguages) | `PATCH` | `/{version}/account/projects/{projectId}/settings/languages` | `project` | -| [`checkProjectLanguages`](#checkprojectlanguages) | `POST` | `/{version}/account/projects/{projectId}/settings/languages/check` | `project` | -| [`updateProjectLegalDocuments`](#updateprojectlegaldocuments) | `PATCH` | `/{version}/account/projects/{projectId}/settings/legal` | `project` | -| [`updateProjectExposeLegal`](#updateprojectexposelegal) | `PATCH` | `/{version}/account/projects/{projectId}/settings/legal/expose` | `project` | -| [`updateProjectExposeBrand`](#updateprojectexposebrand) | `PATCH` | `/{version}/account/projects/{projectId}/settings/brand/expose` | `project` | -| [`updateProjectExposeAuth`](#updateprojectexposeauth) | `PATCH` | `/{version}/account/projects/{projectId}/settings/auth/expose` | `project` | -| [`updateProjectUrl`](#updateprojecturl) | `PATCH` | `/{version}/account/projects/{projectId}/settings/url` | `project` | -| [`updateProjectName`](#updateprojectname) | `PATCH` | `/{version}/account/projects/{projectId}/settings/name` | `project` | -| [`updateProjectRegions`](#updateprojectregions) | `PATCH` | `/{version}/account/projects/{projectId}/settings/regions` | `project` | -| [`createAccount`](#createaccount) | `POST` | `/{version}/account` | `unauthenticated` | -| [`changeTeamMemberPassword`](#changeteammemberpassword) | `POST` | `/{version}/account/team/member/password` | `project` | -| [`createTeamMember`](#createteammember) | `POST` | `/{version}/account/team/member/create` | `project` | -| [`createAccountPolicy`](#createaccountpolicy) | `POST` | `/{version}/account/team/policies` | `project` | -| [`createAccountRole`](#createaccountrole) | `POST` | `/{version}/account/team/roles` | `project` | -| [`deleteAccountPolicy`](#deleteaccountpolicy) | `DELETE` | `/{version}/account/team/policies/{Id}` | `project` | -| [`deleteAccountRole`](#deleteaccountrole) | `DELETE` | `/{version}/account/team/roles/{Id}` | `project` | -| [`getAccountCollaborators`](#getaccountcollaborators) | `GET` | `/{version}/account/collaborators` | `project` | -| [`getAccountPasswordPolicy`](#getaccountpasswordpolicy) | `GET` | `/{version}/account/team/password-policy` | `project` | -| [`getAccountTeamPolicies`](#getaccountteampolicies) | `GET` | `/{version}/account/team/policies` | `project` | -| [`getAccountTeamRoles`](#getaccountteamroles) | `GET` | `/{version}/account/team/roles` | `project` | -| [`sendInviteToTeamMember`](#sendinvitetoteammember) | `POST` | `/{version}/account/team/member/invite` | `project` | -| [`updateAccountPolicy`](#updateaccountpolicy) | `PUT` | `/{version}/account/team/policies` | `project` | -| [`updateAccountRole`](#updateaccountrole) | `PUT` | `/{version}/account/team/roles` | `project` | -| [`accountHasPasskey`](#accounthaspasskey) | `POST` | `/{version}/account/userauth/has-passkey` | `project` | -| [`accountStartEmailVerification`](#accountstartemailverification) | `POST` | `/{version}/account/userauth/email/start-verification` | `project` | -| [`accountConfirmEmailVerification`](#accountconfirmemailverification) | `POST` | `/{version}/account/userauth/email/confirm-verification` | `project` | -| [`accountPasskeyRegistrationOptions`](#accountpasskeyregistrationoptions) | `POST` | `/{version}/account/userauth/passkey/registration-options` | `project` | -| [`accountVerifyPasskeyRegistration`](#accountverifypasskeyregistration) | `POST` | `/{version}/account/userauth/passkey/verify-registration` | `project` | -| [`accountPasskeyAuthenticationOptions`](#accountpasskeyauthenticationoptions) | `POST` | `/{version}/account/userauth/passkey/authentication-options` | `project` | -| [`accountVerifyPasskeyAuthentication`](#accountverifypasskeyauthentication) | `POST` | `/{version}/account/userauth/passkey/verify-authentication` | `project` | -| [`listAccountPasskeys`](#listaccountpasskeys) | `GET` | `/{version}/account/userauth/passkeys` | `project` | -| [`renameAccountPasskey`](#renameaccountpasskey) | `POST` | `/{version}/account/userauth/passkeys/{CredentialId}/rename` | `project` | -| [`revokeAccountPasskey`](#revokeaccountpasskey) | `POST` | `/{version}/account/userauth/passkeys/{CredentialId}/revoke` | `project` | -| [`accountPasskeyEnrollmentOptions`](#accountpasskeyenrollmentoptions) | `POST` | `/{version}/account/userauth/passkey/enrollment-options` | `project` | -| [`accountVerifyPasskeyEnrollment`](#accountverifypasskeyenrollment) | `POST` | `/{version}/account/userauth/passkey/verify-enrollment` | `project` | -| [`getMyAccountUserProfile`](#getmyaccountuserprofile) | `GET` | `/{version}/account/me` | `project` | -| [`updateMyAccountUserPhone`](#updatemyaccountuserphone) | `PUT` | `/{version}/account/me/phone` | `project` | -| [`getLicenseDomainDnsStatus`](#getlicensedomaindnsstatus) | `GET` | `/{version}/account/licensing/dns-status` | `project` | -| [`getLicenses`](#getlicenses) | `GET` | `/{version}/account/licenses` | `project` | -| [`getInstallationLicenseStatus`](#getinstallationlicensestatus) | `GET` | `/{version}/account/licensing/status` | `project` | -| [`createAiServiceUser`](#createaiserviceuser) | `POST` | `/{version}/account/ai/service-users` | `project` | -| [`listAiServiceUsers`](#listaiserviceusers) | `GET` | `/{version}/account/ai/service-users` | `project` | -| [`rotateAiServiceUserKey`](#rotateaiserviceuserkey) | `POST` | `/{version}/account/ai/service-users/{Id}/keys` | `project` | -| [`revokeAiServiceUserKey`](#revokeaiserviceuserkey) | `DELETE` | `/{version}/account/ai/service-users/{Id}/keys/{KeyId}` | `project` | -| [`deleteAiServiceUser`](#deleteaiserviceuser) | `DELETE` | `/{version}/account/ai/service-users/{Id}` | `project` | -| [`getAgentOnboarding`](#getagentonboarding) | `GET` | `/{version}/account/agent/onboarding` | `project` | -| [`getAiTools`](#getaitools) | `GET` | `/{version}/account/ai/tools` | `project` | -| [`invokeAiTool`](#invokeaitool) | `POST` | `/{version}/account/ai/tools/{ToolName}` | `project` | -| [`uploadChatAttachment`](#uploadchatattachment) | `POST` | `/{version}/account/chat/attachments` | `project` | -| [`chatAvailability`](#chatavailability) | `GET` | `/{version}/account/chat/availability` | `project` | -| [`getChatMemory`](#getchatmemory) | `GET` | `/{version}/account/chat/memory` | `project` | -| [`forgetChatMemory`](#forgetchatmemory) | `DELETE` | `/{version}/account/chat/memory/{NoteId}` | `project` | -| [`deleteChatSession`](#deletechatsession) | `DELETE` | `/{version}/account/chat/sessions/{SessionId}` | `project` | -| [`setChatSessionArchived`](#setchatsessionarchived) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/archive` | `project` | -| [`setChatSessionPinned`](#setchatsessionpinned) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/pin` | `project` | -| [`setChatSessionSharing`](#setchatsessionsharing) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/sharing` | `project` | -| [`getChatSessions`](#getchatsessions) | `GET` | `/{version}/account/chat/sessions` | `project` | -| [`getChatSessionEntries`](#getchatsessionentries) | `GET` | `/{version}/account/chat/sessions/{SessionId}/entries` | `project` | -| [`setChatEntryFeedback`](#setchatentryfeedback) | `POST` | `/{version}/account/chat/sessions/{SessionId}/entries/{EntryId}/feedback` | `project` | -| [`answerChatQuestion`](#answerchatquestion) | `POST` | `/{version}/account/chat/sessions/{SessionId}/questions/{EntryId}/answer` | `project` | -| [`decideChatPlan`](#decidechatplan) | `POST` | `/{version}/account/chat/sessions/{SessionId}/plans/{EntryId}/decision` | `project` | -| [`stopChatRunStep`](#stopchatrunstep) | `POST` | `/{version}/account/chat/sessions/{SessionId}/steps/{EntryId}/stop` | `project` | -| [`chatTurn`](#chatturn) | `POST` | `/{version}/account/chat/turn` | `project` | -| [`scaffoldProject`](#scaffoldproject) | `POST` | `/{version}/account/ai/scaffold` | `project` | -| [`validateSchema`](#validateschema) | `POST` | `/{version}/account/ai/schemas/validate` | `project` | -| [`renderTemplatePreview`](#rendertemplatepreview) | `POST` | `/{version}/account/ai/templates/render-preview` | `project` | -| [`mcp`](#mcp) | `POST` | `/{version}/account/mcp` | `project` | +| Method | Verb | Path | Scope | +| ----------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------- | --------- | +| [`getAccountProfile`](#getaccountprofile) | `GET` | `/{version}/account/profile` | `project` | +| [`updateAccountProfile`](#updateaccountprofile) | `PUT` | `/{version}/account/profile` | `project` | +| [`resendAccountVerificationToken`](#resendaccountverificationtoken) | `POST` | `/{version}/account/verify/resend` | `project` | +| [`getAccountStatus`](#getaccountstatus) | `GET` | `/{version}/account/status` | `project` | +| [`createStripeCheckoutSession`](#createstripecheckoutsession) | `POST` | `/{version}/account/stripe/create-checkout-session` | `project` | +| [`getStripeBillingPortalUrl`](#getstripebillingportalurl) | `POST` | `/{version}/account/stripe/get-portal-url` | `project` | +| [`createTeamMemberFromInvitation`](#createteammemberfrominvitation) | `POST` | `/{version}/account/team/member` | `project` | +| [`getAccountUsageBilling`](#getaccountusagebilling) | `GET` | `/{version}/account/usage-billing` | `project` | +| [`verifyAccount`](#verifyaccount) | `POST` | `/{version}/account/verify` | `project` | +| [`deleteNotificationsGroup`](#deletenotificationsgroup) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/group` | `project` | +| [`deleteNotificationsTag`](#deletenotificationstag) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/tag` | `project` | +| [`removeTagFromNotificationsGroup`](#removetagfromnotificationsgroup) | `DELETE` | `/{version}/account/projects/{projectId}/notifications/settings/group/tag` | `project` | +| [`saveNotificationsGroup`](#savenotificationsgroup) | `POST` | `/{version}/account/projects/{projectId}/notifications/settings/group` | `project` | +| [`saveNotificationsTag`](#savenotificationstag) | `POST` | `/{version}/account/projects/{projectId}/notifications/settings/tag` | `project` | +| [`createProject`](#createproject) | `POST` | `/{version}/account/projects` | `project` | +| [`deleteProject`](#deleteproject) | `DELETE` | `/{version}/account/projects/{projectId}` | `project` | +| [`createProjectEnvironment`](#createprojectenvironment) | `POST` | `/{version}/account/projects/environments` | `project` | +| [`deleteProjectEnvironment`](#deleteprojectenvironment) | `DELETE` | `/{version}/account/projects/environments/{environmentName}` | `project` | +| [`setEnvironmentRank`](#setenvironmentrank) | `PATCH` | `/{version}/account/projects/environments/{environmentName}/rank` | `project` | +| [`promoteEnvironment`](#promoteenvironment) | `POST` | `/{version}/account/projects/environments/promote` | `project` | +| [`rollbackPromotion`](#rollbackpromotion) | `POST` | `/{version}/account/projects/environments/promote/rollback` | `project` | +| [`getProjectEnvironments`](#getprojectenvironments) | `GET` | `/{version}/account/projects/environments` | `project` | +| [`getProject`](#getproject) | `GET` | `/{version}/account/projects/{projectId}` | `project` | +| [`getProjects`](#getprojects) | `GET` | `/{version}/account/projects` | `project` | +| [`getAccountRegions`](#getaccountregions) | `GET` | `/{version}/account/regions` | `project` | +| [`waitForProjectActive`](#waitforprojectactive) | `GET` | `/{version}/account/projects/{projectId}/wait-active` | `project` | +| [`getProjectTokens`](#getprojecttokens) | `GET` | `/{version}/account/projects/{projectId}/tokens` | `project` | +| [`setAdminPortalEnabled`](#setadminportalenabled) | `PUT` | `/{version}/account/projects/{projectId}/admin-portal/enabled` | `project` | +| [`updateProjectExposeBrand`](#updateprojectexposebrand) | `PATCH` | `/{version}/account/projects/{projectId}/settings/brand/expose` | `project` | +| [`updateProjectExposeAuth`](#updateprojectexposeauth) | `PATCH` | `/{version}/account/projects/{projectId}/settings/auth/expose` | `project` | +| [`assignAdminPortalServiceUser`](#assignadminportalserviceuser) | `PUT` | `/{version}/account/projects/{projectId}/settings/admin-portal/service-user` | `project` | +| [`getAdminPortalStructure`](#getadminportalstructure) | `GET` | `/{version}/account/projects/{projectId}/admin-portal/structure` | `project` | +| [`updateProjectAdminUrl`](#updateprojectadminurl) | `PATCH` | `/{version}/account/projects/{projectId}/settings/admin-url` | `project` | +| [`createAiCreditPackCheckout`](#createaicreditpackcheckout) | `POST` | `/{version}/account/projects/{projectId}/ai/credits/checkout` | `project` | +| [`getProjectAiPlans`](#getprojectaiplans) | `GET` | `/{version}/account/projects/{projectId}/ai/plans` | `project` | +| [`updateProjectAiPlans`](#updateprojectaiplans) | `PUT` | `/{version}/account/projects/{projectId}/ai/plans` | `project` | +| [`updateProjectAiPlanAssignments`](#updateprojectaiplanassignments) | `PUT` | `/{version}/account/projects/{projectId}/ai/plans/assignments` | `project` | +| [`getProjectAiUserPlans`](#getprojectaiuserplans) | `GET` | `/{version}/account/projects/{projectId}/ai/plans/users` | `project` | +| [`getProjectAiSettings`](#getprojectaisettings) | `GET` | `/{version}/account/projects/{projectId}/ai/settings` | `project` | +| [`updateProjectAiSettings`](#updateprojectaisettings) | `PUT` | `/{version}/account/projects/{projectId}/ai/settings` | `project` | +| [`updateProjectAiKnowledge`](#updateprojectaiknowledge) | `PUT` | `/{version}/account/projects/{projectId}/ai/knowledge` | `project` | +| [`createProjectAiAssistant`](#createprojectaiassistant) | `POST` | `/{version}/account/projects/{projectId}/ai/assistants` | `project` | +| [`updateProjectAiAssistant`](#updateprojectaiassistant) | `PUT` | `/{version}/account/projects/{projectId}/ai/assistants/{assistantId}` | `project` | +| [`deleteProjectAiAssistant`](#deleteprojectaiassistant) | `DELETE` | `/{version}/account/projects/{projectId}/ai/assistants/{assistantId}` | `project` | +| [`getProjectAiUsage`](#getprojectaiusage) | `GET` | `/{version}/account/projects/{projectId}/ai/usage` | `project` | +| [`updateProjectAccentColor`](#updateprojectaccentcolor) | `PATCH` | `/{version}/account/projects/{projectId}/settings/accent-color` | `project` | +| [`updateProjectIcon`](#updateprojecticon) | `PATCH` | `/{version}/account/projects/{projectId}/settings/icon` | `project` | +| [`updateProjectLogo`](#updateprojectlogo) | `PATCH` | `/{version}/account/projects/{projectId}/settings/logo` | `project` | +| [`updateProjectMainColor`](#updateprojectmaincolor) | `PATCH` | `/{version}/account/projects/{projectId}/settings/main-color` | `project` | +| [`updateProjectAllowedOrigins`](#updateprojectallowedorigins) | `PATCH` | `/{version}/account/projects/{projectId}/settings/origins` | `project` | +| [`updateProjectDefaultLanguage`](#updateprojectdefaultlanguage) | `PATCH` | `/{version}/account/projects/{projectId}/settings/default-language` | `project` | +| [`updateProjectDescription`](#updateprojectdescription) | `PATCH` | `/{version}/account/projects/{projectId}/settings/description` | `project` | +| [`disableProject`](#disableproject) | `PATCH` | `/{version}/account/projects/{projectId}/disable` | `project` | +| [`enableProject`](#enableproject) | `PATCH` | `/{version}/account/projects/{projectId}/enable` | `project` | +| [`updateProjectLanguages`](#updateprojectlanguages) | `PATCH` | `/{version}/account/projects/{projectId}/settings/languages` | `project` | +| [`checkProjectLanguages`](#checkprojectlanguages) | `POST` | `/{version}/account/projects/{projectId}/settings/languages/check` | `project` | +| [`updateProjectLegalDocuments`](#updateprojectlegaldocuments) | `PATCH` | `/{version}/account/projects/{projectId}/settings/legal` | `project` | +| [`updateProjectExposeLegal`](#updateprojectexposelegal) | `PATCH` | `/{version}/account/projects/{projectId}/settings/legal/expose` | `project` | +| [`updateProjectUrl`](#updateprojecturl) | `PATCH` | `/{version}/account/projects/{projectId}/settings/url` | `project` | +| [`updateProjectName`](#updateprojectname) | `PATCH` | `/{version}/account/projects/{projectId}/settings/name` | `project` | +| [`updateProjectRegions`](#updateprojectregions) | `PATCH` | `/{version}/account/projects/{projectId}/settings/regions` | `project` | +| [`createAccount`](#createaccount) | `POST` | `/{version}/account` | `project` | +| [`changeTeamMemberPassword`](#changeteammemberpassword) | `POST` | `/{version}/account/team/member/password` | `project` | +| [`createTeamMember`](#createteammember) | `POST` | `/{version}/account/team/member/create` | `project` | +| [`createAccountPolicy`](#createaccountpolicy) | `POST` | `/{version}/account/team/policies` | `project` | +| [`createAccountRole`](#createaccountrole) | `POST` | `/{version}/account/team/roles` | `project` | +| [`deleteAccountPolicy`](#deleteaccountpolicy) | `DELETE` | `/{version}/account/team/policies/{Id}` | `project` | +| [`deleteAccountRole`](#deleteaccountrole) | `DELETE` | `/{version}/account/team/roles/{Id}` | `project` | +| [`getAccountCollaborators`](#getaccountcollaborators) | `GET` | `/{version}/account/collaborators` | `project` | +| [`getAccountPasswordPolicy`](#getaccountpasswordpolicy) | `GET` | `/{version}/account/team/password-policy` | `project` | +| [`getAccountTeamPolicies`](#getaccountteampolicies) | `GET` | `/{version}/account/team/policies` | `project` | +| [`getAccountTeamRoles`](#getaccountteamroles) | `GET` | `/{version}/account/team/roles` | `project` | +| [`sendInviteToTeamMember`](#sendinvitetoteammember) | `POST` | `/{version}/account/team/member/invite` | `project` | +| [`updateAccountPolicy`](#updateaccountpolicy) | `PUT` | `/{version}/account/team/policies` | `project` | +| [`updateAccountRole`](#updateaccountrole) | `PUT` | `/{version}/account/team/roles` | `project` | +| [`accountHasPasskey`](#accounthaspasskey) | `POST` | `/{version}/account/userauth/has-passkey` | `project` | +| [`accountStartEmailVerification`](#accountstartemailverification) | `POST` | `/{version}/account/userauth/email/start-verification` | `project` | +| [`accountConfirmEmailVerification`](#accountconfirmemailverification) | `POST` | `/{version}/account/userauth/email/confirm-verification` | `project` | +| [`accountPasskeyRegistrationOptions`](#accountpasskeyregistrationoptions) | `POST` | `/{version}/account/userauth/passkey/registration-options` | `project` | +| [`accountVerifyPasskeyRegistration`](#accountverifypasskeyregistration) | `POST` | `/{version}/account/userauth/passkey/verify-registration` | `project` | +| [`accountPasskeyAuthenticationOptions`](#accountpasskeyauthenticationoptions) | `POST` | `/{version}/account/userauth/passkey/authentication-options` | `project` | +| [`accountVerifyPasskeyAuthentication`](#accountverifypasskeyauthentication) | `POST` | `/{version}/account/userauth/passkey/verify-authentication` | `project` | +| [`listAccountPasskeys`](#listaccountpasskeys) | `GET` | `/{version}/account/userauth/passkeys` | `project` | +| [`renameAccountPasskey`](#renameaccountpasskey) | `POST` | `/{version}/account/userauth/passkeys/{CredentialId}/rename` | `project` | +| [`revokeAccountPasskey`](#revokeaccountpasskey) | `POST` | `/{version}/account/userauth/passkeys/{CredentialId}/revoke` | `project` | +| [`accountPasskeyEnrollmentOptions`](#accountpasskeyenrollmentoptions) | `POST` | `/{version}/account/userauth/passkey/enrollment-options` | `project` | +| [`accountVerifyPasskeyEnrollment`](#accountverifypasskeyenrollment) | `POST` | `/{version}/account/userauth/passkey/verify-enrollment` | `project` | +| [`getMyAccountUserProfile`](#getmyaccountuserprofile) | `GET` | `/{version}/account/me` | `project` | +| [`updateMyAccountUserPhone`](#updatemyaccountuserphone) | `PUT` | `/{version}/account/me/phone` | `project` | +| [`getLicenseDomainDnsStatus`](#getlicensedomaindnsstatus) | `GET` | `/{version}/account/licensing/dns-status` | `project` | +| [`getLicenses`](#getlicenses) | `GET` | `/{version}/account/licenses` | `project` | +| [`getInstallationLicenseStatus`](#getinstallationlicensestatus) | `GET` | `/{version}/account/licensing/status` | `project` | +| [`getLicenseKey`](#getlicensekey) | `GET` | `/{version}/account/licenses/{Id}/key` | `project` | +| [`createAiServiceUser`](#createaiserviceuser) | `POST` | `/{version}/account/ai/service-users` | `project` | +| [`listAiServiceUsers`](#listaiserviceusers) | `GET` | `/{version}/account/ai/service-users` | `project` | +| [`rotateAiServiceUserKey`](#rotateaiserviceuserkey) | `POST` | `/{version}/account/ai/service-users/{Id}/keys` | `project` | +| [`revokeAiServiceUserKey`](#revokeaiserviceuserkey) | `DELETE` | `/{version}/account/ai/service-users/{Id}/keys/{KeyId}` | `project` | +| [`deleteAiServiceUser`](#deleteaiserviceuser) | `DELETE` | `/{version}/account/ai/service-users/{Id}` | `project` | +| [`getAgentOnboarding`](#getagentonboarding) | `GET` | `/{version}/account/agent/onboarding` | `project` | +| [`getAiContext`](#getaicontext) | `GET` | `/{version}/account/ai/context` | `project` | +| [`getAiTools`](#getaitools) | `GET` | `/{version}/account/ai/tools` | `project` | +| [`invokeAiTool`](#invokeaitool) | `POST` | `/{version}/account/ai/tools/{ToolName}` | `project` | +| [`uploadChatAttachment`](#uploadchatattachment) | `POST` | `/{version}/account/chat/attachments` | `project` | +| [`chatAvailability`](#chatavailability) | `GET` | `/{version}/account/chat/availability` | `project` | +| [`getChatMemory`](#getchatmemory) | `GET` | `/{version}/account/chat/memory` | `project` | +| [`forgetChatMemory`](#forgetchatmemory) | `DELETE` | `/{version}/account/chat/memory/{NoteId}` | `project` | +| [`deleteChatSession`](#deletechatsession) | `DELETE` | `/{version}/account/chat/sessions/{SessionId}` | `project` | +| [`setChatSessionArchived`](#setchatsessionarchived) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/archive` | `project` | +| [`setChatSessionPinned`](#setchatsessionpinned) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/pin` | `project` | +| [`setChatSessionSharing`](#setchatsessionsharing) | `PATCH` | `/{version}/account/chat/sessions/{SessionId}/sharing` | `project` | +| [`getChatSessions`](#getchatsessions) | `GET` | `/{version}/account/chat/sessions` | `project` | +| [`getChatSessionEntries`](#getchatsessionentries) | `GET` | `/{version}/account/chat/sessions/{SessionId}/entries` | `project` | +| [`setChatEntryFeedback`](#setchatentryfeedback) | `POST` | `/{version}/account/chat/sessions/{SessionId}/entries/{EntryId}/feedback` | `project` | +| [`answerChatQuestion`](#answerchatquestion) | `POST` | `/{version}/account/chat/sessions/{SessionId}/questions/{EntryId}/answer` | `project` | +| [`decideChatPlan`](#decidechatplan) | `POST` | `/{version}/account/chat/sessions/{SessionId}/plans/{EntryId}/decision` | `project` | +| [`stopChatRunStep`](#stopchatrunstep) | `POST` | `/{version}/account/chat/sessions/{SessionId}/steps/{EntryId}/stop` | `project` | +| [`chatTurn`](#chatturn) | `POST` | `/{version}/account/chat/turn` | `project` | +| [`scaffoldProject`](#scaffoldproject) | `POST` | `/{version}/account/ai/scaffold` | `project` | +| [`validateSchema`](#validateschema) | `POST` | `/{version}/account/ai/schemas/validate` | `project` | +| [`renderTemplatePreview`](#rendertemplatepreview) | `POST` | `/{version}/account/ai/templates/render-preview` | `project` | +| [`mcp`](#mcp) | `POST` | `/{version}/account/mcp` | `project` | ## Reference @@ -172,7 +180,7 @@ const result = await norbix.hub.account.updateAccountProfile({ ### resendAccountVerificationToken -`GET` `/{version}/account/verify/resend` +`POST` `/{version}/account/verify/resend` **Request DTO**: `CodeMashHub2.ResendAccountVerificationToken` **Response**: `CodeMashHub2.EmptyResponse` @@ -262,8 +270,6 @@ const result = await norbix.hub.account.getStripeBillingPortalUrl({ Create a new item. -> **No token needed.** Accepts a team invitation for someone who has no account yet. The client needs no `apiKey` / `bearerToken` and no `accountId`; the call is sent with no `Authorization` header (scope `unauthenticated`). - **Request DTO**: `CodeMashHub2.CreateTeamMemberFromInvitation` **Response**: `CodeMashHub2.CreateTeamMemberFromInvitationResponse` @@ -304,12 +310,10 @@ const result = await norbix.hub.account.getAccountUsageBilling({ ### verifyAccount -`GET` `/{version}/account/verify` +`POST` `/{version}/account/verify` Verify / confirm the resource. -> **No token needed.** Pass the account id and the verification token in the request (`{ accountId, token }`, sent in the query string). The client needs no `apiKey` / `bearerToken` and no `accountId`; the call is sent with no `Authorization` header (scope `unauthenticated`). - **Request DTO**: `CodeMashHub2.VerifyAccount` **Response**: `CodeMashHub2.EmptyResponse` @@ -319,8 +323,7 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); const result = await norbix.hub.account.verifyAccount({ - accountId: '', - token: '', + // See CodeMash type for the full request shape. }); // → typed as CodeMashHub2.EmptyResponse ``` @@ -664,8 +667,6 @@ const result = await norbix.hub.account.getProjects({ Fetch a single item by ID. -> **No token needed.** Lists the regions you can pick before you have an account. The client needs no `apiKey` / `bearerToken` and no `accountId`; the call is sent with no `Authorization` header (scope `unauthenticated`). - **Request DTO**: `CodeMashHub2.GetAccountRegions` **Response**: `CodeMashHub2.GetAccountRegionsResponse` @@ -747,6 +748,52 @@ const result = await norbix.hub.account.setAdminPortalEnabled({ [↑ Top](#endpoints) +### updateProjectExposeBrand + +`PATCH` `/{version}/account/projects/{projectId}/settings/brand/expose` + +Update an existing item. + +**Request DTO**: `CodeMashHub2.UpdateProjectExposeBrand` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.updateProjectExposeBrand({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### updateProjectExposeAuth + +`PATCH` `/{version}/account/projects/{projectId}/settings/auth/expose` + +Update an existing item. + +**Request DTO**: `CodeMashHub2.UpdateProjectExposeAuth` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.updateProjectExposeAuth({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + ### assignAdminPortalServiceUser `PUT` `/{version}/account/projects/{projectId}/settings/admin-portal/service-user` @@ -816,6 +863,121 @@ const result = await norbix.hub.account.updateProjectAdminUrl({ [↑ Top](#endpoints) +### createAiCreditPackCheckout + +`POST` `/{version}/account/projects/{projectId}/ai/credits/checkout` + +Create a new item. + +**Request DTO**: `CodeMashHub2.CreateAiCreditPackCheckoutRequest` +**Response**: `CodeMashHub2.CreateAiCreditPackCheckoutResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.createAiCreditPackCheckout({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.CreateAiCreditPackCheckoutResponse +``` + +[↑ Top](#endpoints) + +### getProjectAiPlans + +`GET` `/{version}/account/projects/{projectId}/ai/plans` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetProjectAiPlans` +**Response**: `CodeMashHub2.GetProjectAiPlansResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.getProjectAiPlans({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetProjectAiPlansResponse +``` + +[↑ Top](#endpoints) + +### updateProjectAiPlans + +`PUT` `/{version}/account/projects/{projectId}/ai/plans` + +Update an existing item. + +**Request DTO**: `CodeMashHub2.UpdateProjectAiPlans` +**Response**: `CodeMashHub2.UpdateProjectAiPlansResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.updateProjectAiPlans({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.UpdateProjectAiPlansResponse +``` + +[↑ Top](#endpoints) + +### updateProjectAiPlanAssignments + +`PUT` `/{version}/account/projects/{projectId}/ai/plans/assignments` + +Update an existing item. + +**Request DTO**: `CodeMashHub2.UpdateProjectAiPlanAssignments` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.updateProjectAiPlanAssignments({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### getProjectAiUserPlans + +`GET` `/{version}/account/projects/{projectId}/ai/plans/users` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetProjectAiUserPlans` +**Response**: `CodeMashHub2.GetProjectAiUserPlansResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.getProjectAiUserPlans({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetProjectAiUserPlansResponse +``` + +[↑ Top](#endpoints) + ### getProjectAiSettings `GET` `/{version}/account/projects/{projectId}/ai/settings` @@ -862,6 +1024,29 @@ const result = await norbix.hub.account.updateProjectAiSettings({ [↑ Top](#endpoints) +### updateProjectAiKnowledge + +`PUT` `/{version}/account/projects/{projectId}/ai/knowledge` + +Update an existing item. + +**Request DTO**: `CodeMashHub2.UpdateProjectAiKnowledge` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.updateProjectAiKnowledge({ + projectId: 'projectId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + ### createProjectAiAssistant `POST` `/{version}/account/projects/{projectId}/ai/assistants` @@ -1255,52 +1440,6 @@ const result = await norbix.hub.account.updateProjectExposeLegal({ [↑ Top](#endpoints) -### updateProjectExposeBrand - -`PATCH` `/{version}/account/projects/{projectId}/settings/brand/expose` - -Update an existing item. - -**Request DTO**: `CodeMashHub2.UpdateProjectExposeBrand` -**Response**: `CodeMashHub2.EmptyResponse` - -```ts -import { Norbix } from '@norbix.ai/ts'; - -const norbix = new Norbix(); - -const result = await norbix.hub.account.updateProjectExposeBrand({ - projectId: 'projectId-here', - // Other fields: see CodeMash type for the full request shape. -}); -// → typed as CodeMashHub2.EmptyResponse -``` - -[↑ Top](#endpoints) - -### updateProjectExposeAuth - -`PATCH` `/{version}/account/projects/{projectId}/settings/auth/expose` - -Update an existing item. - -**Request DTO**: `CodeMashHub2.UpdateProjectExposeAuth` -**Response**: `CodeMashHub2.EmptyResponse` - -```ts -import { Norbix } from '@norbix.ai/ts'; - -const norbix = new Norbix(); - -const result = await norbix.hub.account.updateProjectExposeAuth({ - projectId: 'projectId-here', - // Other fields: see CodeMash type for the full request shape. -}); -// → typed as CodeMashHub2.EmptyResponse -``` - -[↑ Top](#endpoints) - ### updateProjectUrl `PATCH` `/{version}/account/projects/{projectId}/settings/url` @@ -1376,8 +1515,6 @@ const result = await norbix.hub.account.updateProjectRegions({ Create a new item. -> **No token needed.** Sign-up: creates a new account. The client needs no `apiKey` / `bearerToken` and no `accountId`; the call is sent with no `Authorization` header (scope `unauthenticated`). - **Request DTO**: `CodeMashHub2.CreateAccount` **Response**: `CodeMashHub2.CreateAccountResponse` @@ -2032,6 +2169,29 @@ const result = await norbix.hub.account.getInstallationLicenseStatus({ [↑ Top](#endpoints) +### getLicenseKey + +`GET` `/{version}/account/licenses/{Id}/key` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetLicenseKey` +**Response**: `CodeMashHub2.GetLicenseKeyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.getLicenseKey({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetLicenseKeyResponse +``` + +[↑ Top](#endpoints) + ### createAiServiceUser `POST` `/{version}/account/ai/service-users` @@ -2164,6 +2324,28 @@ const result = await norbix.hub.account.getAgentOnboarding({ [↑ Top](#endpoints) +### getAiContext + +`GET` `/{version}/account/ai/context` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetAiContextRequest` +**Response**: `CodeMashHub2.GetAiContextResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.account.getAiContext({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetAiContextResponse +``` + +[↑ Top](#endpoints) + ### getAiTools `GET` `/{version}/account/ai/tools` diff --git a/docs/hub/ai.md b/docs/hub/ai.md index 76e3caa..486d7b6 100644 --- a/docs/hub/ai.md +++ b/docs/hub/ai.md @@ -8,6 +8,12 @@ Accessed as `norbix.hub.ai` on the [`Norbix`](../../README.md#authentication) cl | Method | Verb | Path | Scope | | ----------------------------------------------------------- | -------- | ------------------------------------------------- | --------- | +| [`saveAiProjectTrigger`](#saveaiprojecttrigger) | `POST` | `/{version}/ai/triggers` | `project` | +| [`getAiProjectTriggers`](#getaiprojecttriggers) | `GET` | `/{version}/ai/triggers` | `project` | +| [`getAiProjectTrigger`](#getaiprojecttrigger) | `GET` | `/{version}/ai/triggers/{id}` | `project` | +| [`enableAiProjectTrigger`](#enableaiprojecttrigger) | `PATCH` | `/{version}/ai/triggers/{triggerId}/enable` | `project` | +| [`disableAiProjectTrigger`](#disableaiprojecttrigger) | `PATCH` | `/{version}/ai/triggers/{triggerId}/disable` | `project` | +| [`deleteAiProjectTrigger`](#deleteaiprojecttrigger) | `DELETE` | `/{version}/ai/triggers/{triggerId}` | `project` | | [`deleteEmbeddingIntegration`](#deleteembeddingintegration) | `DELETE` | `/{version}/ai/integrations/embeddings/{Id}` | `project` | | [`getEmbeddingIntegration`](#getembeddingintegration) | `GET` | `/{version}/ai/integrations/embeddings/{Id}` | `project` | | [`getEmbeddingIntegrations`](#getembeddingintegrations) | `GET` | `/{version}/ai/integrations/embeddings` | `project` | @@ -31,6 +37,142 @@ Accessed as `norbix.hub.ai` on the [`Norbix`](../../README.md#authentication) cl ## Reference +### saveAiProjectTrigger + +`POST` `/{version}/ai/triggers` + +Upsert an item (create or update). + +**Request DTO**: `CodeMashHub2.SaveAiProjectTrigger` +**Response**: `CodeMashHub2.IdResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.saveAiProjectTrigger({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.IdResponse +``` + +[↑ Top](#endpoints) + +### getAiProjectTriggers + +`GET` `/{version}/ai/triggers` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetAiProjectTriggers` +**Response**: `CodeMashHub2.GetAiTriggersResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.getAiProjectTriggers({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetAiTriggersResponse +``` + +[↑ Top](#endpoints) + +### getAiProjectTrigger + +`GET` `/{version}/ai/triggers/{id}` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetAiProjectTrigger` +**Response**: `CodeMashHub2.GetAiTriggerResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.getAiProjectTrigger({ + id: 'id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.GetAiTriggerResponse +``` + +[↑ Top](#endpoints) + +### enableAiProjectTrigger + +`PATCH` `/{version}/ai/triggers/{triggerId}/enable` + +Enable the resource. + +**Request DTO**: `CodeMashHub2.EnableAiProjectTrigger` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.enableAiProjectTrigger({ + triggerId: 'triggerId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### disableAiProjectTrigger + +`PATCH` `/{version}/ai/triggers/{triggerId}/disable` + +Disable the resource. + +**Request DTO**: `CodeMashHub2.DisableAiProjectTrigger` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.disableAiProjectTrigger({ + triggerId: 'triggerId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + +### deleteAiProjectTrigger + +`DELETE` `/{version}/ai/triggers/{triggerId}` + +Delete an item. + +**Request DTO**: `CodeMashHub2.DeleteAiProjectTrigger` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.ai.deleteAiProjectTrigger({ + triggerId: 'triggerId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + ### deleteEmbeddingIntegration `DELETE` `/{version}/ai/integrations/embeddings/{Id}` diff --git a/docs/hub/apikeys.md b/docs/hub/apikeys.md index 13cb9ae..3dab46e 100644 --- a/docs/hub/apikeys.md +++ b/docs/hub/apikeys.md @@ -21,6 +21,8 @@ Accessed as `norbix.hub.apikeys` on the [`Norbix`](../../README.md#authenticatio Fetch a single item by ID. +> **Deprecated.** The gateway has no `/apikeys` endpoint (there is no such route in its history), so this call fails. Use service-user API keys: `norbix.hub.membership.listServiceUserApiKeys` / `issueServiceUserApiKey`. + **Request DTO**: `CodeMashHub2.GetApiKeys` **Response**: `CodeMashHub2.GetApiKeysResponse` @@ -41,6 +43,8 @@ const result = await norbix.hub.apikeys.getApiKeys({ `POST` `/apikeys/regenerate` +> **Deprecated.** The gateway has no `/apikeys/regenerate` endpoint, so this call fails. Use `norbix.hub.membership.issueServiceUserApiKey` and `deleteServiceUserApiKey`. + **Request DTO**: `CodeMashHub2.RegenerateApiKeys` **Response**: `CodeMashHub2.RegenerateApiKeysResponse` diff --git a/docs/hub/auth.md b/docs/hub/auth.md index b557e55..fe0bd25 100644 --- a/docs/hub/auth.md +++ b/docs/hub/auth.md @@ -8,12 +8,96 @@ Accessed as `norbix.hub.auth` on the [`Norbix`](../../README.md#authentication) ## Endpoints -| Method | Verb | Path | Scope | -| ------------------------------- | ------ | ---------- | --------- | -| [`authenticate`](#authenticate) | `POST` | `/v3/auth` | `project` | +| Method | Verb | Path | Scope | +| --------------------------------------------------------- | ------ | -------------------------------- | --------- | +| [`authDeviceStart`](#authdevicestart) | `POST` | `/{version}/auth/device/start` | `project` | +| [`authDeviceToken`](#authdevicetoken) | `POST` | `/{version}/auth/device/token` | `project` | +| [`authDeviceConsent`](#authdeviceconsent) | `GET` | `/{version}/auth/device/consent` | `project` | +| [`authDeviceConsentDecision`](#authdeviceconsentdecision) | `POST` | `/{version}/auth/device/consent` | `project` | +| [`authenticate`](#authenticate) | `POST` | `/v3/auth` | `project` | ## Reference +### authDeviceStart + +`POST` `/{version}/auth/device/start` + +**Request DTO**: `CodeMashHub2.AuthDeviceStartRequest` +**Response**: `CodeMashHub2.AuthDeviceStartResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.auth.authDeviceStart({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.AuthDeviceStartResponse +``` + +[↑ Top](#endpoints) + +### authDeviceToken + +`POST` `/{version}/auth/device/token` + +**Request DTO**: `CodeMashHub2.AuthDeviceTokenRequest` +**Response**: `CodeMashHub2.AuthDeviceTokenResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.auth.authDeviceToken({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.AuthDeviceTokenResponse +``` + +[↑ Top](#endpoints) + +### authDeviceConsent + +`GET` `/{version}/auth/device/consent` + +**Request DTO**: `CodeMashHub2.AuthDeviceConsentRequest` +**Response**: `CodeMashHub2.AuthDeviceConsentResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.auth.authDeviceConsent({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.AuthDeviceConsentResponse +``` + +[↑ Top](#endpoints) + +### authDeviceConsentDecision + +`POST` `/{version}/auth/device/consent` + +**Request DTO**: `CodeMashHub2.AuthDeviceConsentDecisionRequest` +**Response**: `CodeMashHub2.AuthDeviceConsentDecisionResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.auth.authDeviceConsentDecision({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.AuthDeviceConsentDecisionResponse +``` + +[↑ Top](#endpoints) + ### authenticate `POST` `/v3/auth` diff --git a/docs/hub/code.md b/docs/hub/code.md index 370997f..23c6673 100644 --- a/docs/hub/code.md +++ b/docs/hub/code.md @@ -1044,6 +1044,8 @@ const result = await norbix.hub.code.invokeCodeFunction({ [↑ Top](#endpoints) + + ## Cloud functions `hub.code.getCodeFunctions`, `getCodeFunctionQualifiers`, `invokeCodeFunction`, `getCodeFunctionEventSample` and `getCodeFunctionRuns` above are the Hub side: the functions a Code integration may call, their aliases and versions, a call by hand, a sample envelope and the last runs of a trigger or task. @@ -1080,3 +1082,5 @@ for (const run of runs) { // items: marketplace:run:started (meta.input) → marketplace:run:step … → completed | failed | skipped } ``` + + diff --git a/docs/hub/database.md b/docs/hub/database.md index e22fb20..4fe206f 100644 --- a/docs/hub/database.md +++ b/docs/hub/database.md @@ -569,14 +569,6 @@ const result = await norbix.hub.database.applyDatabaseSchemaBundle({ Delete an item. -> **Also drops the schema's records.** Deleting a schema also drops its records -> (its MongoDB collection, with its indexes) in the request environment — in every -> active database integration of that environment. For a schema with AI embed on, -> its records are also removed from the AI knowledge. The delete is **refused** -> (and nothing is dropped) while a saved aggregate or a trigger still uses the -> schema. The request and response shape did not change. A retry is safe -> (idempotent). - **Request DTO**: `CodeMashHub2.DeleteDatabaseSchemaRequest` **Response**: `CodeMashHub2.EmptyResponse` @@ -687,7 +679,7 @@ const result = await norbix.hub.database.getDatabaseSchemaDraft({ `GET` `/{version}/database/schemas/{Id}/index-status` -The last schema-index run of one collection in the request's environment. Norbix creates a published collection's obvious indexes itself — `idx_` per reference field, `uniq_` per `unique` field, `idx___id` for the records list's default sort, at most 8 — on publish, on a default-sort change and on promotion. `status` is `null` before the first run; otherwise `status.state` is `building`, `ready`, `refused` (a database refused `createIndex`) or `partial`, with one entry per database under `status.integrations` (`wanted`, `created`, `dropped`, `overCap`, `refusedReason`). +Fetch a single item by ID. **Request DTO**: `CodeMashHub2.GetDatabaseSchemaIndexStatus` **Response**: `CodeMashHub2.GetDatabaseSchemaIndexStatusResponse` @@ -697,18 +689,11 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const { status } = await norbix.hub.database.getDatabaseSchemaIndexStatus({ - id: 'sch_4kX9mQvR2tYw7ZbC1dFgHj', +const result = await norbix.hub.database.getDatabaseSchemaIndexStatus({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. }); -console.log(status?.state); // 'building' | 'ready' | 'refused' | 'partial' -for (const db of status?.integrations ?? []) { - console.log( - db.integrationId, - db.state, - db.created, - db.overCap.map((i) => i.name), - ); -} +// → typed as CodeMashHub2.GetDatabaseSchemaIndexStatusResponse ``` [↑ Top](#endpoints) @@ -1102,7 +1087,7 @@ const result = await norbix.hub.database.executeRecordsAggregate({ `GET` `/{version}/database/collections/{collectionName}` -Search / paginate items. Takes `expandReferences: true` to read every reference field as `{ id, display }` — see [Reading references](../database-rules.md#reading-references--expandreferences). +Search / paginate items. **Request DTO**: `CodeMashHub2.FindRecords` **Response**: `CodeMashHub2.FindRecordsResponse` @@ -1125,7 +1110,7 @@ const result = await norbix.hub.database.findRecords({ `GET` `/{version}/database/collections/{collectionName}/{id}` -Fetch one record by id. Takes `expandReferences: true` to read every reference field as `{ id, display }` — see [Reading references](../database-rules.md#reading-references--expandreferences). +Search / paginate items. **Request DTO**: `CodeMashHub2.FindOneRecord` **Response**: `CodeMashHub2.FindOneRecordResponse` @@ -1262,7 +1247,7 @@ const result = await norbix.hub.database.seedCollectionRecords({ `PUT` `/{version}/database/collections/{collectionName}/many` -Update an existing item. Keys may be nested paths; `arrayFilters` picks the list elements a `$[name]` path changes — see [Nested documents and arrays](../database-rules.md#nested-documents-and-arrays). +Update an existing item. **Request DTO**: `CodeMashHub2.UpdateManyRecords` **Response**: `CodeMashHub2.EmptyResponse` @@ -1285,7 +1270,7 @@ const result = await norbix.hub.database.updateManyRecords({ `PUT` `/{version}/database/collections/{collectionName}/{id}` -Update an existing item. Keys may be nested paths; `arrayFilters` picks the list elements a `$[name]` path changes — see [Nested documents and arrays](../database-rules.md#nested-documents-and-arrays). +Update an existing item. **Request DTO**: `CodeMashHub2.UpdateOneRecord` **Response**: `CodeMashHub2.EmptyResponse` diff --git a/docs/hub/email.md b/docs/hub/email.md index 4a2274b..1c2c540 100644 --- a/docs/hub/email.md +++ b/docs/hub/email.md @@ -6,58 +6,51 @@ Accessed as `norbix.hub.email` on the [`Norbix`](../../README.md#authentication) ## Endpoints -| Method | Verb | Path | Scope | -| --------------------------------------------------------- | ------ | ---------------------------------------- | ---------- | -| [`getEmailPreferencesByLink`](#getemailpreferencesbylink) | `GET` | `/{version}/email/preferences` | `optional` | -| [`oneClickUnsubscribe`](#oneclickunsubscribe) | `POST` | `/{version}/email/one-click-unsubscribe` | `optional` | +| Method | Verb | Path | Scope | +| --------------------------------------------------------- | ------ | ---------------------------------------- | --------- | +| [`oneClickUnsubscribe`](#oneclickunsubscribe) | `POST` | `/{version}/email/one-click-unsubscribe` | `project` | +| [`getEmailPreferencesByLink`](#getemailpreferencesbylink) | `GET` | `/{version}/email/preferences` | `project` | ## Reference -### getEmailPreferencesByLink - -`GET` `/{version}/email/preferences` +### oneClickUnsubscribe -Reads the marketing e-mail preferences of the person a signed unsubscribe link -belongs to. Pass the `token` from the e-mail's Preferences or Unsubscribe link. -No sign-in is needed — the signed token is the key — so the call works on a -client with no `apiKey` / `bearerToken` (scope `optional`: a token is sent only -when the client has one). +`POST` `/{version}/email/one-click-unsubscribe` -**Request DTO**: `CodeMashHub2.GetEmailPreferencesByLinkRequest` -**Response**: `CodeMashHub2.GetEmailPreferencesByLinkResponse` +**Request DTO**: `CodeMashHub2.OneClickUnsubscribeRequest` +**Response**: `CodeMashHub2.EmptyResponse` ```ts import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const result = await norbix.hub.email.getEmailPreferencesByLink({ - token: 'token-from-the-link', +const result = await norbix.hub.email.oneClickUnsubscribe({ + // See CodeMash type for the full request shape. }); -// result.item → { emailAddress, unsubscribedFromMarketing, blockReasons } +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) -### oneClickUnsubscribe +### getEmailPreferencesByLink -`POST` `/{version}/email/one-click-unsubscribe` +`GET` `/{version}/email/preferences` -Public one-click unsubscribe from a signed e-mail link. No sign-in is needed -(scope `optional`: a token is sent only when the client has one). +Fetch a single item by ID. -**Request DTO**: `CodeMashHub2.OneClickUnsubscribeRequest` -**Response**: `CodeMashHub2.EmptyResponse` +**Request DTO**: `CodeMashHub2.GetEmailPreferencesByLinkRequest` +**Response**: `CodeMashHub2.GetEmailPreferencesByLinkResponse` ```ts import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const result = await norbix.hub.email.oneClickUnsubscribe({ +const result = await norbix.hub.email.getEmailPreferencesByLink({ // See CodeMash type for the full request shape. }); -// → typed as CodeMashHub2.EmptyResponse +// → typed as CodeMashHub2.GetEmailPreferencesByLinkResponse ``` [↑ Top](#endpoints) diff --git a/docs/hub/files.md b/docs/hub/files.md index 25a9ac9..97e6341 100644 --- a/docs/hub/files.md +++ b/docs/hub/files.md @@ -33,6 +33,7 @@ Accessed as `norbix.hub.files` on the [`Norbix`](../../README.md#authentication) | [`getFile`](#getfile) | `GET` | `/{version}/files/item` | `project` | | [`getFileById`](#getfilebyid) | `GET` | `/{version}/files/item/by-id` | `project` | | [`getFolderFiles`](#getfolderfiles) | `GET` | `/{version}/files/folder` | `project` | +| [`useFile`](#usefile) | `POST` | `/{version}/files/item/use` | `project` | ## Reference @@ -501,7 +502,7 @@ const result = await norbix.hub.files.getFile({ `GET` `/{version}/files/item/by-id` -Fetch one file by its stable id (`filesIntegrationId` + `id` in the query) — the id a file field on a record stores. Same answer shape as the API call: `file`, `isPublic`, `publicUrl`. +Fetch a single item by ID. **Request DTO**: `CodeMashHub2.GetFileById` **Response**: `CodeMashHub2.GetFileByIdResponse` @@ -512,8 +513,7 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); const result = await norbix.hub.files.getFileById({ - filesIntegrationId: 'filesIntegrationId-here', - id: 'id-here', + // See CodeMash type for the full request shape. }); // → typed as CodeMashHub2.GetFileByIdResponse ``` @@ -541,3 +541,23 @@ const result = await norbix.hub.files.getFolderFiles({ ``` [↑ Top](#endpoints) + +### useFile + +`POST` `/{version}/files/item/use` + +**Request DTO**: `CodeMashHub2.UseFileRequest` +**Response**: `CodeMashHub2.IdResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.files.useFile({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.IdResponse +``` + +[↑ Top](#endpoints) diff --git a/docs/hub/logs.md b/docs/hub/logs.md index 5a95016..1679dc1 100644 --- a/docs/hub/logs.md +++ b/docs/hub/logs.md @@ -275,12 +275,7 @@ const result = await norbix.hub.logs.getLogsByCorrelationId({ `GET` `/{version}/logs` -List the project's log entries, one page at a time. Every filter goes in the -query string: `level`, `module`, `logCorrelationId`, `eventCode`, `search`, -`fromUtc`, `toUtc`, and `metaKey` + `metaValue` — only entries whose `meta` -holds that key with that value (e.g. `metaKey: 'taskId'` for one scheduler -task's runs). `metaKey` is letters, digits and `_` only, and always comes with -`metaValue`. +Fetch a single item by ID. **Request DTO**: `CodeMashHub2.GetLogs` **Response**: `CodeMashHub2.GetLogsResponse` @@ -290,11 +285,8 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -// Every logged run of one scheduler task const result = await norbix.hub.logs.getLogs({ - module: 'Scheduler', - metaKey: 'taskId', - metaValue: 'tsk_123', + // See CodeMash type for the full request shape. }); // → typed as CodeMashHub2.GetLogsResponse ``` diff --git a/docs/hub/membership.md b/docs/hub/membership.md index 51aee70..338bfac 100644 --- a/docs/hub/membership.md +++ b/docs/hub/membership.md @@ -12,6 +12,8 @@ Accessed as `norbix.hub.membership` on the [`Norbix`](../../README.md#authentica | ------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------- | --------- | | [`disableMembership`](#disablemembership) | `PUT` | `/{version}/membership/disable` | `project` | | [`enableMembership`](#enablemembership) | `PUT` | `/{version}/membership/enable` | `project` | +| [`importUsers`](#importusers) | `POST` | `/{version}/membership/users/import` | `project` | +| [`repairLoginProjectIds`](#repairloginprojectids) | `POST` | `/{version}/membership/users/repair-logins` | `project` | | [`issueServiceUserApiKey`](#issueserviceuserapikey) | `POST` | `/{version}/membership/users/{Id}/api-keys` | `project` | | [`listServiceUserApiKeys`](#listserviceuserapikeys) | `GET` | `/{version}/membership/users/{Id}/api-keys` | `project` | | [`deleteServiceUserApiKey`](#deleteserviceuserapikey) | `DELETE` | `/{version}/membership/users/{Id}/api-keys/{KeyId}` | `project` | @@ -45,11 +47,13 @@ Accessed as `norbix.hub.membership` on the [`Norbix`](../../README.md#authentica | [`updatePasswordComplexity`](#updatepasswordcomplexity) | `PUT` | `/{version}/membership/authorization/password-complexity` | `project` | | [`getAuthenticationSettings`](#getauthenticationsettings) | `GET` | `/{version}/membership/authentication` | `project` | | [`updateAuthenticationSettings`](#updateauthenticationsettings) | `PUT` | `/{version}/membership/authentication` | `project` | +| [`setUserAiPlan`](#setuseraiplan) | `PUT` | `/{version}/membership/users/{userId}/ai-plan` | `project` | | [`createContact`](#createcontact) | `POST` | `/{version}/membership/users` | `project` | | [`deleteContact`](#deletecontact) | `DELETE` | `/{version}/membership/users/{contactId}` | `project` | | [`getContact`](#getcontact) | `GET` | `/{version}/membership/users/{contactId}` | `project` | | [`getAllContacts`](#getallcontacts) | `GET` | `/{version}/membership/users` | `project` | | [`mergeContacts`](#mergecontacts) | `POST` | `/{version}/membership/users/merge` | `project` | +| [`repairContactRoles`](#repaircontactroles) | `POST` | `/{version}/membership/users/repair-roles` | `project` | | [`updateContact`](#updatecontact) | `PATCH` | `/{version}/membership/users/{contactId}` | `project` | | [`addContactIdentity`](#addcontactidentity) | `POST` | `/{version}/membership/users/{contactId}/identities` | `project` | | [`promoteContactIdentity`](#promotecontactidentity) | `POST` | `/{version}/membership/users/{contactId}/identities/{authId}/promote` | `project` | @@ -101,6 +105,46 @@ const result = await norbix.hub.membership.enableMembership({ [↑ Top](#endpoints) +### importUsers + +`POST` `/{version}/membership/users/import` + +**Request DTO**: `CodeMashHub2.ImportUsersRequest` +**Response**: `CodeMashHub2.ImportUsersResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.membership.importUsers({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.ImportUsersResponse +``` + +[↑ Top](#endpoints) + +### repairLoginProjectIds + +`POST` `/{version}/membership/users/repair-logins` + +**Request DTO**: `CodeMashHub2.RepairLoginProjectIdsRequest` +**Response**: `CodeMashHub2.RepairLoginProjectIdsResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.membership.repairLoginProjectIds({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.RepairLoginProjectIdsResponse +``` + +[↑ Top](#endpoints) + ### issueServiceUserApiKey `POST` `/{version}/membership/users/{Id}/api-keys` @@ -836,6 +880,27 @@ const result = await norbix.hub.membership.updateAuthenticationSettings({ [↑ Top](#endpoints) +### setUserAiPlan + +`PUT` `/{version}/membership/users/{userId}/ai-plan` + +**Request DTO**: `CodeMashHub2.SetUserAiPlan` +**Response**: `CodeMashHub2.EmptyResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.membership.setUserAiPlan({ + userId: 'userId-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse +``` + +[↑ Top](#endpoints) + ### createContact `POST` `/{version}/membership/users` @@ -946,6 +1011,26 @@ const result = await norbix.hub.membership.mergeContacts({ [↑ Top](#endpoints) +### repairContactRoles + +`POST` `/{version}/membership/users/repair-roles` + +**Request DTO**: `CodeMashHub2.RepairContactRolesRequest` +**Response**: `CodeMashHub2.RepairContactRolesResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.membership.repairContactRoles({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.RepairContactRolesResponse +``` + +[↑ Top](#endpoints) + ### updateContact `PATCH` `/{version}/membership/users/{contactId}` diff --git a/docs/hub/notifications.md b/docs/hub/notifications.md index 2361fd6..c41dbeb 100644 --- a/docs/hub/notifications.md +++ b/docs/hub/notifications.md @@ -8,135 +8,157 @@ Accessed as `norbix.hub.notifications` on the [`Norbix`](../../README.md#authent ## Endpoints -| Method | Verb | Path | Scope | -| ------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------- | --------- | -| [`disableEmail`](#disableemail) | `PUT` | `/{version}/notifications/email/disable` | `project` | -| [`getEmailDisableDependencies`](#getemaildisabledependencies) | `GET` | `/{version}/notifications/email/disable-dependencies` | `project` | -| [`enableEmail`](#enableemail) | `PUT` | `/{version}/notifications/email/enable` | `project` | -| [`saveEmailValidationIntegration`](#saveemailvalidationintegration) | `POST` | `/{version}/notifications/email/validation/integrations` | `project` | -| [`testEmailValidationIntegration`](#testemailvalidationintegration) | `POST` | `/{version}/notifications/email/validation/integrations/test` | `project` | -| [`attachFileToTemplate`](#attachfiletotemplate) | `POST` | `/{version}/notifications/email/templates/attachments` | `project` | -| [`createEmailTemplate`](#createemailtemplate) | `POST` | `/{version}/notifications/email/templates` | `project` | -| [`deleteEmailTemplate`](#deleteemailtemplate) | `DELETE` | `/{version}/notifications/email/templates/{Id}` | `project` | -| [`getEmailTemplate`](#getemailtemplate) | `GET` | `/{version}/notifications/email/templates/{id}` | `project` | -| [`getEmailTemplates`](#getemailtemplates) | `GET` | `/{version}/notifications/email/templates` | `project` | -| [`getMjml`](#getmjml) | `POST` | `/{version}/notifications/email/templates/mjml` | `project` | -| [`getSystemEmailTemplate`](#getsystememailtemplate) | `GET` | `/{version}/notifications/email/system-templates/{id}` | `project` | -| [`getSystemEmailTemplates`](#getsystememailtemplates) | `GET` | `/{version}/notifications/email/system-templates` | `project` | -| [`getEmailTemplateAvailableTokens`](#getemailtemplateavailabletokens) | `GET` | `/{version}/notifications/email/templates/{id}/tokens` | `project` | -| [`updateEmailTemplate`](#updateemailtemplate) | `PUT` | `/{version}/notifications/email/templates` | `project` | -| [`deleteEmailSignature`](#deleteemailsignature) | `DELETE` | `/{version}/notifications/email/signatures/{id}` | `project` | -| [`getEmailSignature`](#getemailsignature) | `GET` | `/{version}/notifications/email/signatures/{id}` | `project` | -| [`getEmailSignatures`](#getemailsignatures) | `GET` | `/{version}/notifications/email/signatures` | `project` | -| [`saveEmailSignature`](#saveemailsignature) | `POST` | `/{version}/notifications/email/signatures` | `project` | -| [`getEmailSettings`](#getemailsettings) | `GET` | `/{version}/notifications/email/settings` | `project` | -| [`confirmEmailIntegrationHumanDelivery`](#confirmemailintegrationhumandelivery) | `POST` | `/{version}/notifications/email/integrations/confirm-human-delivery` | `project` | -| [`deleteEmailIntegration`](#deleteemailintegration) | `DELETE` | `/{version}/notifications/email/integrations/{Id}` | `project` | -| [`disableEmailIntegration`](#disableemailintegration) | `PUT` | `/{version}/notifications/email/integrations/{Id}/disable` | `project` | -| [`checkEmailIntegrationDomainHealth`](#checkemailintegrationdomainhealth) | `POST` | `/{version}/notifications/email/integrations/domain-health` | `project` | -| [`enableEmailIntegration`](#enableemailintegration) | `PUT` | `/{version}/notifications/email/integrations/{Id}/enable` | `project` | -| [`getEmailIntegration`](#getemailintegration) | `GET` | `/{version}/notifications/email/integrations/{id}` | `project` | -| [`getEmailIntegrations`](#getemailintegrations) | `GET` | `/{version}/notifications/email/integrations` | `project` | -| [`saveEmailIntegration`](#saveemailintegration) | `POST` | `/{version}/notifications/email/integrations` | `project` | -| [`setEmailsIntegrationAsDefault`](#setemailsintegrationasdefault) | `PUT` | `/{version}/notifications/email/integrations/{Id}/default` | `project` | -| [`testEmailIntegration`](#testemailintegration) | `POST` | `/{version}/notifications/email/integrations/test` | `project` | -| [`archiveEmailTemplate`](#archiveemailtemplate) | `PUT` | `/{version}/notifications/email/templates/{Id}/archive` | `project` | -| [`cloneEmailTemplate`](#cloneemailtemplate) | `POST` | `/{version}/notifications/email/templates/{Id}/clone` | `project` | -| [`unArchiveEmailTemplate`](#unarchiveemailtemplate) | `PUT` | `/{version}/notifications/email/templates/{Id}/unarchive` | `project` | -| [`deleteEmailFooter`](#deleteemailfooter) | `DELETE` | `/{version}/notifications/email/footers/{id}` | `project` | -| [`getEmailFooter`](#getemailfooter) | `GET` | `/{version}/notifications/email/footers/{id}` | `project` | -| [`getEmailFooters`](#getemailfooters) | `GET` | `/{version}/notifications/email/footers` | `project` | -| [`saveEmailFooter`](#saveemailfooter) | `POST` | `/{version}/notifications/email/footers` | `project` | -| [`createEmailCampaign`](#createemailcampaign) | `POST` | `/{version}/notifications/email/campaigns` | `project` | -| [`deleteEmailCampaign`](#deleteemailcampaign) | `DELETE` | `/{version}/notifications/email/campaigns/{Id}` | `project` | -| [`getEmailCampaign`](#getemailcampaign) | `GET` | `/{version}/notifications/email/campaigns/{id}` | `project` | -| [`getEmailCampaigns`](#getemailcampaigns) | `GET` | `/{version}/notifications/email/campaigns` | `project` | -| [`getEmailCampaignBatches`](#getemailcampaignbatches) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches` | `project` | -| [`getEmailCampaignBatchNotification`](#getemailcampaignbatchnotification) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | -| [`getEmailCampaignBatchNotifications`](#getemailcampaignbatchnotifications) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches/{batchId}` | `project` | -| [`getEmailCampaignStatistics`](#getemailcampaignstatistics) | `GET` | `/{version}/notifications/email/campaigns/{id}/stats` | `project` | -| [`previewEmailNotification`](#previewemailnotification) | `GET` | `/{version}/notifications/email/preview` | `project` | -| [`stopEmailCampaign`](#stopemailcampaign) | `POST` | `/{version}/notifications/email/campaigns/{Id}/stop` | `project` | -| [`getEmailCampaignMessages`](#getemailcampaignmessages) | `GET` | `/{version}/notifications/emails/campaigns/{campaignId}/messages` | `project` | -| [`disableSms`](#disablesms) | `PUT` | `/{version}/notifications/sms/disable` | `project` | -| [`getSmsDisableDependencies`](#getsmsdisabledependencies) | `GET` | `/{version}/notifications/sms/disable-dependencies` | `project` | -| [`enableSms`](#enablesms) | `PUT` | `/{version}/notifications/sms/enable` | `project` | -| [`archiveSmsTemplate`](#archivesmstemplate) | `PUT` | `/{version}/notifications/sms/templates/{Id}/archive` | `project` | -| [`cloneSmsTemplate`](#clonesmstemplate) | `POST` | `/{version}/notifications/sms/templates/{Id}/clone` | `project` | -| [`createSmsTemplate`](#createsmstemplate) | `POST` | `/{version}/notifications/sms/templates` | `project` | -| [`deleteSmsTemplate`](#deletesmstemplate) | `DELETE` | `/{version}/notifications/sms/templates/{Id}` | `project` | -| [`getSmsTemplate`](#getsmstemplate) | `GET` | `/{version}/notifications/sms/templates/{id}` | `project` | -| [`getSmsTemplates`](#getsmstemplates) | `GET` | `/{version}/notifications/sms/templates` | `project` | -| [`getSmsMessageContentTokens`](#getsmsmessagecontenttokens) | `GET` | `/{version}/notifications/sms/templates/{id}/tokens` | `project` | -| [`renderSms`](#rendersms) | `POST` | `/{version}/notifications/sms/templates/render` | `project` | -| [`unArchiveSmsTemplate`](#unarchivesmstemplate) | `PUT` | `/{version}/notifications/sms/templates/{Id}/unarchive` | `project` | -| [`updateSmsTemplate`](#updatesmstemplate) | `PUT` | `/{version}/notifications/sms/templates` | `project` | -| [`getSmsSettings`](#getsmssettings) | `GET` | `/{version}/notifications/sms/settings` | `project` | -| [`confirmSmsIntegrationHumanDelivery`](#confirmsmsintegrationhumandelivery) | `POST` | `/{version}/notifications/sms/integrations/confirm-human-delivery` | `project` | -| [`deleteSmsIntegration`](#deletesmsintegration) | `DELETE` | `/{version}/notifications/sms/integrations/{Id}` | `project` | -| [`disableSmsIntegration`](#disablesmsintegration) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/disable` | `project` | -| [`enableSmsIntegration`](#enablesmsintegration) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/enable` | `project` | -| [`getSmsIntegration`](#getsmsintegration) | `GET` | `/{version}/notifications/sms/integrations/{id}` | `project` | -| [`getSmsIntegrations`](#getsmsintegrations) | `GET` | `/{version}/notifications/sms/integrations` | `project` | -| [`saveSmsIntegration`](#savesmsintegration) | `POST` | `/{version}/notifications/sms/integrations` | `project` | -| [`setSmsIntegrationAsDefault`](#setsmsintegrationasdefault) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/default` | `project` | -| [`testSmsIntegration`](#testsmsintegration) | `POST` | `/{version}/notifications/sms/integrations/test` | `project` | -| [`createSmsCampaign`](#createsmscampaign) | `POST` | `/{version}/notifications/sms/campaigns` | `project` | -| [`deleteSmsCampaign`](#deletesmscampaign) | `DELETE` | `/{version}/notifications/sms/campaigns/{id}` | `project` | -| [`getSmsCampaign`](#getsmscampaign) | `GET` | `/{version}/notifications/sms/campaigns/{id}` | `project` | -| [`getSmsCampaigns`](#getsmscampaigns) | `GET` | `/{version}/notifications/sms/campaigns` | `project` | -| [`getSmsCampaignBatches`](#getsmscampaignbatches) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches` | `project` | -| [`getSmsCampaignBatchNotification`](#getsmscampaignbatchnotification) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | -| [`getSmsCampaignBatchNotifications`](#getsmscampaignbatchnotifications) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches/{batchId}` | `project` | -| [`getSmsCampaignStatistics`](#getsmscampaignstatistics) | `GET` | `/{version}/notifications/sms/campaigns/{id}/stats` | `project` | -| [`previewSmsNotification`](#previewsmsnotification) | `GET` | `/{version}/notifications/sms/preview` | `project` | -| [`stopSmsCampaign`](#stopsmscampaign) | `POST` | `/{version}/notifications/sms/campaigns/{Id}/stop` | `project` | -| [`getSmsCampaignMessages`](#getsmscampaignmessages) | `GET` | `/{version}/notifications/sms/campaigns/{campaignId}/messages` | `project` | -| [`disablePush`](#disablepush) | `PUT` | `/{version}/notifications/push/disable` | `project` | -| [`getPushDisableDependencies`](#getpushdisabledependencies) | `GET` | `/{version}/notifications/push/disable-dependencies` | `project` | -| [`enablePush`](#enablepush) | `PUT` | `/{version}/notifications/push/enable` | `project` | -| [`archivePushTemplate`](#archivepushtemplate) | `PUT` | `/{version}/notifications/push/templates/{Id}/archive` | `project` | -| [`clonePushTemplate`](#clonepushtemplate) | `POST` | `/{version}/notifications/push/templates/{Id}/clone` | `project` | -| [`createPushTemplate`](#createpushtemplate) | `POST` | `/{version}/notifications/push/templates` | `project` | -| [`deletePushTemplate`](#deletepushtemplate) | `DELETE` | `/{version}/notifications/push/templates/{Id}` | `project` | -| [`getPushTemplate`](#getpushtemplate) | `GET` | `/{version}/notifications/push/templates/{id}` | `project` | -| [`getPushTemplates`](#getpushtemplates) | `GET` | `/{version}/notifications/push/templates` | `project` | -| [`getPushMessageContentTokens`](#getpushmessagecontenttokens) | `GET` | `/{version}/notifications/push/templates/{id}/tokens` | `project` | -| [`renderPush`](#renderpush) | `POST` | `/{version}/notifications/push/templates/render` | `project` | -| [`unArchivePushTemplate`](#unarchivepushtemplate) | `PUT` | `/{version}/notifications/push/templates/{Id}/unarchive` | `project` | -| [`updatePushTemplate`](#updatepushtemplate) | `PUT` | `/{version}/notifications/push/templates` | `project` | -| [`getPushSettings`](#getpushsettings) | `GET` | `/{version}/notifications/push/settings` | `project` | -| [`confirmPushIntegrationHumanDelivery`](#confirmpushintegrationhumandelivery) | `POST` | `/{version}/notifications/push/integrations/confirm-human-delivery` | `project` | -| [`deletePushIntegration`](#deletepushintegration) | `DELETE` | `/{version}/notifications/push/integrations/{Id}` | `project` | -| [`disablePushIntegration`](#disablepushintegration) | `PUT` | `/{version}/notifications/push/integrations/{Id}/disable` | `project` | -| [`enablePushIntegration`](#enablepushintegration) | `PUT` | `/{version}/notifications/push/integrations/{Id}/enable` | `project` | -| [`getPushIntegration`](#getpushintegration) | `GET` | `/{version}/notifications/push/integrations/{id}` | `project` | -| [`getPushIntegrations`](#getpushintegrations) | `GET` | `/{version}/notifications/push/integrations` | `project` | -| [`savePushIntegration`](#savepushintegration) | `POST` | `/{version}/notifications/push/integrations` | `project` | -| [`setPushIntegrationAsDefault`](#setpushintegrationasdefault) | `PUT` | `/{version}/notifications/push/integrations/{Id}/default` | `project` | -| [`testPushIntegration`](#testpushintegration) | `POST` | `/{version}/notifications/push/integrations/test` | `project` | -| [`registerDevice`](#registerdevice) | `POST` | `/{version}/notifications/push/devices` | `project` | -| [`getPushDevice`](#getpushdevice) | `GET` | `/{version}/notifications/push/devices/{id}` | `project` | -| [`getPushDevices`](#getpushdevices) | `GET` | `/{version}/notifications/push/devices` | `project` | -| [`getPushCampaignAudienceCount`](#getpushcampaignaudiencecount) | `POST` | `/{version}/notifications/push/campaigns/audience-count` | `project` | -| [`createPushCampaign`](#createpushcampaign) | `POST` | `/{version}/notifications/push/campaigns` | `project` | -| [`deletePushCampaign`](#deletepushcampaign) | `DELETE` | `/{version}/notifications/push/campaigns/{Id}` | `project` | -| [`getPushCampaign`](#getpushcampaign) | `GET` | `/{version}/notifications/push/campaigns/{id}` | `project` | -| [`getPushCampaigns`](#getpushcampaigns) | `GET` | `/{version}/notifications/push/campaigns` | `project` | -| [`getPushCampaignBatches`](#getpushcampaignbatches) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches` | `project` | -| [`getPushCampaignBatchNotification`](#getpushcampaignbatchnotification) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | -| [`getPushCampaignBatchNotifications`](#getpushcampaignbatchnotifications) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches/{batchId}` | `project` | -| [`getPushCampaignStatistics`](#getpushcampaignstatistics) | `GET` | `/{version}/notifications/push/campaigns/{id}/stats` | `project` | -| [`previewPushNotification`](#previewpushnotification) | `GET` | `/{version}/notifications/push/preview` | `project` | -| [`stopPushCampaign`](#stoppushcampaign) | `POST` | `/{version}/notifications/push/campaigns/{Id}/stop` | `project` | -| [`getPushCampaignMessages`](#getpushcampaignmessages) | `GET` | `/{version}/notifications/push/campaigns/{campaignId}/messages` | `project` | -| [`getUserNotificationPreferences`](#getusernotificationpreferences) | `GET` | `/{version}/notifications/user/preferences` | `project` | -| [`updateUserNotificationsPreferences`](#updateusernotificationspreferences) | `PUT` | `/{version}/notifications/user/preferences` | `project` | -| [`grantContactConsent`](#grantcontactconsent) | `POST` | `/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent` | `project` | -| [`unsubscribeContact`](#unsubscribecontact) | `POST` | `/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe` | `project` | +| Method | Verb | Path | Scope | +| ------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------- | --------- | +| [`createSmsCampaign`](#createsmscampaign) | `POST` | `/{version}/notifications/sms/campaigns` | `project` | +| [`disableEmail`](#disableemail) | `PUT` | `/{version}/notifications/email/disable` | `project` | +| [`getEmailDisableDependencies`](#getemaildisabledependencies) | `GET` | `/{version}/notifications/email/disable-dependencies` | `project` | +| [`enableEmail`](#enableemail) | `PUT` | `/{version}/notifications/email/enable` | `project` | +| [`saveEmailValidationIntegration`](#saveemailvalidationintegration) | `POST` | `/{version}/notifications/email/validation/integrations` | `project` | +| [`testEmailValidationIntegration`](#testemailvalidationintegration) | `POST` | `/{version}/notifications/email/validation/integrations/test` | `project` | +| [`attachFileToTemplate`](#attachfiletotemplate) | `POST` | `/{version}/notifications/email/templates/attachments` | `project` | +| [`createEmailTemplate`](#createemailtemplate) | `POST` | `/{version}/notifications/email/templates` | `project` | +| [`deleteEmailTemplate`](#deleteemailtemplate) | `DELETE` | `/{version}/notifications/email/templates/{Id}` | `project` | +| [`getEmailTemplate`](#getemailtemplate) | `GET` | `/{version}/notifications/email/templates/{id}` | `project` | +| [`getEmailTemplates`](#getemailtemplates) | `GET` | `/{version}/notifications/email/templates` | `project` | +| [`getMjml`](#getmjml) | `POST` | `/{version}/notifications/email/templates/mjml` | `project` | +| [`getSystemEmailTemplate`](#getsystememailtemplate) | `GET` | `/{version}/notifications/email/system-templates/{id}` | `project` | +| [`getSystemEmailTemplates`](#getsystememailtemplates) | `GET` | `/{version}/notifications/email/system-templates` | `project` | +| [`getEmailTemplateAvailableTokens`](#getemailtemplateavailabletokens) | `GET` | `/{version}/notifications/email/templates/{id}/tokens` | `project` | +| [`updateEmailTemplate`](#updateemailtemplate) | `PUT` | `/{version}/notifications/email/templates` | `project` | +| [`deleteEmailSignature`](#deleteemailsignature) | `DELETE` | `/{version}/notifications/email/signatures/{id}` | `project` | +| [`getEmailSignature`](#getemailsignature) | `GET` | `/{version}/notifications/email/signatures/{id}` | `project` | +| [`getEmailSignatures`](#getemailsignatures) | `GET` | `/{version}/notifications/email/signatures` | `project` | +| [`saveEmailSignature`](#saveemailsignature) | `POST` | `/{version}/notifications/email/signatures` | `project` | +| [`getEmailSettings`](#getemailsettings) | `GET` | `/{version}/notifications/email/settings` | `project` | +| [`confirmEmailIntegrationHumanDelivery`](#confirmemailintegrationhumandelivery) | `POST` | `/{version}/notifications/email/integrations/confirm-human-delivery` | `project` | +| [`deleteEmailIntegration`](#deleteemailintegration) | `DELETE` | `/{version}/notifications/email/integrations/{Id}` | `project` | +| [`disableEmailIntegration`](#disableemailintegration) | `PUT` | `/{version}/notifications/email/integrations/{Id}/disable` | `project` | +| [`checkEmailIntegrationDomainHealth`](#checkemailintegrationdomainhealth) | `POST` | `/{version}/notifications/email/integrations/domain-health` | `project` | +| [`enableEmailIntegration`](#enableemailintegration) | `PUT` | `/{version}/notifications/email/integrations/{Id}/enable` | `project` | +| [`getEmailIntegration`](#getemailintegration) | `GET` | `/{version}/notifications/email/integrations/{id}` | `project` | +| [`getEmailIntegrations`](#getemailintegrations) | `GET` | `/{version}/notifications/email/integrations` | `project` | +| [`saveEmailIntegration`](#saveemailintegration) | `POST` | `/{version}/notifications/email/integrations` | `project` | +| [`setEmailsIntegrationAsDefault`](#setemailsintegrationasdefault) | `PUT` | `/{version}/notifications/email/integrations/{Id}/default` | `project` | +| [`testEmailIntegration`](#testemailintegration) | `POST` | `/{version}/notifications/email/integrations/test` | `project` | +| [`archiveEmailTemplate`](#archiveemailtemplate) | `PUT` | `/{version}/notifications/email/templates/{Id}/archive` | `project` | +| [`cloneEmailTemplate`](#cloneemailtemplate) | `POST` | `/{version}/notifications/email/templates/{Id}/clone` | `project` | +| [`unArchiveEmailTemplate`](#unarchiveemailtemplate) | `PUT` | `/{version}/notifications/email/templates/{Id}/unarchive` | `project` | +| [`deleteEmailFooter`](#deleteemailfooter) | `DELETE` | `/{version}/notifications/email/footers/{id}` | `project` | +| [`getEmailFooter`](#getemailfooter) | `GET` | `/{version}/notifications/email/footers/{id}` | `project` | +| [`getEmailFooters`](#getemailfooters) | `GET` | `/{version}/notifications/email/footers` | `project` | +| [`saveEmailFooter`](#saveemailfooter) | `POST` | `/{version}/notifications/email/footers` | `project` | +| [`createEmailCampaign`](#createemailcampaign) | `POST` | `/{version}/notifications/email/campaigns` | `project` | +| [`deleteEmailCampaign`](#deleteemailcampaign) | `DELETE` | `/{version}/notifications/email/campaigns/{Id}` | `project` | +| [`getEmailCampaign`](#getemailcampaign) | `GET` | `/{version}/notifications/email/campaigns/{id}` | `project` | +| [`getEmailCampaigns`](#getemailcampaigns) | `GET` | `/{version}/notifications/email/campaigns` | `project` | +| [`getEmailCampaignBatches`](#getemailcampaignbatches) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches` | `project` | +| [`getEmailCampaignBatchNotification`](#getemailcampaignbatchnotification) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | +| [`getEmailCampaignBatchNotifications`](#getemailcampaignbatchnotifications) | `GET` | `/{version}/notifications/email/campaigns/{id}/batches/{batchId}` | `project` | +| [`getEmailCampaignStatistics`](#getemailcampaignstatistics) | `GET` | `/{version}/notifications/email/campaigns/{id}/stats` | `project` | +| [`previewEmailNotification`](#previewemailnotification) | `GET` | `/{version}/notifications/email/preview` | `project` | +| [`stopEmailCampaign`](#stopemailcampaign) | `POST` | `/{version}/notifications/email/campaigns/{Id}/stop` | `project` | +| [`getEmailCampaignMessages`](#getemailcampaignmessages) | `GET` | `/{version}/notifications/emails/campaigns/{campaignId}/messages` | `project` | +| [`disableSms`](#disablesms) | `PUT` | `/{version}/notifications/sms/disable` | `project` | +| [`getSmsDisableDependencies`](#getsmsdisabledependencies) | `GET` | `/{version}/notifications/sms/disable-dependencies` | `project` | +| [`enableSms`](#enablesms) | `PUT` | `/{version}/notifications/sms/enable` | `project` | +| [`archiveSmsTemplate`](#archivesmstemplate) | `PUT` | `/{version}/notifications/sms/templates/{Id}/archive` | `project` | +| [`cloneSmsTemplate`](#clonesmstemplate) | `POST` | `/{version}/notifications/sms/templates/{Id}/clone` | `project` | +| [`createSmsTemplate`](#createsmstemplate) | `POST` | `/{version}/notifications/sms/templates` | `project` | +| [`deleteSmsTemplate`](#deletesmstemplate) | `DELETE` | `/{version}/notifications/sms/templates/{Id}` | `project` | +| [`getSmsTemplate`](#getsmstemplate) | `GET` | `/{version}/notifications/sms/templates/{id}` | `project` | +| [`getSmsTemplates`](#getsmstemplates) | `GET` | `/{version}/notifications/sms/templates` | `project` | +| [`getSmsMessageContentTokens`](#getsmsmessagecontenttokens) | `GET` | `/{version}/notifications/sms/templates/{id}/tokens` | `project` | +| [`renderSms`](#rendersms) | `POST` | `/{version}/notifications/sms/templates/render` | `project` | +| [`unArchiveSmsTemplate`](#unarchivesmstemplate) | `PUT` | `/{version}/notifications/sms/templates/{Id}/unarchive` | `project` | +| [`updateSmsTemplate`](#updatesmstemplate) | `PUT` | `/{version}/notifications/sms/templates` | `project` | +| [`getSmsSettings`](#getsmssettings) | `GET` | `/{version}/notifications/sms/settings` | `project` | +| [`confirmSmsIntegrationHumanDelivery`](#confirmsmsintegrationhumandelivery) | `POST` | `/{version}/notifications/sms/integrations/confirm-human-delivery` | `project` | +| [`deleteSmsIntegration`](#deletesmsintegration) | `DELETE` | `/{version}/notifications/sms/integrations/{Id}` | `project` | +| [`disableSmsIntegration`](#disablesmsintegration) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/disable` | `project` | +| [`enableSmsIntegration`](#enablesmsintegration) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/enable` | `project` | +| [`getSmsIntegration`](#getsmsintegration) | `GET` | `/{version}/notifications/sms/integrations/{id}` | `project` | +| [`getSmsIntegrations`](#getsmsintegrations) | `GET` | `/{version}/notifications/sms/integrations` | `project` | +| [`saveSmsIntegration`](#savesmsintegration) | `POST` | `/{version}/notifications/sms/integrations` | `project` | +| [`setSmsIntegrationAsDefault`](#setsmsintegrationasdefault) | `PUT` | `/{version}/notifications/sms/integrations/{Id}/default` | `project` | +| [`testSmsIntegration`](#testsmsintegration) | `POST` | `/{version}/notifications/sms/integrations/test` | `project` | +| [`deleteSmsCampaign`](#deletesmscampaign) | `DELETE` | `/{version}/notifications/sms/campaigns/{id}` | `project` | +| [`getSmsCampaign`](#getsmscampaign) | `GET` | `/{version}/notifications/sms/campaigns/{id}` | `project` | +| [`getSmsCampaigns`](#getsmscampaigns) | `GET` | `/{version}/notifications/sms/campaigns` | `project` | +| [`getSmsCampaignBatches`](#getsmscampaignbatches) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches` | `project` | +| [`getSmsCampaignBatchNotification`](#getsmscampaignbatchnotification) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | +| [`getSmsCampaignBatchNotifications`](#getsmscampaignbatchnotifications) | `GET` | `/{version}/notifications/sms/campaigns/{id}/batches/{batchId}` | `project` | +| [`getSmsCampaignStatistics`](#getsmscampaignstatistics) | `GET` | `/{version}/notifications/sms/campaigns/{id}/stats` | `project` | +| [`previewSmsNotification`](#previewsmsnotification) | `GET` | `/{version}/notifications/sms/preview` | `project` | +| [`stopSmsCampaign`](#stopsmscampaign) | `POST` | `/{version}/notifications/sms/campaigns/{Id}/stop` | `project` | +| [`getSmsCampaignMessages`](#getsmscampaignmessages) | `GET` | `/{version}/notifications/sms/campaigns/{campaignId}/messages` | `project` | +| [`disablePush`](#disablepush) | `PUT` | `/{version}/notifications/push/disable` | `project` | +| [`getPushDisableDependencies`](#getpushdisabledependencies) | `GET` | `/{version}/notifications/push/disable-dependencies` | `project` | +| [`enablePush`](#enablepush) | `PUT` | `/{version}/notifications/push/enable` | `project` | +| [`archivePushTemplate`](#archivepushtemplate) | `PUT` | `/{version}/notifications/push/templates/{Id}/archive` | `project` | +| [`clonePushTemplate`](#clonepushtemplate) | `POST` | `/{version}/notifications/push/templates/{Id}/clone` | `project` | +| [`createPushTemplate`](#createpushtemplate) | `POST` | `/{version}/notifications/push/templates` | `project` | +| [`deletePushTemplate`](#deletepushtemplate) | `DELETE` | `/{version}/notifications/push/templates/{Id}` | `project` | +| [`getPushTemplate`](#getpushtemplate) | `GET` | `/{version}/notifications/push/templates/{id}` | `project` | +| [`getPushTemplates`](#getpushtemplates) | `GET` | `/{version}/notifications/push/templates` | `project` | +| [`getPushMessageContentTokens`](#getpushmessagecontenttokens) | `GET` | `/{version}/notifications/push/templates/{id}/tokens` | `project` | +| [`renderPush`](#renderpush) | `POST` | `/{version}/notifications/push/templates/render` | `project` | +| [`unArchivePushTemplate`](#unarchivepushtemplate) | `PUT` | `/{version}/notifications/push/templates/{Id}/unarchive` | `project` | +| [`updatePushTemplate`](#updatepushtemplate) | `PUT` | `/{version}/notifications/push/templates` | `project` | +| [`getPushSettings`](#getpushsettings) | `GET` | `/{version}/notifications/push/settings` | `project` | +| [`confirmPushIntegrationHumanDelivery`](#confirmpushintegrationhumandelivery) | `POST` | `/{version}/notifications/push/integrations/confirm-human-delivery` | `project` | +| [`deletePushIntegration`](#deletepushintegration) | `DELETE` | `/{version}/notifications/push/integrations/{Id}` | `project` | +| [`disablePushIntegration`](#disablepushintegration) | `PUT` | `/{version}/notifications/push/integrations/{Id}/disable` | `project` | +| [`enablePushIntegration`](#enablepushintegration) | `PUT` | `/{version}/notifications/push/integrations/{Id}/enable` | `project` | +| [`getPushIntegration`](#getpushintegration) | `GET` | `/{version}/notifications/push/integrations/{id}` | `project` | +| [`getPushIntegrations`](#getpushintegrations) | `GET` | `/{version}/notifications/push/integrations` | `project` | +| [`savePushIntegration`](#savepushintegration) | `POST` | `/{version}/notifications/push/integrations` | `project` | +| [`setPushIntegrationAsDefault`](#setpushintegrationasdefault) | `PUT` | `/{version}/notifications/push/integrations/{Id}/default` | `project` | +| [`testPushIntegration`](#testpushintegration) | `POST` | `/{version}/notifications/push/integrations/test` | `project` | +| [`registerDevice`](#registerdevice) | `POST` | `/{version}/notifications/push/devices` | `project` | +| [`getPushDevice`](#getpushdevice) | `GET` | `/{version}/notifications/push/devices/{id}` | `project` | +| [`getPushDevices`](#getpushdevices) | `GET` | `/{version}/notifications/push/devices` | `project` | +| [`getPushCampaignAudienceCount`](#getpushcampaignaudiencecount) | `POST` | `/{version}/notifications/push/campaigns/audience-count` | `project` | +| [`createPushCampaign`](#createpushcampaign) | `POST` | `/{version}/notifications/push/campaigns` | `project` | +| [`deletePushCampaign`](#deletepushcampaign) | `DELETE` | `/{version}/notifications/push/campaigns/{Id}` | `project` | +| [`getPushCampaign`](#getpushcampaign) | `GET` | `/{version}/notifications/push/campaigns/{id}` | `project` | +| [`getPushCampaigns`](#getpushcampaigns) | `GET` | `/{version}/notifications/push/campaigns` | `project` | +| [`getPushCampaignBatches`](#getpushcampaignbatches) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches` | `project` | +| [`getPushCampaignBatchNotification`](#getpushcampaignbatchnotification) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches/{batchId}/{notificationId}` | `project` | +| [`getPushCampaignBatchNotifications`](#getpushcampaignbatchnotifications) | `GET` | `/{version}/notifications/push/campaigns/{id}/batches/{batchId}` | `project` | +| [`getPushCampaignStatistics`](#getpushcampaignstatistics) | `GET` | `/{version}/notifications/push/campaigns/{id}/stats` | `project` | +| [`previewPushNotification`](#previewpushnotification) | `GET` | `/{version}/notifications/push/preview` | `project` | +| [`stopPushCampaign`](#stoppushcampaign) | `POST` | `/{version}/notifications/push/campaigns/{Id}/stop` | `project` | +| [`getPushCampaignMessages`](#getpushcampaignmessages) | `GET` | `/{version}/notifications/push/campaigns/{campaignId}/messages` | `project` | +| [`getUserNotificationPreferences`](#getusernotificationpreferences) | `GET` | `/{version}/notifications/user/preferences` | `project` | +| [`updateUserNotificationsPreferences`](#updateusernotificationspreferences) | `PUT` | `/{version}/notifications/user/preferences` | `project` | +| [`grantContactConsent`](#grantcontactconsent) | `POST` | `/{version}/membership/users/{contactId}/marketing-state/{channel}/consent` | `project` | +| [`unsubscribeContact`](#unsubscribecontact) | `POST` | `/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe` | `project` | ## Reference +### createSmsCampaign + +`POST` `/{version}/notifications/sms/campaigns` + +Create a new item. + +**Request DTO**: `CodeMashHub2.CreateSmsCampaignRequest` +**Response**: `CodeMashHub2.IdResponse` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.notifications.createSmsCampaign({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.IdResponse +``` + +[↑ Top](#endpoints) + ### disableEmail `PUT` `/{version}/notifications/email/disable` @@ -1719,28 +1741,6 @@ const result = await norbix.hub.notifications.testSmsIntegration({ [↑ Top](#endpoints) -### createSmsCampaign - -`POST` `/{version}/notifications/sms/campaigns` - -Create a new item. - -**Request DTO**: `CodeMashHub2.CreateSmsCampaignRequest` -**Response**: `CodeMashHub2.IdResponse` - -```ts -import { Norbix } from '@norbix.ai/ts'; - -const norbix = new Norbix(); - -const result = await norbix.hub.notifications.createSmsCampaign({ - // See CodeMash type for the full request shape. -}); -// → typed as CodeMashHub2.IdResponse -``` - -[↑ Top](#endpoints) - ### deleteSmsCampaign `DELETE` `/{version}/notifications/sms/campaigns/{id}` @@ -2825,6 +2825,8 @@ const result = await norbix.hub.notifications.getPushCampaignMessages({ Fetch a single item by ID. +> **Deprecated.** The Hub route was removed on purpose (gateway 09c43c9ff; it had answered 410 Gone before). Use `norbix.api.membership.getUserPreferences({ id })` — the id is in the path and the answer is `{ preferences }`, so this method cannot be redirected without changing its types. + **Request DTO**: `CodeMashHub2.GetUserNotificationPreferences` **Response**: `CodeMashHub2.GetUserEmailPreferencesResponse` @@ -2847,6 +2849,8 @@ const result = await norbix.hub.notifications.getUserNotificationPreferences({ Update an existing item. +> **Deprecated.** The Hub route was removed on purpose (gateway 09c43c9ff). Use `norbix.api.membership.updateUserPreferences({ id, blockAllMarketingMessages, blockedTags })` — note it takes BLOCKED tags, where this method took subscribed ones. + **Request DTO**: `CodeMashHub2.UpdateUserNotificationsPreferences` **Response**: `CodeMashHub2.EmptyResponse` @@ -2865,7 +2869,9 @@ const result = await norbix.hub.notifications.updateUserNotificationsPreferences ### grantContactConsent -`POST` `/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent` +`POST` `/{version}/membership/users/{contactId}/marketing-state/{channel}/consent` + +> **Deprecated.** The endpoint lives on the API, not the Hub (the Hub route was planned, never built). This method now calls the API route; prefer `norbix.api.membership.grantContactConsent`. **Request DTO**: `CodeMashHub2.GrantContactConsentRequest` **Response**: `CodeMashHub2.EmptyResponse` @@ -2887,7 +2893,9 @@ const result = await norbix.hub.notifications.grantContactConsent({ ### unsubscribeContact -`POST` `/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe` +`POST` `/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe` + +> **Deprecated.** The endpoint lives on the API, not the Hub (the Hub route was planned, never built). This method now calls the API route; prefer `norbix.api.membership.unsubscribeContact`. **Request DTO**: `CodeMashHub2.UnsubscribeContactRequest` **Response**: `CodeMashHub2.EmptyResponse` diff --git a/docs/hub/public.md b/docs/hub/public.md index 324753a..f18717e 100644 --- a/docs/hub/public.md +++ b/docs/hub/public.md @@ -6,13 +6,38 @@ Accessed as `norbix.hub.public` on the [`Norbix`](../../README.md#authentication ## Endpoints -| Method | Verb | Path | Scope | -| --------------------------------------------------- | ----- | ----------------------------------------------------- | --------- | -| [`getPublicProjectConfig`](#getpublicprojectconfig) | `GET` | `/{version}/public/projects/{ProjectId}/config` | `project` | -| [`getPublicProjectLegal`](#getpublicprojectlegal) | `GET` | `/{version}/public/projects/{ProjectId}/legal/{Kind}` | `project` | +| Method | Verb | Path | Scope | +| ----------------------------------------------------------- | ----- | ----------------------------------------------------- | --------- | +| [`getPublicProjectBrandAsset`](#getpublicprojectbrandasset) | `GET` | `/{version}/public/projects/{ProjectId}/brand/{Kind}` | `project` | +| [`getPublicProjectConfig`](#getpublicprojectconfig) | `GET` | `/{version}/public/projects/{ProjectId}/config` | `project` | +| [`getPublicProjectLegal`](#getpublicprojectlegal) | `GET` | `/{version}/public/projects/{ProjectId}/legal/{Kind}` | `project` | ## Reference +### getPublicProjectBrandAsset + +`GET` `/{version}/public/projects/{ProjectId}/brand/{Kind}` + +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetPublicProjectBrandAsset` +**Response**: `CodeMashHub2.Blob` + +```ts +import { Norbix } from '@norbix.ai/ts'; + +const norbix = new Norbix(); + +const result = await norbix.hub.public.getPublicProjectBrandAsset({ + ProjectId: 'ProjectId-here', + Kind: 'Kind-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.Blob +``` + +[↑ Top](#endpoints) + ### getPublicProjectConfig `GET` `/{version}/public/projects/{ProjectId}/config` diff --git a/docs/hub/scheduler.md b/docs/hub/scheduler.md index 8820c4f..372aea3 100644 --- a/docs/hub/scheduler.md +++ b/docs/hub/scheduler.md @@ -4,28 +4,6 @@ Accessed as `norbix.hub.scheduler` on the [`Norbix`](../../README.md#authentication) client. -The scheduler runs a task on a cron schedule. Turn the module on for the project -once (`enableScheduler`), then save tasks. - -Good to know: - -- **Email, SMS and push campaign tasks.** A task sends a campaign (a template - to an audience) each time its cron fires: `type` is `EmailCampaign`, - `SmsCampaign` or `PushCampaign`. Webhook and code tasks (`WebhookCall`, - `CodeFunctionalCall`) exist in the types but the gateway refuses them for now. -- **Cron is 5 fields, in UTC**: `minute hour day-of-month month day-of-week`. - `0 9 * * 1` = every Monday at 09:00 UTC. Tasks have no time zone. -- **`initiatorUserId`** (`usr_…`) is the user the task runs as. It must be the - caller or a service user of the project. -- **Module enable / disable are `PUT`** (they were `GET` before v4.6.0). - Disabling the module stops every task's cron. -- **Task health.** Every task (`getSchedulerTask` item and each - `getSchedulerTasks` row) carries `isFailing`: `true` when its last run failed - or was skipped (any reason but the module being off). `lastFailureReason` - (e.g. `run-failed`, `initiator-not-found`) and `lastFailedAtUnix` (when the - current failing streak started) are set while it is failing. A good run or a - save turns it back to `false`. The runs themselves: `getSchedulerTaskRuns`. - ## Endpoints | Method | Verb | Path | Scope | @@ -36,8 +14,8 @@ Good to know: | [`disableSchedulerTask`](#disableschedulertask) | `PUT` | `/{version}/scheduler/tasks/{Id}/disable` | `project` | | [`enableSchedulerTask`](#enableschedulertask) | `PUT` | `/{version}/scheduler/tasks/{Id}/enable` | `project` | | [`getSchedulerTask`](#getschedulertask) | `GET` | `/{version}/scheduler/tasks/{id}` | `project` | -| [`getSchedulerTaskRuns`](#getschedulertaskruns) | `GET` | `/{version}/scheduler/tasks/{id}/runs` | `project` | | [`getSchedulerTasks`](#getschedulertasks) | `GET` | `/{version}/scheduler/tasks` | `project` | +| [`getSchedulerTaskRuns`](#getschedulertaskruns) | `GET` | `/{version}/scheduler/tasks/{id}/runs` | `project` | | [`saveSchedulerTask`](#saveschedulertask) | `POST` | `/{version}/scheduler/tasks` | `project` | ## Reference @@ -46,8 +24,7 @@ Good to know: `PUT` `/{version}/scheduler/disable` -Turn the scheduler module off for the project. Every task's cron stops. No -request fields. +Disable the resource. **Request DTO**: `CodeMashHub2.DisableScheduler` **Response**: `CodeMashHub2.EmptyResponse` @@ -57,7 +34,10 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -await norbix.hub.scheduler.disableScheduler(); +const result = await norbix.hub.scheduler.disableScheduler({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) @@ -66,7 +46,7 @@ await norbix.hub.scheduler.disableScheduler(); `PUT` `/{version}/scheduler/enable` -Turn the scheduler module on for the project. No request fields. +Enable the resource. **Request DTO**: `CodeMashHub2.EnableScheduler` **Response**: `CodeMashHub2.EmptyResponse` @@ -76,7 +56,10 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -await norbix.hub.scheduler.enableScheduler(); +const result = await norbix.hub.scheduler.enableScheduler({ + // See CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) @@ -85,7 +68,7 @@ await norbix.hub.scheduler.enableScheduler(); `DELETE` `/{version}/scheduler/tasks/{Id}` -Delete a task. `id` goes in the path. +Delete an item. **Request DTO**: `CodeMashHub2.DeleteSchedulerTask` **Response**: `CodeMashHub2.EmptyResponse` @@ -95,7 +78,11 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -await norbix.hub.scheduler.deleteSchedulerTask({ id: 'tsk_123' }); +const result = await norbix.hub.scheduler.deleteSchedulerTask({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) @@ -104,7 +91,7 @@ await norbix.hub.scheduler.deleteSchedulerTask({ id: 'tsk_123' }); `PUT` `/{version}/scheduler/tasks/{Id}/disable` -Stop one task's cron without deleting the task. `id` goes in the path. +Disable the resource. **Request DTO**: `CodeMashHub2.DisableSchedulerTask` **Response**: `CodeMashHub2.EmptyResponse` @@ -114,7 +101,11 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -await norbix.hub.scheduler.disableSchedulerTask({ id: 'tsk_123' }); +const result = await norbix.hub.scheduler.disableSchedulerTask({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) @@ -123,7 +114,7 @@ await norbix.hub.scheduler.disableSchedulerTask({ id: 'tsk_123' }); `PUT` `/{version}/scheduler/tasks/{Id}/enable` -Start one task's cron again. `id` goes in the path. +Enable the resource. **Request DTO**: `CodeMashHub2.EnableSchedulerTask` **Response**: `CodeMashHub2.EmptyResponse` @@ -133,7 +124,11 @@ import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -await norbix.hub.scheduler.enableSchedulerTask({ id: 'tsk_123' }); +const result = await norbix.hub.scheduler.enableSchedulerTask({ + Id: 'Id-here', + // Other fields: see CodeMash type for the full request shape. +}); +// → typed as CodeMashHub2.EmptyResponse ``` [↑ Top](#endpoints) @@ -142,74 +137,21 @@ await norbix.hub.scheduler.enableSchedulerTask({ id: 'tsk_123' }); `GET` `/{version}/scheduler/tasks/{id}` -Fetch one task by id, with its task body. `id` goes in the path. +Fetch a single item by ID. **Request DTO**: `CodeMashHub2.GetSchedulerTask` -**Response**: `CodeMashHub2.GetSchedulerTaskResponse` (`item`) - -```ts -import { Norbix } from '@norbix.ai/ts'; - -const norbix = new Norbix(); - -const { item } = await norbix.hub.scheduler.getSchedulerTask({ id: 'tsk_123' }); -// item: CodeMashHub2.SchedulerTaskDto -if (item?.isFailing) { - console.log(`failing since ${item.lastFailedAtUnix}: ${item.lastFailureReason}`); -} -``` - -[↑ Top](#endpoints) - -### getSchedulerTaskRuns - -`GET` `/{version}/scheduler/tasks/{id}/runs` - -The latest runs of one task, **newest first**, read from the project's logs: -each run fired, failed or was skipped. `id` goes in the path; `take` (1–50, -default 10) goes in the query string. Needs `scheduler:read` on the task and -`logging:read`. - -When the project's Logs module is off there is nothing to read: the answer is -`logsEnabled: false` with an empty `runs`. For runs older than the latest 50, -read the logs filtered by the task id: -`norbix.hub.logs.getLogs({ module: 'Scheduler', metaKey: 'taskId', metaValue: 'tsk_123' })`. - -**Request DTO**: `CodeMashHub2.GetSchedulerTaskRuns` (typed as `GetSchedulerTaskRunsInput`: `id` is required) -**Response**: `SchedulerTaskRunsResponse` (`CodeMashHub2.GetSchedulerTaskRunsResponse` with typed runs) - -| Field | Type | Notes | -| ---------------------- | ---------------------------------- | --------------------------------------------------------------------------------- | -| `logsEnabled` | `boolean` | `false` when the Logs module is off — `runs` is then empty | -| `runs[].logId` | `string` | id of the run's log entry | -| `runs[].atUtc` | `string` | when the run ended (UTC) | -| `runs[].atUnix` | `number` | the same, Unix seconds | -| `runs[].outcome` | `'Fired' \| 'Failed' \| 'Skipped'` | the gateway sends the name | -| `runs[].reason` | `string?` | stable code of a failed or skipped run (`run-failed`, `module-disabled`, …) | -| `runs[].detail` | `string?` | the errors of a failed or skipped run | -| `runs[].correlationId` | `string?` | the run's request trail — `norbix.hub.logs.getLogsByCorrelationId` shows the rest | - -`outcome` is typed as the string the gateway sends. The generated -`CodeMashHub2.SchedulerTaskRunOutcome` enum carries numbers (`Fired = 1`), so -compare against the strings, not the enum. +**Response**: `CodeMashHub2.GetSchedulerTaskResponse` ```ts import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const { logsEnabled, runs } = await norbix.hub.scheduler.getSchedulerTaskRuns({ - id: 'tsk_123', - take: 20, // optional, 1–50, default 10 +const result = await norbix.hub.scheduler.getSchedulerTask({ + id: 'id-here', + // Other fields: see CodeMash type for the full request shape. }); - -if (!logsEnabled) { - console.log('Turn on the Logs module to see the run history.'); -} -for (const run of runs) { - // newest first - console.log(run.atUtc, run.outcome, run.reason ?? '', run.detail ?? ''); -} +// → typed as CodeMashHub2.GetSchedulerTaskResponse ``` [↑ Top](#endpoints) @@ -218,145 +160,65 @@ for (const run of runs) { `GET` `/{version}/scheduler/tasks` -List the project's tasks, one page at a time. Optional filters `type` and -`enabled` go in the query string. +Fetch a single item by ID. **Request DTO**: `CodeMashHub2.GetSchedulerTasks` -**Response**: `CodeMashHub2.GetSchedulerTasksResponse` (`list`) +**Response**: `CodeMashHub2.GetSchedulerTasksResponse` ```ts import { Norbix } from '@norbix.ai/ts'; -import { CodeMashHub2 } from '@norbix.ai/ts/types/hub'; const norbix = new Norbix(); -const { list } = await norbix.hub.scheduler.getSchedulerTasks({ - type: CodeMashHub2.SchedulerTaskType.EmailCampaign, - enabled: true, +const result = await norbix.hub.scheduler.getSchedulerTasks({ + // See CodeMash type for the full request shape. }); -// list.items: CodeMashHub2.SchedulerTaskListProjection[] (each with isFailing); list.hasMore for the next page +// → typed as CodeMashHub2.GetSchedulerTasksResponse ``` [↑ Top](#endpoints) -### saveSchedulerTask +### getSchedulerTaskRuns -`POST` `/{version}/scheduler/tasks` +`GET` `/{version}/scheduler/tasks/{id}/runs` -Create a task, or update it when `taskId` is set. All fields go in the JSON body. - -| Field | Required | Notes | -| ----------------- | -------- | -------------------------------------------------------- | -| `name` | yes | | -| `cron` | yes | 5 fields, UTC | -| `initiatorUserId` | yes | `usr_…` — the caller or a project service user | -| `isEnabled` | yes | `false` saves the task without starting its cron | -| `stopOnError` | yes | `true` disables the task when a run fails | -| `task` | yes | `{ type, campaign, databaseIntegrationId? }` — see below | -| `taskId` | no | set to update an existing task | -| `description` | no | | - -`task.type` picks the channel, and `task.campaign` is the same campaign you -would create with that notifications module: - -| `task.type` | `task.campaign` | Required by the gateway | -| --------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `EmailCampaign` | email campaign (`SchedulerEmailCampaignInput`) | `source` (`AllUsers`, `SpecifiedUsers`, `AccountUsers`, `Email`, `Collection`) and `templateId` | -| `SmsCampaign` | SMS campaign (`SchedulerSmsCampaignInput`) | `templateId`, `integrationId`, and the audience: `deliveryType` (`AllUsers`, `SpecifiedUsers`, `AccountUsers`, `PhoneNumbers`, `Collection`) plus the settings object of the same name, e.g. `specifiedUsers` | -| `PushCampaign` | push campaign (`SchedulerPushCampaignInput`) | `source` (`AllUsers`, `SpecifiedUsers`, `AccountUsers`, `Devices`, `Collection`) and `templateId`; the audience fields go with `source` | - -`databaseIntegrationId` (`int_…`) is optional: without it the project's -default database integration is used when the task fires. The body is typed -(`SaveSchedulerTaskInput`, exported from `@norbix.ai/ts/hub` with the per-type -inputs `EmailCampaignSchedulerTaskInput`, `SmsCampaignSchedulerTaskInput` and -`PushCampaignSchedulerTaskInput`), so plain string values type-check without a -cast, and a wrong `type` or a missing required field fails the typecheck. - -**Refused when the initiator lacks permissions.** The task runs as -`initiatorUserId`, so the save checks that this user holds every permission -the task needs when it fires (for a campaign task: sending that campaign). If -not, the save fails with `CM-ERRORS-SCHEDULER-012` and nothing is saved: the -message names each missing permission (`"{action} on {resource}"`), and the -error's metadata carries `InitiatorUserId` and `MissingPermissions`. Give the -user the permissions, or pick another initiator, and save again. - -**Request DTO**: `CodeMashHub2.SaveSchedulerTaskRequest` (task: `CodeMashHub2.EmailCampaignSchedulerTaskRequest`, `CodeMashHub2.SmsCampaignSchedulerTaskRequest` or `CodeMashHub2.PushCampaignSchedulerTaskRequest`) -**Response**: `CodeMashHub2.IdResponse` (`id` — the task id) +Fetch a single item by ID. + +**Request DTO**: `CodeMashHub2.GetSchedulerTaskRuns` +**Response**: `CodeMashHub2.GetSchedulerTaskRunsResponse` ```ts import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const { id } = await norbix.hub.scheduler.saveSchedulerTask({ - name: 'Weekly digest', - cron: '0 9 * * 1', // every Monday 09:00 UTC - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'EmailCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tpl_123', - rolesNames: ['subscriber'], // optional: only users with these roles - }, - }, +const result = await norbix.hub.scheduler.getSchedulerTaskRuns({ + id: 'id-here', + // Other fields: see CodeMash type for the full request shape. }); +// → typed as CodeMashHub2.GetSchedulerTaskRunsResponse ``` -An SMS task — every day at 08:00 UTC to two members, through one SMS provider: +[↑ Top](#endpoints) -```ts -import { Norbix } from '@norbix.ai/ts'; +### saveSchedulerTask -const norbix = new Norbix(); +`POST` `/{version}/scheduler/tasks` -const { id } = await norbix.hub.scheduler.saveSchedulerTask({ - name: 'Daily SMS reminder', - cron: '0 8 * * *', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'SmsCampaign', - campaign: { - templateId: 'tmpl_sms_reminder', - integrationId: 'int_twilio', // the SMS provider integration - deliveryType: 'SpecifiedUsers', - specifiedUsers: { - recipientsSourceType: 'SpecifiedUsers', // same value as deliveryType - recipients: ['usr_456', 'usr_789'], - }, - }, - }, -}); -``` +Upsert an item (create or update). -A push task — every Friday at 18:00 UTC to all subscribers on iOS and Android: +**Request DTO**: `CodeMashHub2.SaveSchedulerTaskRequest` +**Response**: `CodeMashHub2.IdResponse` ```ts import { Norbix } from '@norbix.ai/ts'; const norbix = new Norbix(); -const { id } = await norbix.hub.scheduler.saveSchedulerTask({ - name: 'Weekly push', - cron: '0 18 * * 5', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: true, - task: { - type: 'PushCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tmpl_push_weekly', - integrationId: 'int_fcm', // optional: the project default push integration otherwise - rolesNames: ['subscriber'], // optional - platforms: ['Ios', 'Android'], // optional: every platform otherwise - }, - }, +const result = await norbix.hub.scheduler.saveSchedulerTask({ + // See CodeMash type for the full request shape. }); +// → typed as CodeMashHub2.IdResponse ``` [↑ Top](#endpoints) diff --git a/docs/hub/webhooks.md b/docs/hub/webhooks.md index aad5430..f6e5d9e 100644 --- a/docs/hub/webhooks.md +++ b/docs/hub/webhooks.md @@ -18,15 +18,6 @@ Accessed as `norbix.hub.webhooks` on the [`Norbix`](../../README.md#authenticati | [`removeWebhookDestination`](#removewebhookdestination) | `DELETE` | `/{version}/webhooks/destinations/{DestinationId}` | `project` | | [`saveWebhookDestination`](#savewebhookdestination) | `POST` | `/{version}/webhooks/destinations` | `project` | -> **Receiving deliveries.** Each POST to a destination carries a JSON envelope -> `{ id, eventId, event, createdOn, accountId, projectId, triggerId?, data }`. -> `id` is one per delivery (a retry keeps it) — dedupe retries on it. `eventId` -> is the same for every delivery made for ONE record change — dedupe the same -> change on it. A destination that is subscribed to the event **and** targeted -> by a schema Webhook trigger gets two deliveries (`triggerId` null and set), two -> `id`s, one `eventId`. Use the receiver in -> [`docs/webhooks-receiver.md`](../webhooks-receiver.md#de-duplication-id-vs-eventid). - ## Reference ### getWebhookIntegration @@ -227,3 +218,18 @@ const result = await norbix.hub.webhooks.saveWebhookDestination({ ``` [↑ Top](#endpoints) + + + +## Receiving deliveries + +> **Receiving deliveries.** Each POST to a destination carries a JSON envelope +> `{ id, eventId, event, createdOn, accountId, projectId, triggerId?, data }`. +> `id` is one per delivery (a retry keeps it) — dedupe retries on it. `eventId` +> is the same for every delivery made for ONE record change — dedupe the same +> change on it. A destination that is subscribed to the event **and** targeted +> by a schema Webhook trigger gets two deliveries (`triggerId` null and set), two +> `id`s, one `eventId`. Use the receiver in +> [`docs/webhooks-receiver.md`](../webhooks-receiver.md#de-duplication-id-vs-eventid). + + diff --git a/src/api/apikeys.ts b/src/api/apikeys.ts index b8bb44f..13edc40 100644 --- a/src/api/apikeys.ts +++ b/src/api/apikeys.ts @@ -16,6 +16,7 @@ export class ApikeysModule { * Aliases: * - POST /apikeys/{Environment} * Request DTO: GetApiKeys + * @deprecated The gateway has no `/apikeys` endpoint, so this call fails. Use service-user API keys (`norbix.hub.membership.listServiceUserApiKeys`). */ getApiKeys = ( request: Partial = {} as Partial, @@ -37,6 +38,7 @@ export class ApikeysModule { * Aliases: * - POST /apikeys/regenerate/{Environment} * Request DTO: RegenerateApiKeys + * @deprecated The gateway has no `/apikeys/regenerate` endpoint, so this call fails. Use `norbix.hub.membership.issueServiceUserApiKey`. */ regenerateApiKeys = ( request: Partial = {} as Partial, diff --git a/src/api/files.ts b/src/api/files.ts index 957b39f..b2456a1 100644 --- a/src/api/files.ts +++ b/src/api/files.ts @@ -6,7 +6,7 @@ import type { CodeMashApi2 } from '../types/api2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: files - * Endpoints: 13 + * Endpoints: 14 */ export class FilesModule { constructor(private readonly transport: Transport) {} @@ -260,4 +260,23 @@ export class FilesModule { ...options, }); }; + + /** + * POST /{version}/files/{filesIntegrationId}/use + * Request DTO: UseFileRequest + */ + useFile = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'api', + path: '/{version}/files/{filesIntegrationId}/use', + method: 'POST', + request, + pathParams: ['filesIntegrationId'], + scope: 'project', + ...options, + }); + }; } diff --git a/src/api/membership.ts b/src/api/membership.ts index 43bde31..88f5f6b 100644 --- a/src/api/membership.ts +++ b/src/api/membership.ts @@ -6,7 +6,7 @@ import type { CodeMashApi2 } from '../types/api2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: membership - * Endpoints: 42 + * Endpoints: 43 */ export class MembershipModule { constructor(private readonly transport: Transport) {} @@ -69,16 +69,16 @@ export class MembershipModule { }; /** - * POST /{version}/membership/auth/register/user-name - * Request DTO: SaveUserNameUser + * POST /{version}/membership/auth/register/phone + * Request DTO: SavePhoneUser */ - saveUserNameUser = ( - request: Partial = {} as Partial, + savePhoneUser = ( + request: Partial = {} as Partial, options: RequestOverrideOptions = {}, ): Promise => { return this.transport.send({ target: 'api', - path: '/{version}/membership/auth/register/user-name', + path: '/{version}/membership/auth/register/phone', method: 'POST', request, pathParams: [], @@ -88,16 +88,16 @@ export class MembershipModule { }; /** - * POST /{version}/membership/auth/register/email - * Request DTO: SaveEmailUser + * POST /{version}/membership/auth/register/user-name + * Request DTO: SaveUserNameUser */ - saveEmailUser = ( - request: Partial = {} as Partial, + saveUserNameUser = ( + request: Partial = {} as Partial, options: RequestOverrideOptions = {}, ): Promise => { return this.transport.send({ target: 'api', - path: '/{version}/membership/auth/register/email', + path: '/{version}/membership/auth/register/user-name', method: 'POST', request, pathParams: [], @@ -107,16 +107,16 @@ export class MembershipModule { }; /** - * POST /{version}/membership/auth/register/phone - * Request DTO: SavePhoneUser + * POST /{version}/membership/auth/register/email + * Request DTO: SaveEmailUser */ - savePhoneUser = ( - request: Partial = {} as Partial, + saveEmailUser = ( + request: Partial = {} as Partial, options: RequestOverrideOptions = {}, ): Promise => { return this.transport.send({ target: 'api', - path: '/{version}/membership/auth/register/phone', + path: '/{version}/membership/auth/register/email', method: 'POST', request, pathParams: [], @@ -296,6 +296,25 @@ export class MembershipModule { }); }; + /** + * POST /{version}/membership/auth/invitation/finish + * Request DTO: FinishInvitationRequest + */ + finishInvitation = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'api', + path: '/{version}/membership/auth/invitation/finish', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + /** * POST /{version}/membership/auth/{userId}/link-identity * Request DTO: LinkIdentityRequest diff --git a/src/api/public.ts b/src/api/public.ts index 4ae5c5f..2879891 100644 --- a/src/api/public.ts +++ b/src/api/public.ts @@ -6,11 +6,31 @@ import type { CodeMashApi2 } from '../types/api2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: public - * Endpoints: 2 + * Endpoints: 3 */ export class PublicModule { constructor(private readonly transport: Transport) {} + /** + * GET /{version}/public/projects/{ProjectId}/brand/{Kind} + * Request DTO: GetPublicProjectBrandAsset + */ + getPublicProjectBrandAsset = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'api', + path: '/{version}/public/projects/{ProjectId}/brand/{Kind}', + method: 'GET', + request, + pathParams: ['ProjectId', 'Kind'], + scope: 'unauthenticated', + responseType: 'binary', + ...options, + }); + }; + /** * GET /{version}/public/projects/{ProjectId}/config * Request DTO: GetPublicProjectConfig diff --git a/src/hub/account.ts b/src/hub/account.ts index c9d699b..b3479ba 100644 --- a/src/hub/account.ts +++ b/src/hub/account.ts @@ -6,7 +6,7 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: account - * Endpoints: 113 + * Endpoints: 121 */ export class AccountModule { constructor(private readonly transport: Transport) {} @@ -50,7 +50,7 @@ export class AccountModule { }; /** - * GET /{version}/account/verify/resend + * POST /{version}/account/verify/resend * Request DTO: ResendAccountVerificationToken */ resendAccountVerificationToken = ( @@ -60,7 +60,7 @@ export class AccountModule { return this.transport.send({ target: 'hub', path: '/{version}/account/verify/resend', - method: 'GET', + method: 'POST', request, pathParams: [], scope: 'project', @@ -165,9 +165,9 @@ export class AccountModule { }; /** - * GET /{version}/account/verify + * POST /{version}/account/verify * Anonymous — no token needed. The account id travels in the request - * (`accountId`, query string), not from the client. + * (`accountId`), not from the client. * Request DTO: VerifyAccount */ verifyAccount = ( @@ -177,7 +177,7 @@ export class AccountModule { return this.transport.send({ target: 'hub', path: '/{version}/account/verify', - method: 'GET', + method: 'POST', request, pathParams: [], scope: 'unauthenticated', @@ -547,6 +547,44 @@ export class AccountModule { }); }; + /** + * PATCH /{version}/account/projects/{projectId}/settings/brand/expose + * Request DTO: UpdateProjectExposeBrand + */ + updateProjectExposeBrand = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/settings/brand/expose', + method: 'PATCH', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + + /** + * PATCH /{version}/account/projects/{projectId}/settings/auth/expose + * Request DTO: UpdateProjectExposeAuth + */ + updateProjectExposeAuth = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/settings/auth/expose', + method: 'PATCH', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + /** * PUT /{version}/account/projects/{projectId}/settings/admin-portal/service-user * Request DTO: AssignAdminPortalServiceUserRequest @@ -604,6 +642,101 @@ export class AccountModule { }); }; + /** + * POST /{version}/account/projects/{projectId}/ai/credits/checkout + * Request DTO: CreateAiCreditPackCheckoutRequest + */ + createAiCreditPackCheckout = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/credits/checkout', + method: 'POST', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + + /** + * GET /{version}/account/projects/{projectId}/ai/plans + * Request DTO: GetProjectAiPlans + */ + getProjectAiPlans = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/plans', + method: 'GET', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + + /** + * PUT /{version}/account/projects/{projectId}/ai/plans + * Request DTO: UpdateProjectAiPlans + */ + updateProjectAiPlans = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/plans', + method: 'PUT', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + + /** + * PUT /{version}/account/projects/{projectId}/ai/plans/assignments + * Request DTO: UpdateProjectAiPlanAssignments + */ + updateProjectAiPlanAssignments = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/plans/assignments', + method: 'PUT', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + + /** + * GET /{version}/account/projects/{projectId}/ai/plans/users + * Request DTO: GetProjectAiUserPlans + */ + getProjectAiUserPlans = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/plans/users', + method: 'GET', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + /** * GET /{version}/account/projects/{projectId}/ai/settings * Request DTO: GetProjectAiSettings @@ -642,6 +775,25 @@ export class AccountModule { }); }; + /** + * PUT /{version}/account/projects/{projectId}/ai/knowledge + * Request DTO: UpdateProjectAiKnowledge + */ + updateProjectAiKnowledge = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/projects/{projectId}/ai/knowledge', + method: 'PUT', + request, + pathParams: ['projectId'], + scope: 'project', + ...options, + }); + }; + /** * POST /{version}/account/projects/{projectId}/ai/assistants * Request DTO: CreateProjectAiAssistant @@ -965,44 +1117,6 @@ export class AccountModule { }); }; - /** - * PATCH /{version}/account/projects/{projectId}/settings/brand/expose - * Request DTO: UpdateProjectExposeBrand - */ - updateProjectExposeBrand = ( - request: Partial = {} as Partial, - options: RequestOverrideOptions = {}, - ): Promise => { - return this.transport.send({ - target: 'hub', - path: '/{version}/account/projects/{projectId}/settings/brand/expose', - method: 'PATCH', - request, - pathParams: ['projectId'], - scope: 'project', - ...options, - }); - }; - - /** - * PATCH /{version}/account/projects/{projectId}/settings/auth/expose - * Request DTO: UpdateProjectExposeAuth - */ - updateProjectExposeAuth = ( - request: Partial = {} as Partial, - options: RequestOverrideOptions = {}, - ): Promise => { - return this.transport.send({ - target: 'hub', - path: '/{version}/account/projects/{projectId}/settings/auth/expose', - method: 'PATCH', - request, - pathParams: ['projectId'], - scope: 'project', - ...options, - }); - }; - /** * PATCH /{version}/account/projects/{projectId}/settings/url * Request DTO: UpdateProjectUrl @@ -1650,6 +1764,25 @@ export class AccountModule { }); }; + /** + * GET /{version}/account/licenses/{Id}/key + * Request DTO: GetLicenseKey + */ + getLicenseKey = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/licenses/{Id}/key', + method: 'GET', + request, + pathParams: ['Id'], + scope: 'project', + ...options, + }); + }; + /** * POST /{version}/account/ai/service-users * Request DTO: CreateAiServiceUserRequest @@ -1764,6 +1897,25 @@ export class AccountModule { }); }; + /** + * GET /{version}/account/ai/context + * Request DTO: GetAiContextRequest + */ + getAiContext = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/account/ai/context', + method: 'GET', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + /** * GET /{version}/account/ai/tools * Request DTO: GetAiToolsRequest diff --git a/src/hub/ai.ts b/src/hub/ai.ts index b5c2759..0eaa5e7 100644 --- a/src/hub/ai.ts +++ b/src/hub/ai.ts @@ -6,11 +6,125 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: ai - * Endpoints: 20 + * Endpoints: 26 */ export class AiModule { constructor(private readonly transport: Transport) {} + /** + * POST /{version}/ai/triggers + * Request DTO: SaveAiProjectTrigger + */ + saveAiProjectTrigger = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * GET /{version}/ai/triggers + * Request DTO: GetAiProjectTriggers + */ + getAiProjectTriggers = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers', + method: 'GET', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * GET /{version}/ai/triggers/{id} + * Request DTO: GetAiProjectTrigger + */ + getAiProjectTrigger = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers/{id}', + method: 'GET', + request, + pathParams: ['id'], + scope: 'project', + ...options, + }); + }; + + /** + * PATCH /{version}/ai/triggers/{triggerId}/enable + * Request DTO: EnableAiProjectTrigger + */ + enableAiProjectTrigger = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers/{triggerId}/enable', + method: 'PATCH', + request, + pathParams: ['triggerId'], + scope: 'project', + ...options, + }); + }; + + /** + * PATCH /{version}/ai/triggers/{triggerId}/disable + * Request DTO: DisableAiProjectTrigger + */ + disableAiProjectTrigger = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers/{triggerId}/disable', + method: 'PATCH', + request, + pathParams: ['triggerId'], + scope: 'project', + ...options, + }); + }; + + /** + * DELETE /{version}/ai/triggers/{triggerId} + * Request DTO: DeleteAiProjectTrigger + */ + deleteAiProjectTrigger = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/ai/triggers/{triggerId}', + method: 'DELETE', + request, + pathParams: ['triggerId'], + scope: 'project', + ...options, + }); + }; + /** * DELETE /{version}/ai/integrations/embeddings/{Id} * Request DTO: DeleteEmbeddingIntegrationRequest diff --git a/src/hub/apikeys.ts b/src/hub/apikeys.ts index ad7f031..87ccc0b 100644 --- a/src/hub/apikeys.ts +++ b/src/hub/apikeys.ts @@ -16,6 +16,7 @@ export class ApikeysModule { * Aliases: * - POST /apikeys/{Environment} * Request DTO: GetApiKeys + * @deprecated The gateway has no `/apikeys` endpoint (there is no such route in its history), so this call fails. Use service-user API keys: `norbix.hub.membership.listServiceUserApiKeys` / `issueServiceUserApiKey`. */ getApiKeys = ( request: Partial = {} as Partial, @@ -37,6 +38,7 @@ export class ApikeysModule { * Aliases: * - POST /apikeys/regenerate/{Environment} * Request DTO: RegenerateApiKeys + * @deprecated The gateway has no `/apikeys/regenerate` endpoint, so this call fails. Use `norbix.hub.membership.issueServiceUserApiKey` and `deleteServiceUserApiKey`. */ regenerateApiKeys = ( request: Partial = {} as Partial, diff --git a/src/hub/auth.ts b/src/hub/auth.ts index 66ce824..7f99ab5 100644 --- a/src/hub/auth.ts +++ b/src/hub/auth.ts @@ -6,11 +6,87 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: auth - * Endpoints: 1 + * Endpoints: 5 */ export class AuthModule { constructor(private readonly transport: Transport) {} + /** + * POST /{version}/auth/device/start + * Request DTO: AuthDeviceStartRequest + */ + authDeviceStart = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/auth/device/start', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * POST /{version}/auth/device/token + * Request DTO: AuthDeviceTokenRequest + */ + authDeviceToken = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/auth/device/token', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * GET /{version}/auth/device/consent + * Request DTO: AuthDeviceConsentRequest + */ + authDeviceConsent = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/auth/device/consent', + method: 'GET', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * POST /{version}/auth/device/consent + * Request DTO: AuthDeviceConsentDecisionRequest + */ + authDeviceConsentDecision = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/auth/device/consent', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + /** * POST /v3/auth * Aliases: diff --git a/src/hub/database.ts b/src/hub/database.ts index e1c940b..eb84838 100644 --- a/src/hub/database.ts +++ b/src/hub/database.ts @@ -6,7 +6,7 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: database - * Endpoints: 73 + * Endpoints: 74 */ export class DatabaseModule { constructor(private readonly transport: Transport) {} diff --git a/src/hub/email.ts b/src/hub/email.ts index 32382e1..dca4bbb 100644 --- a/src/hub/email.ts +++ b/src/hub/email.ts @@ -12,48 +12,39 @@ export class EmailModule { constructor(private readonly transport: Transport) {} /** - * GET /{version}/email/preferences - * Request DTO: GetEmailPreferencesByLinkRequest - * - * Reads the marketing e-mail preferences of the person a signed - * unsubscribe link belongs to. Pass the link's `token`. No sign-in is - * needed: the signed token is the key, so the call also works on a client - * with no apiKey / bearerToken. + * POST /{version}/email/one-click-unsubscribe + * Request DTO: OneClickUnsubscribeRequest */ - getEmailPreferencesByLink = ( - request: Partial = {} as Partial, + oneClickUnsubscribe = ( + request: Partial = {} as Partial, options: RequestOverrideOptions = {}, - ): Promise => { - return this.transport.send({ + ): Promise => { + return this.transport.send({ target: 'hub', - path: '/{version}/email/preferences', - method: 'GET', + path: '/{version}/email/one-click-unsubscribe', + method: 'POST', request, pathParams: [], - scope: 'optional', // signed unsubscribe link: no sign-in needed (hand-set, see PR) + scope: 'optional', ...options, }); }; /** - * POST /{version}/email/one-click-unsubscribe - * Request DTO: OneClickUnsubscribeRequest - * - * Public: the gateway does not authenticate it (requiresAuth false). The - * signed link in the e-mail is the key, so the call works on a client with - * no apiKey / bearerToken and then sends no Authorization header. + * GET /{version}/email/preferences + * Request DTO: GetEmailPreferencesByLinkRequest */ - oneClickUnsubscribe = ( - request: Partial = {} as Partial, + getEmailPreferencesByLink = ( + request: Partial = {} as Partial, options: RequestOverrideOptions = {}, - ): Promise => { - return this.transport.send({ + ): Promise => { + return this.transport.send({ target: 'hub', - path: '/{version}/email/one-click-unsubscribe', - method: 'POST', + path: '/{version}/email/preferences', + method: 'GET', request, pathParams: [], - scope: 'optional', // public one-click unsubscribe (RFC 8058): no sign-in needed (hand-set, see PR) + scope: 'optional', ...options, }); }; diff --git a/src/hub/files.ts b/src/hub/files.ts index d1256b5..111ee75 100644 --- a/src/hub/files.ts +++ b/src/hub/files.ts @@ -6,7 +6,7 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: files - * Endpoints: 23 + * Endpoints: 24 */ export class FilesModule { constructor(private readonly transport: Transport) {} @@ -447,4 +447,23 @@ export class FilesModule { ...options, }); }; + + /** + * POST /{version}/files/item/use + * Request DTO: UseFileRequest + */ + useFile = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/files/item/use', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; } diff --git a/src/hub/index.ts b/src/hub/index.ts index ff588cb..8ad92be 100644 --- a/src/hub/index.ts +++ b/src/hub/index.ts @@ -30,6 +30,7 @@ import { TriggersModule } from './triggers.js'; import { WebhooksModule } from './webhooks.js'; import { WellKnownModule } from './well_known.js'; +// @hand-written:begin top export type { EmailCampaignSchedulerTaskInput, GetSchedulerTaskRunsInput, @@ -44,6 +45,7 @@ export type { SchedulerTaskRunsResponse, SmsCampaignSchedulerTaskInput, } from './scheduler.js'; +// @hand-written:end /** * Auto-generated namespace exposing every hub endpoint group. diff --git a/src/hub/membership.ts b/src/hub/membership.ts index 25ab736..dbf0b02 100644 --- a/src/hub/membership.ts +++ b/src/hub/membership.ts @@ -6,7 +6,7 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: membership - * Endpoints: 45 + * Endpoints: 48 */ export class MembershipModule { constructor(private readonly transport: Transport) {} @@ -49,6 +49,44 @@ export class MembershipModule { }); }; + /** + * POST /{version}/membership/users/import + * Request DTO: ImportUsersRequest + */ + importUsers = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/membership/users/import', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + + /** + * POST /{version}/membership/users/repair-logins + * Request DTO: RepairLoginProjectIdsRequest + */ + repairLoginProjectIds = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/membership/users/repair-logins', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + /** * POST /{version}/membership/users/{Id}/api-keys * Request DTO: IssueServiceUserApiKeyRequest @@ -676,6 +714,25 @@ export class MembershipModule { }); }; + /** + * PUT /{version}/membership/users/{userId}/ai-plan + * Request DTO: SetUserAiPlan + */ + setUserAiPlan = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/membership/users/{userId}/ai-plan', + method: 'PUT', + request, + pathParams: ['userId'], + scope: 'project', + ...options, + }); + }; + /** * POST /{version}/membership/users * Request DTO: CreateContactRequest diff --git a/src/hub/notifications.ts b/src/hub/notifications.ts index a74ae86..8bffaba 100644 --- a/src/hub/notifications.ts +++ b/src/hub/notifications.ts @@ -11,6 +11,25 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; export class NotificationsModule { constructor(private readonly transport: Transport) {} + /** + * POST /{version}/notifications/sms/campaigns + * Request DTO: CreateSmsCampaignRequest + */ + createSmsCampaign = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/notifications/sms/campaigns', + method: 'POST', + request, + pathParams: [], + scope: 'project', + ...options, + }); + }; + /** * PUT /{version}/notifications/email/disable * Request DTO: DisableEmail @@ -1360,25 +1379,6 @@ export class NotificationsModule { }); }; - /** - * POST /{version}/notifications/sms/campaigns - * Request DTO: CreateSmsCampaignRequest - */ - createSmsCampaign = ( - request: Partial = {} as Partial, - options: RequestOverrideOptions = {}, - ): Promise => { - return this.transport.send({ - target: 'hub', - path: '/{version}/notifications/sms/campaigns', - method: 'POST', - request, - pathParams: [], - scope: 'project', - ...options, - }); - }; - /** * DELETE /{version}/notifications/sms/campaigns/{id} * Request DTO: DeleteSmsCampaign @@ -2294,6 +2294,7 @@ export class NotificationsModule { /** * GET /{version}/notifications/user/preferences * Request DTO: GetUserNotificationPreferences + * @deprecated The Hub route was removed on purpose (gateway 09c43c9ff; it had answered 410 Gone before). Use `norbix.api.membership.getUserPreferences({ id })` — the id is in the path and the answer is `{ preferences }`, so this method cannot be redirected without changing its types. */ getUserNotificationPreferences = ( request: Partial = {} as Partial, @@ -2313,6 +2314,7 @@ export class NotificationsModule { /** * PUT /{version}/notifications/user/preferences * Request DTO: UpdateUserNotificationsPreferences + * @deprecated The Hub route was removed on purpose (gateway 09c43c9ff). Use `norbix.api.membership.updateUserPreferences({ id, blockAllMarketingMessages, blockedTags })` — note it takes BLOCKED tags, where this method took subscribed ones. */ updateUserNotificationsPreferences = ( request: Partial = {} as Partial, @@ -2330,16 +2332,17 @@ export class NotificationsModule { }; /** - * POST /{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent + * POST /{version}/membership/users/{contactId}/marketing-state/{channel}/consent * Request DTO: GrantContactConsentRequest + * @deprecated The endpoint lives on the API, not the Hub (the Hub route was planned, never built). This method now calls the API route; prefer `norbix.api.membership.grantContactConsent`. */ grantContactConsent = ( request: Partial = {} as Partial, options: RequestOverrideOptions = {}, ): Promise => { return this.transport.send({ - target: 'hub', - path: '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent', + target: 'api', + path: '/{version}/membership/users/{contactId}/marketing-state/{channel}/consent', method: 'POST', request, pathParams: ['contactId', 'channel'], @@ -2349,16 +2352,17 @@ export class NotificationsModule { }; /** - * POST /{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe + * POST /{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe * Request DTO: UnsubscribeContactRequest + * @deprecated The endpoint lives on the API, not the Hub (the Hub route was planned, never built). This method now calls the API route; prefer `norbix.api.membership.unsubscribeContact`. */ unsubscribeContact = ( request: Partial = {} as Partial, options: RequestOverrideOptions = {}, ): Promise => { return this.transport.send({ - target: 'hub', - path: '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe', + target: 'api', + path: '/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe', method: 'POST', request, pathParams: ['contactId', 'channel'], diff --git a/src/hub/public.ts b/src/hub/public.ts index 8e312e3..6de080b 100644 --- a/src/hub/public.ts +++ b/src/hub/public.ts @@ -6,11 +6,31 @@ import type { CodeMashHub2 } from '../types/hub2.dtos.js'; * to refresh this file from the DTO definitions. * * Group: public - * Endpoints: 2 + * Endpoints: 3 */ export class PublicModule { constructor(private readonly transport: Transport) {} + /** + * GET /{version}/public/projects/{ProjectId}/brand/{Kind} + * Request DTO: GetPublicProjectBrandAsset + */ + getPublicProjectBrandAsset = ( + request: Partial = {} as Partial, + options: RequestOverrideOptions = {}, + ): Promise => { + return this.transport.send({ + target: 'hub', + path: '/{version}/public/projects/{ProjectId}/brand/{Kind}', + method: 'GET', + request, + pathParams: ['ProjectId', 'Kind'], + scope: 'unauthenticated', + responseType: 'binary', + ...options, + }); + }; + /** * GET /{version}/public/projects/{ProjectId}/config * Request DTO: GetPublicProjectConfig diff --git a/src/hub/scheduler.ts b/src/hub/scheduler.ts index 989ef35..e5555ad 100644 --- a/src/hub/scheduler.ts +++ b/src/hub/scheduler.ts @@ -1,6 +1,7 @@ import type { RequestOverrideOptions, Transport } from '../client/transport.js'; import type { CodeMashHub2 } from '../types/hub2.dtos.js'; +// @hand-written:begin top /** A string enum, or the same value written as a plain string literal. */ type EnumOrLiteral = E | `${E}`; @@ -187,6 +188,7 @@ export type SchedulerTaskRunsResponse = Omit, 'id'> & { id: string; }; +// @hand-written:end /** * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` @@ -331,6 +333,7 @@ export class SchedulerModule { }); }; + // @hand-written:begin /** * GET /{version}/scheduler/tasks/{id}/runs * Request DTO: GetSchedulerTaskRuns @@ -383,4 +386,5 @@ export class SchedulerModule { ...options, }); }; + // @hand-written:end } diff --git a/src/types/api2.contract.json b/src/types/api2.contract.json index 72e5616..e40f9f6 100644 --- a/src/types/api2.contract.json +++ b/src/types/api2.contract.json @@ -131,6 +131,10 @@ "requiresAuth": true, "returnsBytes": false }, + "FinishInvitationRequest": { + "requiresAuth": false, + "returnsBytes": false + }, "ForgetEndUserChatMemoryRequest": { "requiresAuth": true, "returnsBytes": false @@ -371,6 +375,10 @@ "requiresAuth": true, "returnsBytes": false }, + "SharedTypeGen": { + "requiresAuth": false, + "returnsBytes": false + }, "StartEmailVerificationRequest": { "requiresAuth": false, "returnsBytes": false diff --git a/src/types/api2.dtos.ts b/src/types/api2.dtos.ts index f30de16..2c17e9d 100644 --- a/src/types/api2.dtos.ts +++ b/src/types/api2.dtos.ts @@ -1,6 +1,6 @@ // @ts-nocheck /* Options: -Date: 2026-10-14 07:55:07 +Date: 2026-10-14 16:40:15 Version: 10.20 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: http://localhost:5002 @@ -46,2785 +46,2146 @@ export module CodeMashApi2 { TValue >; - // @DataContract(Namespace="http://codemash.io/types/") - export class RequestBase implements IVersionBasedRequest, IHasCorrelationIdRequest { - /** @description TimeZone */ + export class JsonSchemaFieldDto { // @DataMember - // @ApiMember(DataType="string", Description="TimeZone", Name="TimeZoneId", ParameterType="header") - public timeZoneId?: string; + public fieldName: 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 */ + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class StringFieldDto extends JsonSchemaFieldDto { // @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 format?: string; - /** @description CorrelationId for each request */ // @DataMember - // @ApiMember(DataType="string", Description="CorrelationId for each request", Name="CorrelationId", ParameterType="header") - public correlationId?: string; + public pattern?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public minLength?: number; - export interface IVersionBasedRequest { - version: string; - } + // @DataMember + public maxLength?: number; - export interface IHasCorrelationIdRequest { - correlationId?: string; - } + // @DataMember + public translateOptions?: IReadOnlyDictionary; - // @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; + public default?: 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; + public unique?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export interface IHasProjectId { - projectId: string; - } + export class DecimalFieldDto extends JsonSchemaFieldDto { + // @DataMember + public minimum?: number; - export interface IHasEnv { - env?: string; - } + // @DataMember + public maximum?: number; - export enum Gender { - Male = 'Male', - Female = 'Female', - Other = 'Other', - } + // @DataMember + public multipleOf?: number; - export enum MarketingBlockReason { - Unspecified = 'Unspecified', - Unsubscribed = 'Unsubscribed', - Complaint = 'Complaint', - HardBounce = 'HardBounce', - InvalidEmail = 'InvalidEmail', - AdminBlock = 'AdminBlock', + // @DataMember + public default?: number; + + // @DataMember + public unique?: boolean; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } } - 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; + export class CurrencyDefaultDto { + // @DataMember + public value: number; - public constructor(init?: Partial) { + // @DataMember + public currency: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class SaveUser extends CodeMashRequestBase { - /** @description Database integration id. Optional — defaults to the request environment's default integration. */ + export class CurrencyFieldDto extends JsonSchemaFieldDto { // @DataMember - // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") - public databaseIntegrationId?: string; + public allowedCurrencies?: IReadOnlyList; - /** @description User Info */ // @DataMember - // @ApiMember(DataType="object", Description="User Info", Name="UserGeneralInfo", ParameterType="body") - public userGeneralInfo?: UserGeneralInfoDto; + public multipleOf?: number; - /** @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; + public minimum?: number; - /** @description Ignore UserRegistersAsRole from Membership Settings */ // @DataMember - // @ApiMember(DataType="boolean", Description="Ignore UserRegistersAsRole from Membership Settings", Name="IgnoreUserRegistersAsRole", ParameterType="body") - public ignoreUserRegistersAsRole: boolean; + public maximum?: number; - public constructor(init?: Partial) { + // @DataMember + public default?: CurrencyDefaultDto; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - // @DataContract - export class SaveUserWithRolesBase extends SaveUser { + export class BooleanFieldDto extends JsonSchemaFieldDto { // @DataMember - public roles: string[] = []; + public default?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - 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; - - /** @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; - - /** @description Cursor token — fetch the page AFTER this item. */ + export class DateFieldDto extends JsonSchemaFieldDto { // @DataMember - // @ApiMember(DataType="string", Description="Cursor token — fetch the page AFTER this item.", Name="startingAfter", ParameterType="query") - public startingAfter?: string; + public minimum?: number; - /** @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; + public maximum?: number; - /** @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 default?: number; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export interface IPasskeyCeremonyRequest {} + export class IntegerFieldDto extends JsonSchemaFieldDto { + // @DataMember + public minimum?: number; - export class CursorArgs implements ICursorArgs { - public field: string; - public order: number; + // @DataMember + public maximum?: number; - public constructor(init?: Partial) { + // @DataMember + public default?: number; + + // @DataMember + public unique?: boolean; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class PagingArgs { - public cursorArgs?: CursorArgs; - public pageSize?: number; - public startingAfter?: string; - public endingBefore?: string; + export class GeolocationFieldDto extends JsonSchemaFieldDto { + // @DataMember + public allowedTypes?: IReadOnlyList; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export enum CodeMashRelease { - NotSet = 'NotSet', - Community = 'Community', - ManagedService = 'ManagedService', - Enterprise = 'Enterprise', - } + export class TagsFieldDto extends JsonSchemaFieldDto { + // @DataMember + public minItems?: number; - export enum CodeMashRuntime { - Development = 'Development', - CI = 'CI', - Staging = 'Staging', - Production = 'Production', - } + // @DataMember + public maxItems?: number; - export class EchoRegionDto { - public code: string; - public displayName: string; - public apiUrl: string; - public hubUrl: string; + // @DataMember + public default?: IReadOnlyList; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class EchoAgentSnippetDto { - public client: string; - public kind: string; - public recommended: boolean; - public auth: string; - public config: string; + export class FileFieldDto extends JsonSchemaFieldDto { + // @DataMember + public storages?: IReadOnlyList; - public constructor(init?: Partial) { + // @DataMember + public minItems?: number; + + // @DataMember + public maxItems?: number; + + // @DataMember + public allowedFileType?: string; + + // @DataMember + public maxSizeMb?: number; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class EchoAgentDto { - public mcpUrl: string; - public oAuthMetadataUrl?: string; - public installationType: string; - public onboardingDocsUrl: string; - public toolsUrl: string; - public cliPackage: string; - public cliInstallCommand: string; - public deviceAuthorizationUrl: string; - public deviceTokenUrl: string; - public snippets: EchoAgentSnippetDto[] = []; + export class TaxonomySelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public taxonomyId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public multiple: boolean; - export class EchoHostingPlatformDto { - public provider: string; - public isAws: boolean; + // @DataMember + public displayField?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class PublicBrandDto { - public displayName: string; - public mainColor?: string; - public accentColor?: string; - public logoUrl?: string; - public iconUrl?: string; + export class CollectionSelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public collectionId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public displayField?: string; - export class PublicPasswordPolicyDto { - public minLength: number; - public maxLength?: number; - public minNumbers?: number; - public minUpper?: number; - public minLower?: number; - public minSpecial?: number; - public allowedSpecial?: string; + // @DataMember + public multiple: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class PublicAuthDto { - public socialProviders: string[] = []; - public passkey: boolean; - public methods?: string[]; - public passwordPolicy?: PublicPasswordPolicyDto; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + export class UserSelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public multiple: boolean; - export class PublicAiAssistantDto { - public id: string; - public name: string; - public welcome?: string; + // @DataMember + public displayField?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class PublicAiChatDto { - public enabled: boolean; - public assistants: PublicAiAssistantDto[] = []; + export class RoleSelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public multiple: boolean; - public constructor(init?: Partial) { + // @DataMember + public displayField?: string; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class ErrorDto { - public message: string; - public errorCode?: string; - public context?: { [index: string]: string }; - public stackTrace?: ErrorDto[]; + export class EnumSelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public values?: IReadOnlyList; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public multiple: boolean; - export class CodeMashResponseStatus { - public isSuccess: boolean; - public errors?: ErrorDto[]; + // @DataMember + public default?: IReadOnlyList; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class ResponseBase { + export class ObjectFieldDto extends JsonSchemaFieldDto { // @DataMember - public responseStatus: CodeMashResponseStatus; + public properties: IReadOnlyList; - public constructor(init?: Partial) { + // @DataMember + public required?: IReadOnlyList; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - 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; + export class ArrayFieldDto extends JsonSchemaFieldDto { + // @DataMember + public items: JsonSchemaFieldDto; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public minItems?: number; - export class EndUserChatMemoryNote { - public id: string; - public sessionId: string; - public kind: string; - public text: string; - public createdAtUtc: string; + // @DataMember + public maxItems?: number; - public constructor(init?: Partial) { + // @DataMember + public uniqueItems?: boolean; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class EndUserChatAssistant { - public id: string; - public name: string; - public welcomeMessage?: string; - public isDefault: boolean; - public memoryEnabled: boolean; + export class JsonFieldDto extends JsonSchemaFieldDto { + // @DataMember + public maxBytes?: number; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - 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; + // @DataContract(Namespace="http://codemash.io/types/") + export class RequestBase implements IVersionBasedRequest, IHasCorrelationIdRequest { + /** @description TimeZone */ + // @DataMember + // @ApiMember(DataType="string", Description="TimeZone", Name="TimeZoneId", ParameterType="header") + public timeZoneId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + /** @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; - 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; + /** @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) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - 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; + export interface IVersionBasedRequest { + version: string; + } - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } + export interface IHasCorrelationIdRequest { + correlationId?: string; } - export class EndUserAiToolParameter { - public name: string; - public type: string; - public required: boolean; - public description?: 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; - public constructor(init?: Partial) { + /** @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; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class EndUserAiTool { - public name: string; - public description: string; - public toolsets: string[] = []; - public requiresConfirmation: boolean; - public parameters: EndUserAiToolParameter[] = []; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } + export interface IHasProjectId { + projectId: string; } - export enum AuthType { - Service = 'Service', - Email = 'Email', - UserName = 'UserName', - Phone = 'Phone', - Guest = 'Guest', - Social = 'Social', - } - - export class AccessInformationDto { - public ip?: string; - public date?: string; - public timeZone?: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class RegistrationDto { - public registrationInformation: AccessInformationDto; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class LoginDto { - public needChangePasswordOnNextLogin: boolean; - public lastAccessInformation?: AccessInformationDto; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export enum AuthStatus { - Registered = 0, - PendingValidation = 2, - Active = 8, - Unregistered = 16, - Suspended = 32, - InActive = 64, - Blocked = 128, + export interface IHasEnv { + env?: string; } - 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; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } + export enum Gender { + Male = 'Male', + Female = 'Female', + Other = 'Other', } - export class PaginatedResponse { - public items: IList; - public hasMore: boolean; - public hasPrevious: boolean; - public startingAfter?: string; - public endingBefore?: string; - - public constructor(init?: Partial>) { - (Object as any).assign(this, init); - } + export enum MarketingBlockReason { + Unspecified = 'Unspecified', + Unsubscribed = 'Unsubscribed', + Complaint = 'Complaint', + HardBounce = 'HardBounce', + InvalidEmail = 'InvalidEmail', + AdminBlock = 'AdminBlock', } - export class UserMarketingPreferencesDto { + 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; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class PasskeyListItemDto { - public credentialId: string; - public friendlyName: string; - public registeredOnUtc: string; - public lastUsedOnUtc: string; - public isRevoked: boolean; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class TermMultiParentDto { + // @DataContract + export class SaveUser extends CodeMashRequestBase { + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ // @DataMember - public taxonomyId: string; + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; + /** @description User Info */ // @DataMember - public parentId: string; + // @ApiMember(DataType="object", Description="User Info", Name="UserGeneralInfo", ParameterType="body") + public userGeneralInfo?: UserGeneralInfoDto; + /** @description Attach this login to an existing user id. Optional. */ // @DataMember - public name?: string; + // @ApiMember(Description="Attach this login to an existing user id. Optional.") + public userId?: string; + /** @description Ignore UserRegistersAsRole from Membership Settings */ // @DataMember - public names?: { [index: string]: string }; + // @ApiMember(DataType="boolean", Description="Ignore UserRegistersAsRole from Membership Settings", Name="IgnoreUserRegistersAsRole", ParameterType="body") + public ignoreUserRegistersAsRole: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class TermTreeDto { + // @DataContract + export class SaveUserWithRolesBase extends SaveUser { // @DataMember - public id: string; + public roles: string[] = []; - // @DataMember - public taxonomyId?: string; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } - // @DataMember - public taxonomyName?: string; + export interface IPublicRegistrationRequest { + roles?: string[]; + } + export class CodeMashListPaginationRequestBase + extends RequestBase + implements IHasProjectId, IHasEnv + { + /** @description ID of your project. Can be passed in a header as norbix-project-id. */ // @DataMember - public parentId?: string; + // @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 - public order?: number; + // @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; + /** @description Cursor token — fetch the page AFTER this item. */ // @DataMember - public name?: string; + // @ApiMember(DataType="string", Description="Cursor token — fetch the page AFTER this item.", Name="startingAfter", ParameterType="query") + public startingAfter?: string; + /** @description Cursor token — fetch the page BEFORE this item. */ // @DataMember - public names?: { [index: string]: string }; + // @ApiMember(DataType="string", Description="Cursor token — fetch the page BEFORE this item.", Name="endingBefore", ParameterType="query") + public endingBefore?: string; + /** @description Amount of records to return. */ // @DataMember - public slug?: string; + // @ApiMember(DataType="integer", Description="Amount of records to return.", Format="int32", Name="pageSize", ParameterType="query") + public pageSize?: number; - // @DataMember - public description?: string; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } - // @DataMember - public descriptions?: { [index: string]: string }; + export interface IPasskeyCeremonyRequest {} - // @DataMember - public multiParents?: TermMultiParentDto[]; + export class CursorArgs implements ICursorArgs { + public field: string; + public order: number; - // @DataMember - public meta?: Object; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public children?: TermTreeDto[]; + export class PagingArgs { + public cursorArgs?: CursorArgs; + public pageSize?: number; + public startingAfter?: string; + public endingBefore?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class TaxonomyTreeDto { - // @DataMember - public viewId: string; - - // @DataMember - public taxonomyName: string; + // @DataContract + export enum CodeMashRelease { + NotSet = 'NotSet', + Community = 'Community', + ManagedService = 'ManagedService', + Enterprise = 'Enterprise', + } - // @DataMember - public taxonomySlug: string; + export enum CodeMashRuntime { + Development = 'Development', + CI = 'CI', + Staging = 'Staging', + Production = 'Production', + } - // @DataMember - public parentId?: string; + export class EchoRegionDto { + public code: string; + public displayName: string; + public apiUrl: string; + public hubUrl: string; - // @DataMember - public children?: TaxonomyTreeDto[]; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public terms?: TermTreeDto[]; + export class EchoAgentSnippetDto { + public client: string; + public kind: string; + public recommended: boolean; + public auth: string; + public config: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class TermDto { - // @DataMember - public id: string; - - // @DataMember - public taxonomyId?: string; + export class EchoAgentDto { + public mcpUrl: string; + public oAuthMetadataUrl?: string; + public installationType: string; + public onboardingDocsUrl: string; + public toolsUrl: string; + public cliPackage: string; + public cliInstallCommand: string; + public deviceAuthorizationUrl: string; + public deviceTokenUrl: string; + public snippets: EchoAgentSnippetDto[] = []; - // @DataMember - public taxonomyName?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public parentId?: string; + export class EchoHostingPlatformDto { + public provider: string; + public isAws: boolean; - // @DataMember - public order?: number; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public name?: string; + export class PublicBrandDto { + public displayName: string; + public mainColor?: string; + public accentColor?: string; + public logoUrl?: string; + public iconUrl?: string; - // @DataMember - public names?: { [index: string]: string }; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public slug?: string; + export class PublicPasswordPolicyDto { + public minLength: number; + public maxLength?: number; + public minNumbers?: number; + public minUpper?: number; + public minLower?: number; + public minSpecial?: number; + public allowedSpecial?: string; - // @DataMember - public description?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public descriptions?: { [index: string]: string }; + export class PublicAuthDto { + public socialProviders: string[] = []; + public passkey: boolean; + public methods?: string[]; + public passwordPolicy?: PublicPasswordPolicyDto; - // @DataMember - public multiParents?: TermMultiParentDto[]; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public meta?: Object; + export class PublicAiAssistantDto { + public id: string; + public name: string; + public welcome?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class JsonSchemaFieldDto { - // @DataMember - public fieldName: string; + export class PublicAiChatDto { + public enabled: boolean; + public assistants: PublicAiAssistantDto[] = []; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class DataSchemaDto { - // @DataMember - public json: string; - - // @DataMember - public fields: JsonSchemaFieldDto[] = []; + export class ErrorDto { + public message: string; + public errorCode?: string; + public context?: { [index: string]: string }; + public stackTrace?: ErrorDto[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class VisualSchemaDto { - // @DataMember - public json: string; + export class CodeMashResponseStatus { + public isSuccess: boolean; + public errors?: ErrorDto[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class SchemaSettingsDto { + // @DataContract + export class ResponseBase { // @DataMember - public softDelete: boolean; + public responseStatus: CodeMashResponseStatus; - // @DataMember - public hasRecordOwner: boolean; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public description?: string; + 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; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class SchemaEmbedSettingsDto { - // @DataMember - public enabled: boolean; - - // @DataMember - public fields: string[] = []; + export class EndUserChatMemoryNote { + public id: string; + public sessionId: string; + public kind: string; + public text: string; + public createdAtUtc: string; - // @DataMember - public embeddingIntegrationId?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember - public perUser: boolean; + export class EndUserChatAssistant { + public id: string; + public name: string; + public welcomeMessage?: string; + public isDefault: boolean; + public memoryEnabled: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export enum TriggerType { - Membership = 'Membership', - Schema = 'Schema', - Files = 'Files', - Payments = 'Payments', - Ai = 'Ai', - } + 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; - export enum TriggerActionType { - Code = 'Code', - Push = 'Push', - Sms = 'Sms', - Email = 'Email', - WebhookCall = 'WebhookCall', - SseCall = 'SseCall', - Marketplace = 'Marketplace', + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } } - // @DataContract - export class TriggerActionDto { - // @DataMember - public type: TriggerActionType; - - // @DataMember - public integrationId?: string; + 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; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class TriggerDto implements IHasViewId, IQueuedTrigger { - // @DataMember - public type: TriggerType; + 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; - // @DataMember - public viewId: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember + export class EndUserAiToolParameter { public name: string; - - // @DataMember - public thenAction: TriggerActionDto; - - // @DataMember + public type: string; + public required: boolean; public description?: string; - // @DataMember - public isEnabled: boolean; - - // @DataMember - public activationCode?: string; - - // @DataMember - public order?: number; - - // @DataMember - public breakOnError: boolean; - - // @DataMember - public savedByAuthId?: string; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class SchemaDto implements IHasViewId { - // @DataMember - public viewId: string; - - // @DataMember - public schemaName: string; - - // @DataMember - public schemaSlug?: string; - - // @DataMember - public version: number; - - // @DataMember - public metaSchemaVersion: number; - - // @DataMember - public dataSchema: DataSchemaDto; - - // @DataMember - public visualSchema: VisualSchemaDto; - - // @DataMember - public publishedAt: string; - - // @DataMember - public settings?: SchemaSettingsDto; - - // @DataMember - public embed?: SchemaEmbedSettingsDto; - - // @DataMember - public triggers?: TriggerDto[]; + export class EndUserAiTool { + public name: string; + public description: string; + public toolsets: string[] = []; + public requiresConfirmation: boolean; + public parameters: EndUserAiToolParameter[] = []; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class SchemaListProjection implements IHasViewId { - // @DataMember - public viewId: string; - - // @DataMember - public schemaName: string; - - // @DataMember - public schemaTitle: string; - - // @DataMember - public latestVersion?: number; - - // @DataMember - public hasDraft: boolean; - - // @DataMember - public metaSchemaVersion: number; - - // @DataMember - public description?: string; + export enum AuthType { + Service = 'Service', + Email = 'Email', + UserName = 'UserName', + Phone = 'Phone', + Guest = 'Guest', + Social = 'Social', + } - // @DataMember - public env?: string; + export class AccessInformationDto { + public ip?: string; + public date?: string; + public timeZone?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class FileChecksumDto { - // @DataMember(Order=1) - public algorithm: string; - - // @DataMember(Order=2) - public hash: string; + export class RegistrationDto { + public registrationInformation: AccessInformationDto; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class FileResourceDto { - // @DataMember(Order=1) - public id?: string; - - // @DataMember(Order=2) - public originalFileName: string; - - // @DataMember(Order=3) - public extension: string; - - // @DataMember(Order=4) - public storedFileName: string; - - // @DataMember(Order=5) - public sizeBytes?: number; - - // @DataMember(Order=6) - public checksum?: FileChecksumDto; + export class LoginDto { + public needChangePasswordOnNextLogin: boolean; + public lastAccessInformation?: AccessInformationDto; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (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', + export enum AuthStatus { + Registered = 0, + PendingValidation = 2, + Invited = 4, + Active = 8, + Unregistered = 16, + Suspended = 32, + InActive = 64, + Blocked = 128, } - // @DataContract - export class FileResourceRefDto { - // @DataMember(Order=1) - public resource: FileResourceDto; - - // @DataMember(Order=2) - public integrationId: string; - - // @DataMember(Order=3) - public provider: FileProvider; - - // @DataMember(Order=4) - public path: string; + 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(Order=5) - public publicUrl?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember(Order=6) - public isPublic: boolean; + export class PaginatedResponse { + public items: IList; + public hasMore: boolean; + public hasPrevious: boolean; + public startingAfter?: string; + public endingBefore?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial>) { (Object as any).assign(this, init); } } - // @DataContract - export class PublicFolderDto { - // @DataMember(Order=1) - public path: string; - - // @DataMember(Order=2) - public publicId: string; + export class UserMarketingPreferencesDto { + public blockAllMarketingMessages: boolean; + public blockedTags?: { [index: string]: HashSet }; + public blockReasons?: MarketingBlockReason[]; - // @DataMember(Order=3) - public publicUrl?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember(Order=4) - public inherited: boolean; + export class PasskeyListItemDto { + public credentialId: string; + public friendlyName: string; + public registeredOnUtc: string; + public lastUsedOnUtc: string; + public isRevoked: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class IntegrationTestResultItemDto { + export class TermMultiParentDto { // @DataMember - public operation: string; + public taxonomyId: string; // @DataMember - public result: string; + public parentId: string; // @DataMember - public errors?: IReadOnlyList; + public name?: string; - public constructor(init?: Partial) { + // @DataMember + public names?: { [index: string]: string }; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class OwnPushDeviceDto { + export class TermTreeDto { // @DataMember public id: string; // @DataMember - public provider: string; - - // @DataMember - public token: string; + public taxonomyId?: string; // @DataMember - public platform?: string; + public taxonomyName?: string; // @DataMember - public osName?: string; + public parentId?: string; // @DataMember - public osVersion?: string; + public order?: number; // @DataMember - public appVersion?: string; + public name?: string; // @DataMember - public deviceName?: string; + public names?: { [index: string]: string }; // @DataMember - public modelName?: string; + public slug?: string; // @DataMember - public brand?: string; + public description?: string; // @DataMember - public installationId?: string; + public descriptions?: { [index: string]: string }; // @DataMember - public locale?: string; + public multiParents?: TermMultiParentDto[]; // @DataMember - public timeZone?: string; + public meta?: Object; // @DataMember - public updatedAtUtc?: string; + public children?: TermTreeDto[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class OwnPushMessageDto { + export class TaxonomyTreeDto { // @DataMember - public id: string; + public viewId: string; // @DataMember - public campaignId: string; + public taxonomyName: string; // @DataMember - public title?: string; + public taxonomySlug: string; // @DataMember - public body?: string; - - // @DataMember - public sentAtUtc?: string; + public parentId?: string; // @DataMember - public isRead: boolean; + public children?: TaxonomyTreeDto[]; // @DataMember - public readAtUtc?: string; + public terms?: TermTreeDto[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class ResponseError { - // @DataMember(Order=1) - public errorCode: string; - - // @DataMember(Order=2) - public fieldName: string; + export class TermDto { + // @DataMember + public id: string; - // @DataMember(Order=3) - public message: string; + // @DataMember + public taxonomyId?: string; - // @DataMember(Order=4) - public meta?: { [index: string]: string }; + // @DataMember + public taxonomyName?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public parentId?: string; - // @DataContract - export class ResponseStatus { - // @DataMember(Order=1) - public errorCode: string; + // @DataMember + public order?: number; - // @DataMember(Order=2) - public message?: string; + // @DataMember + public name?: string; - // @DataMember(Order=3) - public stackTrace?: string; + // @DataMember + public names?: { [index: string]: string }; - // @DataMember(Order=4) - public errors?: ResponseError[]; + // @DataMember + public slug?: string; - // @DataMember(Order=5) - public meta?: { [index: string]: string }; + // @DataMember + public description?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public descriptions?: { [index: string]: string }; - export interface IBindableContract {} + // @DataMember + public multiParents?: TermMultiParentDto[]; - export interface IHasViewId { - viewId: string; - } + // @DataMember + public meta?: Object; - export interface ICursorArgs { - field: string; - order: number; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } } - export interface IQueuedTrigger { - viewId: string; - name: string; - order?: number; - breakOnError: boolean; - } + export class DataSchemaDto { + // @DataMember + public json: string; - export class EchoResponse { - 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 adminUrlTemplate?: string; - public emailServiceConfigured: boolean; - public rootBootstrapPasswordSource?: string; - public regions?: EchoRegionDto[]; - public agent?: EchoAgentDto; - public hostingPlatform?: EchoHostingPlatformDto; + // @DataMember + public fields: JsonSchemaFieldDto[] = []; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class PublicProjectConfigDto { - public displayName: string; - public adminPortalEnabled: boolean; - public branding?: PublicBrandDto; - public auth: PublicAuthDto; - public aiChat: PublicAiChatDto; + export class VisualSchemaDto { + // @DataMember + public json: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class PublicLegalDocumentDto { - public kind: string; - public title?: string; - public body: string; - public available: boolean; + export class SchemaSettingsDto { + // @DataMember + public softDelete: boolean; - public constructor(init?: Partial) { + // @DataMember + public hasRecordOwner: boolean; + + // @DataMember + public description?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - // @DataContract - export class IdResponse extends ResponseBase { + export class SchemaEmbedSettingsDto { // @DataMember - public id?: string; + public enabled: boolean; // @DataMember - public status?: string; + public fields: string[] = []; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public embeddingIntegrationId?: string; - export class ListEndUserChatAttachmentsResponse extends ResponseBase { - public attachments: EndUserChatAttachment[] = []; + // @DataMember + public perUser: boolean; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class EmptyResponse extends ResponseBase { - 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', } - export class ListEndUserChatMemoryResponse extends ResponseBase { - public notes: EndUserChatMemoryNote[] = []; - - 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', } - export class GetEndUserChatAvailabilityResponse extends ResponseBase { - public enabled: boolean; - public available: boolean; - public reason?: string; - public defaultAssistantId?: string; - public assistants: EndUserChatAssistant[] = []; - public plan?: EndUserChatPlan; + // @DataContract + export class TriggerActionDto { + // @DataMember + public type: TriggerActionType; - public constructor(init?: Partial) { - super(init); + // @DataMember + public integrationId?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class ListEndUserChatSessionsResponse extends ResponseBase { - public sessions: EndUserChatSession[] = []; + // @DataContract + export class TriggerDto implements IHasViewId, IQueuedTrigger { + // @DataMember + public type: TriggerType; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public viewId: string; - export class GetEndUserChatSessionResponse extends ResponseBase { - public session?: EndUserChatSession; + // @DataMember + public name: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public thenAction: TriggerActionDto; - export class GetEndUserChatEntriesResponse extends ResponseBase { - public sessionId?: string; - public entries: AiChatEntryWireDto[] = []; - public lastSeq: number; - public hasMore: boolean; + // @DataMember + public description?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public isEnabled: boolean; - export class StartEndUserChatTurnResponse extends ResponseBase { - public turnId?: string; - public sessionId?: string; - public channel?: string; + // @DataMember + public activationCode?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public order?: number; - export class GetEndUserAiToolsResponse extends ResponseBase { - public tools?: EndUserAiTool[]; + // @DataMember + public breakOnError: boolean; - public constructor(init?: Partial) { - super(init); + // @DataMember + public savedByAuthId?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class InvokeEndUserAiToolResponse extends ResponseBase { - public result?: 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 GetUserResponse extends ResponseBase { - public user?: AuthDto; + // @DataMember + public schemaSlug?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public version: number; - export class GetUsersResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataMember + public metaSchemaVersion: number; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public dataSchema: DataSchemaDto; - export class GetUserPreferencesResponse extends ResponseBase { - public preferences?: UserMarketingPreferencesDto; + // @DataMember + public visualSchema: VisualSchemaDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public publishedAt: string; - export class PasskeyOkResponse extends ResponseBase { - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public settings?: SchemaSettingsDto; - export class PasskeyCeremonyOptionsResponse extends ResponseBase { - public ceremonyId: string; - public optionsJson: string; + // @DataMember + public embed?: SchemaEmbedSettingsDto; - public constructor(init?: Partial) { - super(init); + // @DataMember + public triggers?: TriggerDto[]; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class PasskeyAuthTokensResponse extends ResponseBase { - public accessToken: string; - public refreshToken: string; - public expiresInSeconds: number; - public recoveryCodes?: string[]; + export class SchemaListProjection implements IHasViewId { + // @DataMember + public viewId: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public schemaName: string; - export class PasskeyListResponse extends ResponseBase { - public passkeys: PasskeyListItemDto[] = []; + // @DataMember + public schemaTitle: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public latestVersion?: number; - export class PasskeyRecoveryResponse extends ResponseBase { - public accessToken: string; - public refreshToken: string; - public expiresInSeconds: number; - public remainingCodes: number; + // @DataMember + public hasDraft: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public metaSchemaVersion: number; - export class PasskeyVerificationTokenResponse extends ResponseBase { - public verificationToken: string; + // @DataMember + public description?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember + public env?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class FindMergedTermTreeResponse extends ResponseBase { - public tree?: TermTreeDto[]; + // @DataContract + export class FileChecksumDto { + // @DataMember(Order=1) + public algorithm: string; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=2) + public hash: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class FindTaxonomyTreeResponse extends ResponseBase { - public tree?: TaxonomyTreeDto[]; + // @DataContract + export class FileResourceDto { + // @DataMember(Order=1) + public id?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Order=2) + public originalFileName: string; - export class FindTermsResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataMember(Order=3) + public extension: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Order=4) + public storedFileName: string; - export class FindTermsChildrenResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataMember(Order=5) + public sizeBytes?: number; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=6) + public checksum?: FileChecksumDto; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class FindTermTreeResponse extends ResponseBase { - public tree?: TermTreeDto[]; - - 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', } - export class GetDatabaseSchemaResponse extends ResponseBase { - public item?: SchemaDto; + // @DataContract + export class FileResourceRefDto { + // @DataMember(Order=1) + public resource: FileResourceDto; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Order=2) + public integrationId: string; - export class GetDatabaseSchemasResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataMember(Order=3) + public provider: FileProvider; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Order=4) + public path: string; - export class AggregateResponse extends ResponseBase { - public result?: Object[]; + // @DataMember(Order=5) + public publicUrl?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=6) + public isPublic: boolean; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class CountResponse extends ResponseBase { - public count: number; + // @DataContract + export class PublicFolderDto { + // @DataMember(Order=1) + public path: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember(Order=2) + public publicId: string; - export class DistinctResponse extends ResponseBase { - public values?: Object[]; + // @DataMember(Order=3) + public publicUrl?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=4) + public inherited: boolean; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class ExecuteAggregateResponse extends ResponseBase { - public result?: Object[]; + // @DataContract + export class IntegrationTestResultItemDto { + // @DataMember + public operation: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public result: string; - export class FindResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataMember + public errors?: IReadOnlyList; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class FindOneResponse extends ResponseBase { - public result?: Object; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataContract + export class OwnPushDeviceDto { + // @DataMember + public id: string; - export class GetFileByIdResponse extends ResponseBase { - public file?: FileResourceRefDto; - public isPublic?: boolean; - public publicUrl?: string; + // @DataMember + public provider: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public token: string; - export class GetFileInfoResponse extends ResponseBase { - public file?: FileResourceRefDto; - public isPublic?: boolean; - public publicUrl?: string; + // @DataMember + public platform?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public osName?: string; - export class GetSignedUrlResponse extends ResponseBase { - public url?: string; + // @DataMember + public osVersion?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public appVersion?: string; - export class ListFilesResponse extends ResponseBase { - public list?: PaginatedResponse; - public folders?: string[]; - public publicFolders?: IList; + // @DataMember + public deviceName?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public modelName?: string; - export class RequestUploadUrlResponse extends ResponseBase { - public url?: string; + // @DataMember + public brand?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember + public installationId?: string; + + // @DataMember + public locale?: string; + + // @DataMember + public timeZone?: string; + + // @DataMember + public updatedAtUtc?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } // @DataContract - export class TestFilesIntegrationResponse extends ResponseBase { + export class OwnPushMessageDto { // @DataMember - public items?: IReadOnlyList; + public id: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public campaignId: string; - export class GetOwnPushDevicesResponse extends ResponseBase { - public items: OwnPushDeviceDto[] = []; + // @DataMember + public title?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember + public body?: string; + + // @DataMember + public sentAtUtc?: string; + + // @DataMember + public isRead: boolean; + + // @DataMember + public readAtUtc?: string; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class GetOwnPushMessagesResponse extends ResponseBase { - public list?: PaginatedResponse; + // @DataContract + export class ResponseError { + // @DataMember(Order=1) + public errorCode: string; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=2) + public fieldName: string; + + // @DataMember(Order=3) + public message: string; + + // @DataMember(Order=4) + public meta?: { [index: string]: string }; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } // @DataContract - export class AuthenticateResponse implements IHasSessionId, IHasBearerToken { + export class ResponseStatus { // @DataMember(Order=1) - public userId?: string; + public errorCode: string; // @DataMember(Order=2) - public sessionId?: string; + public message?: string; // @DataMember(Order=3) - public userName?: string; + public stackTrace?: string; // @DataMember(Order=4) - public displayName?: string; + public errors?: ResponseError[]; // @DataMember(Order=5) - public referrerUrl?: string; + public meta?: { [index: string]: string }; - // @DataMember(Order=6) - public bearerToken?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember(Order=7) - public refreshToken?: string; + export interface IBindableContract {} - // @DataMember(Order=8) - public refreshTokenExpiry?: string; + export interface IHasViewId { + viewId: string; + } - // @DataMember(Order=9) - public profileUrl?: string; + export interface ICursorArgs { + field: string; + order: number; + } - // @DataMember(Order=10) - public roles?: string[]; + export interface IQueuedTrigger { + viewId: string; + name: string; + order?: number; + breakOnError: boolean; + } - // @DataMember(Order=11) - public permissions?: string[]; + export class EchoResponse { + 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 adminUrlTemplate?: string; + public emailServiceConfigured: boolean; + public rootBootstrapPasswordSource?: string; + public regions?: EchoRegionDto[]; + public agent?: EchoAgentDto; + public hostingPlatform?: EchoHostingPlatformDto; - // @DataMember(Order=12) - public authProvider?: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - // @DataMember(Order=13) - public responseStatus?: ResponseStatus; + export class PublicProjectConfigDto { + public displayName: string; + public adminPortalEnabled: boolean; + public branding?: PublicBrandDto; + public auth: PublicAuthDto; + public aiChat: PublicAiChatDto; - // @DataMember(Order=14) - public meta?: { [index: string]: string }; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - public constructor(init?: Partial) { + export class PublicLegalDocumentDto { + public kind: string; + public title?: string; + public body: string; + public available: boolean; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } } // @DataContract - export class GetAccessTokenResponse { - // @DataMember(Order=1) - public accessToken?: string; + export class IdResponse extends ResponseBase { + // @DataMember + public id?: string; - // @DataMember(Order=2) - public meta?: { [index: string]: string }; + // @DataMember + public status?: string; - // @DataMember(Order=3) - public responseStatus?: ResponseStatus; + // @DataMember + public warnings?: string[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @Route("/{version}/echo", "GET") - export class Echo extends RequestBase implements IReturn { - public constructor(init?: Partial) { + export class ListEndUserChatAttachmentsResponse extends ResponseBase { + public attachments: EndUserChatAttachment[] = []; + + 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(); - } } - // @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) { + export class EmptyResponse extends ResponseBase { + 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(); - } } - // @Route("/{version}/public/projects/{ProjectId}/config", "GET") - export class GetPublicProjectConfig - extends RequestBase - implements IReturn - { - public projectId?: string; + export class ListEndUserChatMemoryResponse extends ResponseBase { + public notes: EndUserChatMemoryNote[] = []; - public constructor(init?: Partial) { + 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(); - } } - // @Route("/{version}/public/projects/{ProjectId}/legal/{Kind}", "GET") - export class GetPublicProjectLegal - extends RequestBase - implements IReturn - { - public projectId?: string; - public kind?: string; + 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) { + 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(); - } } - /** @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; + export class ListEndUserChatSessionsResponse extends ResponseBase { + public sessions: EndUserChatSession[] = []; - public constructor(init?: Partial) { + 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(); - } } - /** @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; + export class GetEndUserChatSessionResponse extends ResponseBase { + public session?: EndUserChatSession; - public constructor(init?: Partial) { + 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; + export class GetEndUserChatEntriesResponse extends ResponseBase { + public sessionId?: string; + public entries: AiChatEntryWireDto[] = []; + public lastSeq: number; + public hasMore: boolean; - public constructor(init?: Partial) { + 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; + export class StartEndUserChatTurnResponse extends ResponseBase { + public turnId?: string; + public sessionId?: string; + public channel?: string; - public constructor(init?: Partial) { + 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; + export class GetEndUserAiToolsResponse extends ResponseBase { + public tools?: EndUserAiTool[]; - public constructor(init?: Partial) { + 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; + export class InvokeEndUserAiToolResponse extends ResponseBase { + public result?: string; - public constructor(init?: Partial) { + 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) { + export class GetUserResponse extends ResponseBase { + public user?: AuthDto; + + 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; + export class GetUsersResponse extends ResponseBase { + public list?: PaginatedResponse; - public constructor(init?: Partial) { + 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; + export class GetUserPreferencesResponse extends ResponseBase { + public preferences?: UserMarketingPreferencesDto; - public constructor(init?: Partial) { + 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(); + } + + export class PasskeyOkResponse extends ResponseBase { + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } } - /** @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; + export class PasskeyCeremonyOptionsResponse extends ResponseBase { + public ceremonyId: string; + public optionsJson: string; - public constructor(init?: Partial) { + 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; + export class PasskeyAuthTokensResponse extends ResponseBase { + public accessToken: string; + public refreshToken: string; + public expiresInSeconds: number; + public recoveryCodes?: string[]; - public constructor(init?: Partial) { + 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; + export class PasskeyListResponse extends ResponseBase { + public passkeys: PasskeyListItemDto[] = []; - public constructor(init?: Partial) { + 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; + export class PasskeyRecoveryResponse extends ResponseBase { + public accessToken: string; + public refreshToken: string; + public expiresInSeconds: number; + public remainingCodes: number; - public constructor(init?: Partial) { + 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; + export class PasskeyVerificationTokenResponse extends ResponseBase { + public verificationToken: string; - public constructor(init?: Partial) { + 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; + export class FindMergedTermTreeResponse extends ResponseBase { + public tree?: TermTreeDto[]; - public constructor(init?: Partial) { + 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; + export class FindTaxonomyTreeResponse extends ResponseBase { + public tree?: TaxonomyTreeDto[]; - public constructor(init?: Partial) { + 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) { + export class FindTermsResponse extends ResponseBase { + public list?: PaginatedResponse; + + 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; + export class FindTermsChildrenResponse extends ResponseBase { + public list?: PaginatedResponse; - public constructor(init?: Partial) { + 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; + export class FindTermTreeResponse extends ResponseBase { + public tree?: TermTreeDto[]; - public constructor(init?: Partial) { + 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) { + export class GetDatabaseSchemaResponse extends ResponseBase { + public item?: SchemaDto; + + 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) { + export class GetDatabaseSchemasResponse extends ResponseBase { + public list?: PaginatedResponse; + + 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; + export class AggregateResponse extends ResponseBase { + public result?: Object[]; - public constructor(init?: Partial) { + 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; + export class CountResponse extends ResponseBase { + public count: number; - public constructor(init?: Partial) { + 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; + export class DistinctResponse extends ResponseBase { + public values?: Object[]; - public constructor(init?: Partial) { + 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; + export class ExecuteAggregateResponse extends ResponseBase { + public result?: Object[]; - public constructor(init?: Partial) { + 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; + export class FindResponse extends ResponseBase { + public list?: PaginatedResponse; - public constructor(init?: Partial) { + 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; + export class FindOneResponse extends ResponseBase { + public result?: Object; - public constructor(init?: Partial) { + 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; + export class GetFileByIdResponse extends ResponseBase { + public file?: FileResourceRefDto; + public isPublic?: boolean; + public publicUrl?: 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 constructor(init?: Partial) { + export class GetFileInfoResponse extends ResponseBase { + public file?: FileResourceRefDto; + public isPublic?: boolean; + public publicUrl?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } - public getTypeName() { - return 'DeleteUserRequest'; + } + + export class GetSignedUrlResponse extends ResponseBase { + public url?: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } - public getMethod() { - return 'DELETE'; + } + + export class ListFilesResponse extends ResponseBase { + public list?: PaginatedResponse; + public folders?: string[]; + public publicFolders?: IList; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } - public createResponse() { - return new EmptyResponse(); + } + + export class RequestUploadUrlResponse extends ResponseBase { + public url?: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } } - /** @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. */ + export class TestFilesIntegrationResponse extends ResponseBase { // @DataMember - // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") - public databaseIntegrationId?: string; + public items?: IReadOnlyList; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } - public getTypeName() { - return 'GetUserRequest'; - } - public getMethod() { - return 'GET'; + } + + export class GetOwnPushDevicesResponse extends ResponseBase { + public items: OwnPushDeviceDto[] = []; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } - public createResponse() { - return new GetUserResponse(); + } + + export class GetOwnPushMessagesResponse extends ResponseBase { + public list?: PaginatedResponse; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); } } - /** @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; + export class AuthenticateResponse implements IHasSessionId, IHasBearerToken { + // @DataMember(Order=1) + public userId?: 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; + // @DataMember(Order=2) + public sessionId?: string; - /** @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; + // @DataMember(Order=3) + public userName?: string; - /** @description Only return users that have an email address. */ - // @DataMember - // @ApiMember(Description="Only return users that have an email address.") - public userShouldHaveEmail: boolean; + // @DataMember(Order=4) + public displayName?: string; - /** @description Include each user's metadata in the result. */ - // @DataMember - // @ApiMember(Description="Include each user's metadata in the result.") - public includeMeta: boolean; + // @DataMember(Order=5) + public referrerUrl?: string; - /** @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[]; + // @DataMember(Order=6) + public bearerToken?: string; - /** @description Filter to these specific user ids. */ - // @DataMember - // @ApiMember(Description="Filter to these specific user ids.") - public userIds?: string[]; + // @DataMember(Order=7) + public refreshToken?: string; - public constructor(init?: Partial) { - super(init); + // @DataMember(Order=8) + public refreshTokenExpiry?: string; + + // @DataMember(Order=9) + public profileUrl?: string; + + // @DataMember(Order=10) + public roles?: string[]; + + // @DataMember(Order=11) + public permissions?: string[]; + + // @DataMember(Order=12) + public authProvider?: string; + + // @DataMember(Order=13) + public responseStatus?: ResponseStatus; + + // @DataMember(Order=14) + public meta?: { [index: string]: string }; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + // @DataContract + export class GetAccessTokenResponse { + // @DataMember(Order=1) + public accessToken?: string; + + // @DataMember(Order=2) + public meta?: { [index: string]: string }; + + // @DataMember(Order=3) + public responseStatus?: ResponseStatus; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class SharedTypeGen { + public typegen_StringFieldDto?: StringFieldDto; + public typegen_DecimalFieldDto?: DecimalFieldDto; + public typegen_CurrencyFieldDto?: CurrencyFieldDto; + public typegen_BooleanFieldDto?: BooleanFieldDto; + public typegen_DateFieldDto?: DateFieldDto; + public typegen_IntegerFieldDto?: IntegerFieldDto; + public typegen_GeolocationFieldDto?: GeolocationFieldDto; + public typegen_TagsFieldDto?: TagsFieldDto; + public typegen_FileFieldDto?: FileFieldDto; + public typegen_TaxonomySelectionFieldDto?: TaxonomySelectionFieldDto; + public typegen_CollectionSelectionFieldDto?: CollectionSelectionFieldDto; + public typegen_UserSelectionFieldDto?: UserSelectionFieldDto; + public typegen_RoleSelectionFieldDto?: RoleSelectionFieldDto; + public typegen_EnumSelectionFieldDto?: EnumSelectionFieldDto; + public typegen_ObjectFieldDto?: ObjectFieldDto; + public typegen_ArrayFieldDto?: ArrayFieldDto; + public typegen_JsonFieldDto?: JsonFieldDto; + + public constructor(init?: Partial) { (Object as any).assign(this, init); } public getTypeName() { - return 'GetUsersRequest'; + return 'SharedTypeGen'; } public getMethod() { - return 'GET'; - } - public createResponse() { - return new GetUsersResponse(); + return 'POST'; } + public createResponse() {} } - /** @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) { + // @Route("/{version}/echo", "GET") + export class Echo extends RequestBase implements IReturn { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetUserPreferencesRequest'; + return 'Echo'; } public getMethod() { return 'GET'; } public createResponse() { - return new GetUserPreferencesResponse(); + return new EchoResponse(); } } - // @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; + // @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GrantContactConsentRequest'; + return 'GetPublicProjectBrandAsset'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new Blob(); } } - /** @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; + // @Route("/{version}/public/projects/{ProjectId}/config", "GET") + export class GetPublicProjectConfig + extends RequestBase + implements IReturn + { + public projectId?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'InviteUserRequest'; + return 'GetPublicProjectConfig'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new PublicProjectConfigDto(); } } - /** @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; + // @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'LinkIdentityRequest'; + return 'GetPublicProjectLegal'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new PublicLegalDocumentDto(); } } - /** @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; + /** @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'MapAuthToUserRequest'; + return 'UploadEndUserChatAttachmentRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new IdResponse(); } } - /** @description Membership */ - // @Route("/{version}/membership/auth/assign-roles", "PUT") - // @Api(Description="Membership") - // @DataContract - export class AssignRolePermissionsRequest - extends CodeMashRequestBase - implements IReturn + /** @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 { - /** @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 sessionId: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'AssignRolePermissionsRequest'; + return 'ListEndUserChatAttachmentsRequest'; } public getMethod() { - return 'PUT'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new ListEndUserChatAttachmentsResponse(); } } - /** @description Membership */ - // @Route("/{version}/membership/users/{userId}/roles", "PUT") - // @Api(Description="Membership") - // @DataContract - export class SetContactRolesRequest + /** @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 { - /** @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 attachmentId: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'SetContactRolesRequest'; + return 'DeleteEndUserChatAttachmentRequest'; } public getMethod() { - return 'PUT'; + return 'DELETE'; } public createResponse() { return new EmptyResponse(); } } - // @Route("/{version}/membership/users/{contactId}/marketing-state/{commChannel}/{channel}/tags/{tag}", "PUT") - export class SetContactTagSubscriptionRequest + /** @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 { - /** @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 sessionId: string; + public entryId: string; + public feedback?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'SetContactTagSubscriptionRequest'; + return 'SetEndUserChatEntryFeedbackRequest'; } public getMethod() { return 'PUT'; @@ -2834,2474 +2195,3238 @@ export module CodeMashApi2 { } } - /** @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; + /** @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UnblockUserRequest'; + return 'ListEndUserChatMemoryRequest'; } public getMethod() { - return 'PATCH'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new ListEndUserChatMemoryResponse(); } } - // @Route("/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe", "POST") - export class UnsubscribeContactRequest + /** @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 { - /** @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 noteId: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UnsubscribeContactRequest'; + return 'ForgetEndUserChatMemoryRequest'; } public getMethod() { - return 'POST'; + return 'DELETE'; } 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) { + /** @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 'UpdateUserRequest'; + return 'GetEndUserChatAvailabilityRequest'; } public getMethod() { - return 'PUT'; + return 'GET'; } public createResponse() { - return new IdResponse(); + return new GetEndUserChatAvailabilityResponse(); } } - /** @description Membership */ - // @Route("/{version}/membership/auth/{id}/preferences", "PUT") - // @Api(Description="Membership") - // @DataContract - export class UpdateUserPreferencesRequest + /** @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 + 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 take?: number; + public includeArchived: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UpdateUserPreferencesRequest'; + return 'ListEndUserChatSessionsRequest'; } public getMethod() { - return 'PUT'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new ListEndUserChatSessionsResponse(); } } - /** @description Membership · Password */ - // @Route("/{version}/membership/userauth/password/change", "POST") - // @Api(Description="Membership · Password") - // @DataContract - export class ChangePasswordRequest + /** @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 + 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 assistantId?: string; + public title?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ChangePasswordRequest'; + return 'CreateEndUserChatSessionRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new IdResponse(); } } - /** @description Membership · Password */ - // @Route("/{version}/membership/userauth/password/reset/request", "POST") - // @Api(Description="Membership · Password") - // @DataContract - export class RequestPasswordResetRequest + /** @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 + 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 sessionId: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RequestPasswordResetRequest'; + return 'GetEndUserChatSessionRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new PasskeyOkResponse(); + return new GetEndUserChatSessionResponse(); } } - /** @description Membership · Password */ - // @Route("/{version}/membership/userauth/password/reset/confirm", "POST") - // @Api(Description="Membership · Password") - // @DataContract - export class ConfirmPasswordResetRequest + /** @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 + 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 sessionId: string; + public title?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ConfirmPasswordResetRequest'; + return 'RenameEndUserChatSessionRequest'; } public getMethod() { - return 'POST'; + return 'PATCH'; } public createResponse() { - return new PasskeyOkResponse(); + return new EmptyResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkey/authentication-options", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class PasskeyAuthenticationOptionsRequest + /** @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, IPasskeyCeremonyRequest + implements IReturn { - // @DataMember - public email: string; + public sessionId: string; + public pinned: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'PasskeyAuthenticationOptionsRequest'; + return 'PinEndUserChatSessionRequest'; } public getMethod() { - return 'POST'; + return 'PUT'; } public createResponse() { - return new PasskeyCeremonyOptionsResponse(); + return new EmptyResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkey/verify-authentication", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class VerifyPasskeyAuthenticationRequest + /** @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, IPasskeyCeremonyRequest + implements IReturn { - // @DataMember - public ceremonyId: string; - - // @DataMember - public assertionResponse: string; + public sessionId: string; + public archived: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'VerifyPasskeyAuthenticationRequest'; + return 'ArchiveEndUserChatSessionRequest'; } public getMethod() { - return 'POST'; + return 'PUT'; } public createResponse() { - return new PasskeyAuthTokensResponse(); + return new EmptyResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkeys", "GET") - // @Api(Description="Membership · Passkey") - // @DataContract - export class ListPasskeysRequest + /** @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 + implements IReturn { - public constructor(init?: Partial) { + public sessionId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ListPasskeysRequest'; + return 'DeleteEndUserChatSessionRequest'; } public getMethod() { - return 'GET'; + return 'DELETE'; } public createResponse() { - return new PasskeyListResponse(); + return new EmptyResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/rename", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class RenamePasskeyRequest + /** @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 + 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 sessionId: string; + public afterSeq?: number; + public take?: number; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RenamePasskeyRequest'; + return 'GetEndUserChatEntriesRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new PasskeyOkResponse(); + return new GetEndUserChatEntriesResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/revoke", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class RevokePasskeyRequest + /** @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 + 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 sessionId?: string; + public assistantId?: string; + public message: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RevokePasskeyRequest'; + return 'StartEndUserChatTurnRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new StartEndUserChatTurnResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/recovery/use-code", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class UseRecoveryCodeRequest - extends CodeMashRequestBase - implements IReturn + /** @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 { - // @DataMember - public email: string; - - // @DataMember - public recoveryCode: string; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UseRecoveryCodeRequest'; + return 'GetEndUserAiToolsRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new PasskeyRecoveryResponse(); + return new GetEndUserAiToolsResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/recovery/magic-link/request", "POST") - // @Api(Description="Membership · Passkey") - // @DataContract - export class RequestMagicLinkRequest - extends CodeMashRequestBase - implements IReturn + /** @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 { - // @DataMember - public email: string; + public toolName: string; + public argumentsJson?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RequestMagicLinkRequest'; + return 'InvokeEndUserAiToolRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new InvokeEndUserAiToolResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/recovery/magic-link/consume", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/block", "PATCH") + // @Api(Description="Membership") // @DataContract - export class ConsumeMagicLinkRequest - extends CodeMashRequestBase - implements IReturn - { + export class BlockUserRequest extends CodeMashRequestBase implements IReturn { + /** @description Id of the user to block, from get_users. */ // @DataMember - public token: string; + // @ApiMember(Description="Id of the user to block, from get_users.", IsRequired=true) + public id: string; - public constructor(init?: Partial) { + /** @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 'ConsumeMagicLinkRequest'; + return 'BlockUserRequest'; } public getMethod() { - return 'POST'; + return 'PATCH'; } public createResponse() { - return new PasskeyRecoveryResponse(); + return new EmptyResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/has-passkey", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/service", "POST") + // @Api(Description="Membership") // @DataContract - export class HasPasskeyRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public email: string; - - public constructor(init?: Partial) { + export class SaveSystemUserWithPermissions + extends SaveUserWithRolesBase + implements IReturn + { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'HasPasskeyRequest'; + return 'SaveSystemUserWithPermissions'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/email/start-verification", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/guest", "POST") + // @Api(Description="Membership") // @DataContract - export class StartEmailVerificationRequest - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public email: string; - - public constructor(init?: Partial) { + export class SaveGuestUser extends SaveUser implements IReturn { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'StartEmailVerificationRequest'; + return 'SaveGuestUser'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/email/confirm-verification", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/phone", "POST") + // @Api(Description="Membership") // @DataContract - export class ConfirmEmailVerificationRequest - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public email: string; - + export class SavePhoneUser extends SaveUser implements IReturn { + /** @description Phone number for the new user, in E.164 format. */ // @DataMember - public code: string; + // @ApiMember(Description="Phone number for the new user, in E.164 format.", IsRequired=true) + public phone: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ConfirmEmailVerificationRequest'; + return 'SavePhoneUser'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyVerificationTokenResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkey/registration-options", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/user-name", "POST") + // @Api(Description="Membership") // @DataContract - export class PasskeyRegistrationOptionsRequest - extends CodeMashRequestBase - implements IReturn, IPasskeyCeremonyRequest + export class SaveUserNameUser + extends SaveUser + implements IReturn, IPublicRegistrationRequest { // @DataMember - public verificationToken: string; + public password: string; - public constructor(init?: Partial) { + // @DataMember + public userName: string; + + /** @description Optional roles from the project's "Permitted user registration roles". Empty = the default registration role. */ + // @DataMember + // @ApiMember(Description="Optional roles from the project's \"Permitted user registration roles\". Empty = the default registration role.") + public roles?: string[]; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'PasskeyRegistrationOptionsRequest'; + return 'SaveUserNameUser'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyCeremonyOptionsResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/passkey/verify-registration", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/email", "POST") + // @Api(Description="Membership") // @DataContract - export class VerifyPasskeyRegistrationRequest - extends CodeMashRequestBase - implements IReturn, IPasskeyCeremonyRequest + export class SaveEmailUser + extends SaveUser + implements IReturn, IPublicRegistrationRequest { // @DataMember - public verificationToken: string; - - // @DataMember - public ceremonyId: string; + public password: string; // @DataMember - public attestationResponse: string; + public email: string; + /** @description Optional roles from the project's "Permitted user registration roles". Empty = the default registration role. */ // @DataMember - public friendlyName?: string; + // @ApiMember(Description="Optional roles from the project's \"Permitted user registration roles\". Empty = the default registration role.") + public roles?: string[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'VerifyPasskeyRegistrationRequest'; + return 'SaveEmailUser'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyAuthTokensResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/token/refresh", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/phone-with-permissions", "POST") + // @Api(Description="Membership") // @DataContract - export class RefreshPasskeyTokenRequest - extends CodeMashRequestBase - implements IReturn + export class SavePhoneUserNameWithPermissions + extends SaveUserWithRolesBase + implements IReturn { // @DataMember - public refreshToken?: string; + public phone: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RefreshPasskeyTokenRequest'; + return 'SavePhoneUserNameWithPermissions'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyAuthTokensResponse(); + return new IdResponse(); } } - /** @description Membership · Passkey */ - // @Route("/{version}/membership/userauth/logout", "POST") - // @Api(Description="Membership · Passkey") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/email-with-permissions", "POST") + // @Api(Description="Membership") // @DataContract - export class PasskeyLogoutRequest - extends CodeMashRequestBase - implements IReturn + export class SaveEmailUserNameWithPermissions + extends SaveUserWithRolesBase + implements IReturn { // @DataMember - public refreshToken?: string; + public password: string; - public constructor(init?: Partial) { + // @DataMember + public email: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'PasskeyLogoutRequest'; + return 'SaveEmailUserNameWithPermissions'; } public getMethod() { return 'POST'; } public createResponse() { - return new PasskeyOkResponse(); + return new IdResponse(); } } - /** @description Database */ - // @Route("/{version}/database/taxonomies/{taxonomyName}/merged-tree", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/register/user-name-with-permissions", "POST") + // @Api(Description="Membership") // @DataContract - export class FindMergedTermTreeRequest - extends CodeMashRequestBase - implements IReturn + export class SaveUserNameWithPermissions + extends SaveUserWithRolesBase + implements IReturn { - /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ - // @DataMember - // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") - public allLanguages: boolean; - // @DataMember - public taxonomyName: string; + public password: string; // @DataMember - public databaseIntegrationId?: string; + public userName: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindMergedTermTreeRequest'; + return 'SaveUserNameWithPermissions'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new FindMergedTermTreeResponse(); + return new IdResponse(); } } - /** @description Database */ - // @Route("/{version}/database/taxonomies/tree", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth", "DELETE") + // @Api(Description="Membership") // @DataContract - export class FindTaxonomyTreeRequest - extends CodeMashRequestBase - implements IReturn - { - /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ - // @DataMember - // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") - public allLanguages: boolean; - + export class DeleteUserRequest extends CodeMashRequestBase implements IReturn { + /** @description Id of the user to delete, from get_users. */ // @DataMember - public includeTerms: boolean; + // @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindTaxonomyTreeRequest'; + return 'DeleteUserRequest'; } public getMethod() { - return 'GET'; + return 'DELETE'; } public createResponse() { - return new FindTaxonomyTreeResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/taxonomies/{taxonomyName}/terms", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}", "GET") + // @Api(Description="Membership") // @DataContract - export class FindTermsRequest - extends CodeMashListPaginationRequestBase - implements IReturn - { - /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ - // @DataMember - // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") - public allLanguages: boolean; - + export class GetUserRequest extends CodeMashRequestBase implements IReturn { + /** @description Id of the user to fetch, from get_users. */ // @DataMember - public taxonomyName: string; + // @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; - // @DataMember - public filter?: string; - - // @DataMember - public sortDescending: boolean; - - // @DataMember - public pagingArgs?: PagingArgs; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindTermsRequest'; + return 'GetUserRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new FindTermsResponse(); + return new GetUserResponse(); } } - /** @description Database */ - // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth", "GET") + // @Api(Description="Membership") // @DataContract - export class FindTermsChildrenRequest + export class GetUsersRequest extends CodeMashListPaginationRequestBase - implements IReturn + implements IReturn { - /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + /** @description Database integration id. Optional — defaults to the request environment's default integration. */ // @DataMember - // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") - public allLanguages: boolean; + // @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 - public taxonomyName: string; + // @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 - public parentId: string; + // @ApiMember(Description="Only return users that have a registered push device.") + public userShouldHavePushDevice: boolean; + /** @description Only return users that have an email address. */ // @DataMember - public databaseIntegrationId?: string; + // @ApiMember(Description="Only return users that have an email address.") + public userShouldHaveEmail: boolean; + /** @description Include each user's metadata in the result. */ // @DataMember - public filter?: string; + // @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 - public pagingArgs?: PagingArgs; + // @ApiMember(Description="Filter to users that have any of these role names.") + public roleNames?: string[]; - 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 Filter to these specific user ids. */ + // @DataMember + // @ApiMember(Description="Filter to these specific user ids.") + public userIds?: string[]; - /** @description Database */ - // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/tree", "GET") - // @Api(Description="Database") - // @DataContract - export class FindTermTreeRequest - extends CodeMashRequestBase - implements IReturn - { - /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + /** @description Free text, case-insensitive: matches email, user name, display / first / last name or phone. */ // @DataMember - // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") - public allLanguages: boolean; + // @ApiMember(Description="Free text, case-insensitive: matches email, user name, display / first / last name or phone.") + public search?: string; + /** @description Case-insensitive part of the email. */ // @DataMember - public taxonomyName: string; + // @ApiMember(Description="Case-insensitive part of the email.") + public email?: string; + /** @description Case-insensitive part of the user name. */ // @DataMember - public rootTermId?: string; + // @ApiMember(Description="Case-insensitive part of the user name.") + public userName?: string; + /** @description Status names, any of: Registered, PendingValidation, Active, Unregistered, Suspended, InActive, Blocked. */ // @DataMember - public depth?: number; + // @ApiMember(Description="Status names, any of: Registered, PendingValidation, Active, Unregistered, Suspended, InActive, Blocked.") + public statuses?: string[]; + /** @description Login type names, any of: Service, Email, UserName, Phone, Guest, Social. */ // @DataMember - public databaseIntegrationId?: string; + // @ApiMember(Description="Login type names, any of: Service, Email, UserName, Phone, Guest, Social.") + public types?: string[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindTermTreeRequest'; + return 'GetUsersRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new FindTermTreeResponse(); + return new GetUsersResponse(); } } - /** @description Database */ - // @Route("/{version}/database/schemas/{id}", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}/preferences", "GET") + // @Api(Description="Membership") // @DataContract - export class GetDatabaseSchemaRequest + export class GetUserPreferencesRequest extends CodeMashRequestBase - implements IReturn + 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; - public constructor(init?: Partial) { + /** @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 'GetDatabaseSchemaRequest'; + return 'GetUserPreferencesRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new GetDatabaseSchemaResponse(); + return new GetUserPreferencesResponse(); } } - /** @description Database */ - // @Route("/{version}/database/schemas", "GET") - // @Api(Description="Database") - // @DataContract - export class GetDatabaseSchemasRequest - extends CodeMashListPaginationRequestBase - implements IReturn + // @Route("/{version}/membership/users/{contactId}/marketing-state/{channel}/consent", "POST") + export class GrantContactConsentRequest + extends CodeMashRequestBase + implements IReturn { - // @DataMember - public pagingArgs?: PagingArgs; + /** @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; - public constructor(init?: Partial) { + /** @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 'GetDatabaseSchemasRequest'; + return 'GrantContactConsentRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new GetDatabaseSchemasResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/aggregate", "POST") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/invite", "POST") + // @Api(Description="Membership") // @DataContract - export class AggregateRequest extends CodeMashRequestBase implements IReturn { + export class InviteUserRequest extends CodeMashRequestBase implements IReturn { + /** @description Email address the invitation is sent to. */ // @DataMember - public collectionName: string; + // @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; - // @DataMember - public pipeline: string; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'AggregateRequest'; + return 'InviteUserRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new AggregateResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/{id}/responsibility", "PUT") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/invitation/finish", "POST") + // @Api(Description="Membership") // @DataContract - export class ChangeResponsibilityRequest + export class FinishInvitationRequest extends CodeMashRequestBase implements IReturn { + /** @description One-time invitation token from the e-mail link (the #token= fragment). */ // @DataMember - public collectionName: string; + // @ApiMember(Description="One-time invitation token from the e-mail link (the #token= fragment).", IsRequired=true) + public token: string; + /** @description The user's password. Validated against the project's complexity policy. */ // @DataMember - public id: string; + // @ApiMember(Description="The user's password. Validated against the project's complexity policy.", IsRequired=true) + public password: string; + /** @description Optional display name. */ // @DataMember - public databaseIntegrationId?: string; + // @ApiMember(Description="Optional display name.") + public displayName?: string; + /** @description Optional first name. */ // @DataMember - public newResponsibleUserId: string; + // @ApiMember(Description="Optional first name.") + public firstName?: string; - public constructor(init?: Partial) { + /** @description Optional last name. */ + // @DataMember + // @ApiMember(Description="Optional last name.") + public lastName?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ChangeResponsibilityRequest'; + return 'FinishInvitationRequest'; } public getMethod() { - return 'PUT'; + return 'POST'; } public createResponse() { return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/count", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/{userId}/link-identity", "POST") + // @Api(Description="Membership") // @DataContract - export class CountRequest extends CodeMashRequestBase implements IReturn { + export class LinkIdentityRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public collectionName: string; + public userId: string; // @DataMember - public databaseIntegrationId?: string; + public provider: string; // @DataMember - public filter?: string; + public providerToken: string; // @DataMember - public schemaVersion?: number; + public emailToVerify?: string; - public constructor(init?: Partial) { + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'CountRequest'; + return 'LinkIdentityRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new CountResponse(); + return new EmptyResponse(); } } - /** @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 + /** @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; - // @DataMember - public filter: string; - - // @DataMember - public allRecords?: boolean; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DeleteManyRequest'; + return 'MapAuthToUserRequest'; } public getMethod() { - return 'DELETE'; + return 'POST'; } public createResponse() { return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/{id}", "DELETE") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/assign-roles", "PUT") + // @Api(Description="Membership") // @DataContract - export class DeleteOneRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - + 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; - public constructor(init?: Partial) { + /** @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 'DeleteOneRequest'; + return 'AssignRolePermissionsRequest'; } public getMethod() { - return 'DELETE'; + return 'PUT'; } public createResponse() { return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/distinct", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/users/{userId}/roles", "PUT") + // @Api(Description="Membership") // @DataContract - export class DistinctRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - - // @DataMember - public databaseIntegrationId?: string; - + export class SetContactRolesRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Id of the human user to assign roles to. */ // @DataMember - public field: string; + // @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 - public filter?: string; + // @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 - public schemaVersion?: number; + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DistinctRequest'; + return 'SetContactRolesRequest'; } public getMethod() { - return 'GET'; + return 'PUT'; } public createResponse() { - return new DistinctResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/aggregates/{aggregateId}/execute", "POST") - // @Api(Description="Database") - // @DataContract - export class ExecuteAggregateRequest + // @Route("/{version}/membership/users/{contactId}/marketing-state/{commChannel}/{channel}/tags/{tag}", "PUT") + export class SetContactTagSubscriptionRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { - // @DataMember - public collectionName: string; + /** @description Id of the user (contact) to update. */ + // @ApiMember(Description="Id of the user (contact) to update.", IsRequired=true) + public contactId: string; - // @DataMember - public aggregateId: string; + /** @description Communication channel type: Marketing or Transactional. */ + // @ApiMember(Description="Communication channel type: Marketing or Transactional.", IsRequired=true) + public commChannel: string; - // @DataMember - public databaseIntegrationId?: string; + /** @description Delivery channel: Email, Sms, or Push. */ + // @ApiMember(Description="Delivery channel: Email, Sms, or Push.", IsRequired=true) + public channel: string; - // @DataMember - public tokens?: { [index: string]: 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; - public constructor(init?: Partial) { + /** @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 'ExecuteAggregateRequest'; + return 'SetContactTagSubscriptionRequest'; } public getMethod() { - return 'POST'; + return 'PUT'; } public createResponse() { - return new ExecuteAggregateResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/unblock", "PATCH") + // @Api(Description="Membership") // @DataContract - export class FindRequest - extends CodeMashListPaginationRequestBase - implements IReturn - { + export class UnblockUserRequest extends CodeMashRequestBase implements IReturn { + /** @description Id of the user to unblock, from get_users. */ // @DataMember - public collectionName: string; + // @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; - // @DataMember - public filter?: string; - - // @DataMember - public schemaVersion?: number; - - // @DataMember - public pagingArgs?: PagingArgs; - - // @DataMember - public sortBy?: 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(); + } + } - // @DataMember - public sortOrder?: number; + // @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; - // @DataMember - public expandReferences: boolean; + /** @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; - // @DataMember - public allLanguages: boolean; + /** @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) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindRequest'; + return 'UnsubscribeContactRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new FindResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/{id}", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth", "PUT") + // @Api(Description="Membership") // @DataContract - export class FindOneRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - + 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; - // @DataMember - public databaseIntegrationId?: string; - - // @DataMember - public expandReferences: boolean; - - // @DataMember - public allLanguages: boolean; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindOneRequest'; + return 'UpdateUserRequest'; } public getMethod() { - return 'GET'; + return 'PUT'; } public createResponse() { - return new FindOneResponse(); + return new IdResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/own", "GET") - // @Api(Description="Database") + /** @description Membership */ + // @Route("/{version}/membership/auth/{id}/preferences", "PUT") + // @Api(Description="Membership") // @DataContract - export class FindOwnRequest - extends CodeMashListPaginationRequestBase - implements IReturn + export class UpdateUserPreferencesRequest + extends CodeMashRequestBase + implements IReturn { + /** @description Id of the user to update, from get_users. */ // @DataMember - public collectionName: string; - - // @DataMember - public databaseIntegrationId?: string; - - // @DataMember - public filter?: string; - - // @DataMember - public schemaVersion?: number; + // @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 - public pagingArgs?: PagingArgs; + // @ApiMember(Description="When true, blocks all marketing messages to this user.") + public blockAllMarketingMessages: boolean; - /** @description Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids. */ + /** @description Per communication channel, the set of tags blocked for this user. Full replacement. */ // @DataMember - // @ApiMember(Description="Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids.") - public expandReferences: boolean; + // @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 - public allLanguages: boolean; + // @ApiMember(Description="Database integration id. Optional — defaults to the project's default integration.") + public databaseIntegrationId?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'FindOwnRequest'; + return 'UpdateUserPreferencesRequest'; } public getMethod() { - return 'GET'; + return 'PUT'; } public createResponse() { - return new FindResponse(); + return new EmptyResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/many", "POST") - // @Api(Description="Database") + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/change", "POST") + // @Api(Description="Membership · Password") // @DataContract - export class InsertManyRequest extends CodeMashRequestBase implements IReturn { + export class ChangePasswordRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description The member's current password. */ // @DataMember - public collectionName: string; + // @ApiMember(Description="The member's current password.", IsRequired=true) + public currentPassword: string; + /** @description The new password. Validated against the project's complexity policy. */ // @DataMember - public databaseIntegrationId?: string; + // @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 - public documents: string; + // @ApiMember(Description="Database integration id. Optional — defaults to the request environment's default integration.") + public databaseIntegrationId?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'InsertManyRequest'; + return 'ChangePasswordRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyOkResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}", "POST") - // @Api(Description="Database") + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/reset/request", "POST") + // @Api(Description="Membership · Password") // @DataContract - export class InsertOneRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - - // @DataMember - public databaseIntegrationId?: string; - + export class RequestPasswordResetRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Email address to send the reset link to. */ // @DataMember - public document: string; + // @ApiMember(Description="Email address to send the reset link to.", IsRequired=true) + public email: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'InsertOneRequest'; + return 'RequestPasswordResetRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new IdResponse(); + return new PasskeyOkResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/{id}/replace", "PUT") - // @Api(Description="Database") + /** @description Membership · Password */ + // @Route("/{version}/membership/userauth/password/reset/confirm", "POST") + // @Api(Description="Membership · Password") // @DataContract - export class ReplaceOneRequest extends CodeMashRequestBase implements IReturn { + export class ConfirmPasswordResetRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description One-time reset token from the email link. */ // @DataMember - public collectionName: string; + // @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 - public id: string; + // @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; - // @DataMember - public replacement: string; - - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ReplaceOneRequest'; + return 'ConfirmPasswordResetRequest'; } public getMethod() { - return 'PUT'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyOkResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/many", "PUT") - // @Api(Description="Database") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/authentication-options", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class UpdateManyRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - - // @DataMember - public databaseIntegrationId?: string; - - // @DataMember - public filter: string; - - // @DataMember - public allRecords?: boolean; - - // @DataMember - public update: string; - + export class PasskeyAuthenticationOptionsRequest + extends CodeMashRequestBase + implements IReturn, IPasskeyCeremonyRequest + { // @DataMember - public arrayFilters?: string; + public email: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UpdateManyRequest'; + return 'PasskeyAuthenticationOptionsRequest'; } public getMethod() { - return 'PUT'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyCeremonyOptionsResponse(); } } - /** @description Database */ - // @Route("/{version}/database/collections/{collectionName}/{id}", "PUT") - // @Api(Description="Database") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/verify-authentication", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class UpdateOneRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public collectionName: string; - - // @DataMember - public id: string; - - // @DataMember - public databaseIntegrationId?: string; - + export class VerifyPasskeyAuthenticationRequest + extends CodeMashRequestBase + implements IReturn, IPasskeyCeremonyRequest + { // @DataMember - public update: string; + public ceremonyId: string; // @DataMember - public arrayFilters?: string; + public assertionResponse: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UpdateOneRequest'; + return 'VerifyPasskeyAuthenticationRequest'; } public getMethod() { - return 'PUT'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyAuthTokensResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/commit", "POST") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys", "GET") + // @Api(Description="Membership · Passkey") // @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) { + export class ListPasskeysRequest + extends CodeMashRequestBase + implements IReturn + { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'CommitUploadRequest'; + return 'ListPasskeysRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyListResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/content", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/rename", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class GetFileContentRequest extends RequestBase implements IReturn { - // @DataMember - public filesIntegrationId: string; - + export class RenamePasskeyRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Base64 credential id of the passkey to rename, from list_passkeys. */ // @DataMember - public path: string; + // @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 - public token?: string; + // @ApiMember(Description="The new friendly name for the passkey.", IsRequired=true) + public friendlyName: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetFileContentRequest'; + return 'RenamePasskeyRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new Blob(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/content", "PUT") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkeys/{CredentialId}/revoke", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class PutFileContentRequest extends RequestBase implements IReturn { - // @DataMember - public filesIntegrationId: string; - - // @DataMember - public path: string; - + export class RevokePasskeyRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Base64 credential id of the passkey to revoke, from list_passkeys. */ // @DataMember - public token?: string; + // @ApiMember(Description="Base64 credential id of the passkey to revoke, from list_passkeys.", IsRequired=true) + public credentialId: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'PutFileContentRequest'; + return 'RevokePasskeyRequest'; } public getMethod() { - return 'PUT'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}", "DELETE") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/use-code", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class DeleteFileApiRequest extends CodeMashRequestBase implements IReturn { + export class UseRecoveryCodeRequest + extends CodeMashRequestBase + implements IReturn + { // @DataMember - public filesIntegrationId: string; + public email: string; // @DataMember - public path: string; + public recoveryCode: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DeleteFileApiRequest'; + return 'UseRecoveryCodeRequest'; } public getMethod() { - return 'DELETE'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyRecoveryResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/bulk", "DELETE") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/magic-link/request", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class DeleteManyFilesApiRequest + export class RequestMagicLinkRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { // @DataMember - public filesIntegrationId: string; - - // @DataMember(Name="paths[]") - public paths__: string[] = []; + public email: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DeleteManyFilesApiRequest'; + return 'RequestMagicLinkRequest'; } public getMethod() { - return 'DELETE'; + return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/download", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/recovery/magic-link/consume", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class DownloadFileApiRequest extends CodeMashRequestBase implements IReturn { - // @DataMember - public filesIntegrationId: string; - + export class ConsumeMagicLinkRequest + extends CodeMashRequestBase + implements IReturn + { // @DataMember - public path: string; + public token: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DownloadFileApiRequest'; + return 'ConsumeMagicLinkRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new Blob(); + return new PasskeyRecoveryResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/by-id/{id}", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/has-passkey", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class GetFileByIdRequest - extends CodeMashRequestBase - implements IReturn - { - // @DataMember - public filesIntegrationId: string; - + export class HasPasskeyRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public id: string; + public email: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetFileByIdRequest'; + return 'HasPasskeyRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new GetFileByIdResponse(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/info", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/email/start-verification", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class GetFileInfoRequest + export class StartEmailVerificationRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { // @DataMember - public filesIntegrationId: string; - - // @DataMember - public path: string; + public email: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetFileInfoRequest'; + return 'StartEmailVerificationRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new GetFileInfoResponse(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/sign", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/email/confirm-verification", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class GetSignedUrlRequest + export class ConfirmEmailVerificationRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { // @DataMember - public filesIntegrationId: string; - - // @DataMember - public path: string; + public email: string; // @DataMember - public expirationSeconds?: number; + public code: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetSignedUrlRequest'; + return 'ConfirmEmailVerificationRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new GetSignedUrlResponse(); + return new PasskeyVerificationTokenResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/registration-options", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class ListFilesRequest - extends CodeMashListPaginationRequestBase - implements IReturn + export class PasskeyRegistrationOptionsRequest + extends CodeMashRequestBase + implements IReturn, IPasskeyCeremonyRequest { // @DataMember - public filesIntegrationId: string; - - // @DataMember - public path?: string; + public verificationToken: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'ListFilesRequest'; + return 'PasskeyRegistrationOptionsRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new ListFilesResponse(); + return new PasskeyCeremonyOptionsResponse(); } } - /** @description Files */ - // @Route("/{version}/files/public/{PublicId}/{Name*}", "GET") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/passkey/verify-registration", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class GetPublicFileRequest extends RequestBase implements IReturn { + export class VerifyPasskeyRegistrationRequest + extends CodeMashRequestBase + implements IReturn, IPasskeyCeremonyRequest + { // @DataMember - public publicId?: string; + public verificationToken: string; // @DataMember - public name?: string; + public ceremonyId: string; - public constructor(init?: Partial) { + // @DataMember + public attestationResponse: string; + + // @DataMember + public friendlyName?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetPublicFileRequest'; + return 'VerifyPasskeyRegistrationRequest'; } public getMethod() { - return 'GET'; + return 'POST'; } public createResponse() { - return new Blob(); + return new PasskeyAuthTokensResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/upload-url", "POST") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/token/refresh", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class RequestUploadUrlRequest + export class RefreshPasskeyTokenRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { // @DataMember - public filesIntegrationId: string; - - // @DataMember - public path: string; - - // @DataMember - public contentType: string; - - // @DataMember - public expirationSeconds?: number; + public refreshToken?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RequestUploadUrlRequest'; + return 'RefreshPasskeyTokenRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new RequestUploadUrlResponse(); + return new PasskeyAuthTokensResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/test", "POST") - // @Api(Description="Files") + /** @description Membership · Passkey */ + // @Route("/{version}/membership/userauth/logout", "POST") + // @Api(Description="Membership · Passkey") // @DataContract - export class TestFilesIntegrationRequest + export class PasskeyLogoutRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { // @DataMember - public filesIntegrationId: string; + public refreshToken?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'TestFilesIntegrationRequest'; + return 'PasskeyLogoutRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new TestFilesIntegrationResponse(); + return new PasskeyOkResponse(); } } - /** @description Files */ - // @Route("/{version}/files/{filesIntegrationId}/use", "POST") - // @Api(Description="Files") + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/merged-tree", "GET") + // @Api(Description="Database") // @DataContract - export class UseFileRequest extends CodeMashRequestBase implements IReturn { + export class FindMergedTermTreeRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ // @DataMember - public filesIntegrationId: string; + // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") + public allLanguages: boolean; // @DataMember - public path: string; + public taxonomyName: string; - public constructor(init?: Partial) { + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'UseFileRequest'; + return 'FindMergedTermTreeRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new IdResponse(); + return new FindMergedTermTreeResponse(); } } - /** @description Registers or refreshes a push device for the signed-in user. */ - // @Route("/{version}/notifications/push/devices", "POST") - // @Api(Description="Registers or refreshes a push device for the signed-in user.") - export class RegisterOwnPushDeviceRequest + /** @description Database */ + // @Route("/{version}/database/taxonomies/tree", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTaxonomyTreeRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { - /** @description Who issued the token: expo (getExpoPushTokenAsync), fcm (Android / Firebase) or apns (iOS). */ - // @ApiMember(Description="Who issued the token: expo (getExpoPushTokenAsync), fcm (Android / Firebase) or apns (iOS).", IsRequired=true) - public provider: string; + /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + // @DataMember + // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") + public allLanguages: boolean; - /** @description The push token, exactly as the provider gave it. */ - // @ApiMember(Description="The push token, exactly as the provider gave it.", IsRequired=true) - public token: string; + // @DataMember + public includeTerms: boolean; - /** @description The app's platform: ios, android or web. */ - // @ApiMember(Description="The app's platform: ios, android or web.") - public platform?: string; - - /** @description Operating system name, e.g. iOS. */ - // @ApiMember(Description="Operating system name, e.g. iOS.") - public osName?: string; + // @DataMember + public databaseIntegrationId?: string; - /** @description Operating system version, e.g. 18.1. */ - // @ApiMember(Description="Operating system version, e.g. 18.1.") - public osVersion?: 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 The app version, e.g. 2.4.1. */ - // @ApiMember(Description="The app version, e.g. 2.4.1.") - public appVersion?: string; + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermsRequest + extends CodeMashListPaginationRequestBase + implements IReturn + { + /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + // @DataMember + // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") + public allLanguages: boolean; - /** @description The device name the user sees, e.g. Anna's iPhone. */ - // @ApiMember(Description="The device name the user sees, e.g. Anna's iPhone.") - public deviceName?: string; + // @DataMember + public taxonomyName: string; - /** @description The device model, e.g. iPhone 15. */ - // @ApiMember(Description="The device model, e.g. iPhone 15.") - public modelName?: string; + // @DataMember + public databaseIntegrationId?: string; - public brand?: string; - public manufacturer?: string; - /** @description A stable id the app keeps for this installation (not the token). */ - // @ApiMember(Description="A stable id the app keeps for this installation (not the token).") - public installationId?: string; + // @DataMember + public filter?: string; - /** @description The device locale, e.g. lt-LT. */ - // @ApiMember(Description="The device locale, e.g. lt-LT.") - public locale?: string; + // @DataMember + public sortDescending: boolean; - /** @description The device time zone (IANA), e.g. Europe/Vilnius. */ - // @ApiMember(Description="The device time zone (IANA), e.g. Europe/Vilnius.") - public timeZone?: string; + // @DataMember + public pagingArgs?: PagingArgs; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RegisterOwnPushDeviceRequest'; + return 'FindTermsRequest'; } public getMethod() { - return 'POST'; + return 'GET'; } public createResponse() { - return new IdResponse(); + return new FindTermsResponse(); } } - /** @description Lists the signed-in user's own push devices. */ - // @Route("/{version}/notifications/push/devices", "GET") - // @Api(Description="Lists the signed-in user's own push devices.") - export class GetOwnPushDevicesRequest - extends CodeMashRequestBase - implements IReturn + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/{parentId}/children", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermsChildrenRequest + extends CodeMashListPaginationRequestBase + implements IReturn { - public constructor(init?: Partial) { + /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + // @DataMember + // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") + public allLanguages: boolean; + + // @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 'GetOwnPushDevicesRequest'; + return 'FindTermsChildrenRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new GetOwnPushDevicesResponse(); + return new FindTermsChildrenResponse(); } } - /** @description Removes one of the signed-in user's own push devices by id. */ - // @Route("/{version}/notifications/push/devices/{Id}", "DELETE") - // @Api(Description="Removes one of the signed-in user's own push devices by id.") - export class DeleteOwnPushDeviceRequest + /** @description Database */ + // @Route("/{version}/database/taxonomies/{taxonomyName}/terms/tree", "GET") + // @Api(Description="Database") + // @DataContract + export class FindTermTreeRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { - /** @description The device id (pnd_…) from the devices list or the register answer. */ - // @ApiMember(Description="The device id (pnd_…) from the devices list or the register answer.", IsRequired=true) - public id: string; + /** @description Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions. */ + // @DataMember + // @ApiMember(Description="Set true to keep name / description as stored even when Accept-Language is sent (editors). The full translations are always in names / descriptions.") + public allLanguages: boolean; - public constructor(init?: Partial) { + // @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 'DeleteOwnPushDeviceRequest'; + return 'FindTermTreeRequest'; } public getMethod() { - return 'DELETE'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new FindTermTreeResponse(); } } - /** @description Removes the signed-in user's push device registered with a token (sign-out). */ - // @Route("/{version}/notifications/push/devices", "DELETE") - // @Api(Description="Removes the signed-in user's push device registered with a token (sign-out).") - export class DeleteOwnPushDeviceByTokenRequest + /** @description Database */ + // @Route("/{version}/database/schemas/{id}", "GET") + // @Api(Description="Database") + // @DataContract + export class GetDatabaseSchemaRequest extends CodeMashRequestBase - implements IReturn + implements IReturn { - /** @description The push token the device was registered with. */ - // @ApiMember(Description="The push token the device was registered with.", IsRequired=true) - public token: string; + // @DataMember + public id: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'DeleteOwnPushDeviceByTokenRequest'; + return 'GetDatabaseSchemaRequest'; } public getMethod() { - return 'DELETE'; + return 'GET'; } public createResponse() { - return new EmptyResponse(); + return new GetDatabaseSchemaResponse(); } } - /** @description Lists the push messages sent to the signed-in user. */ - // @Route("/{version}/notifications/push/messages", "GET") - // @Api(Description="Lists the push messages sent to the signed-in user.") - export class GetOwnPushMessagesRequest + /** @description Database */ + // @Route("/{version}/database/schemas", "GET") + // @Api(Description="Database") + // @DataContract + export class GetDatabaseSchemasRequest extends CodeMashListPaginationRequestBase - implements IReturn + implements IReturn { - /** @description Only messages the caller has not marked read. */ - // @ApiMember(Description="Only messages the caller has not marked read.") - public unreadOnly: boolean; + // @DataMember + public pagingArgs?: PagingArgs; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetOwnPushMessagesRequest'; + return 'GetDatabaseSchemasRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new GetOwnPushMessagesResponse(); + return new GetDatabaseSchemasResponse(); } } - /** @description Marks one push message sent to the signed-in user read. */ - // @Route("/{version}/notifications/push/messages/{Id}/read", "POST") - // @Api(Description="Marks one push message sent to the signed-in user read.") - export class MarkOwnPushMessageReadRequest - extends CodeMashRequestBase - implements IReturn - { - /** @description The message id (ntf_…) from the messages list. */ - // @ApiMember(Description="The message id (ntf_…) from the messages list.", IsRequired=true) - public id: string; + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/aggregate", "POST") + // @Api(Description="Database") + // @DataContract + export class AggregateRequest extends CodeMashRequestBase implements IReturn { + // @DataMember + public collectionName: string; - public constructor(init?: Partial) { + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public pipeline: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'MarkOwnPushMessageReadRequest'; + return 'AggregateRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new EmptyResponse(); + return new AggregateResponse(); } } - /** @description Marks every push message sent to the signed-in user read. */ - // @Route("/{version}/notifications/push/messages/read", "POST") - // @Api(Description="Marks every push message sent to the signed-in user read.") - export class MarkAllOwnPushMessagesReadRequest + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}/responsibility", "PUT") + // @Api(Description="Database") + // @DataContract + export class ChangeResponsibilityRequest extends CodeMashRequestBase implements IReturn { - public constructor(init?: Partial) { + // @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 'MarkAllOwnPushMessagesReadRequest'; + return 'ChangeResponsibilityRequest'; } public getMethod() { - return 'POST'; + return 'PUT'; } public createResponse() { return new EmptyResponse(); } } - /** @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") + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/count", "GET") + // @Api(Description="Database") // @DataContract - export class Authenticate implements IReturn, IPost { - /** @description AuthProvider, e.g. credentials */ - // @DataMember(Order=1) - public provider?: string; + export class CountRequest extends CodeMashRequestBase implements IReturn { + // @DataMember + public collectionName: string; - // @DataMember(Order=2) - public userName?: string; + // @DataMember + public databaseIntegrationId?: string; - // @DataMember(Order=3) - public password?: string; + // @DataMember + public filter?: string; - // @DataMember(Order=4) - public rememberMe?: boolean; + // @DataMember + public schemaVersion?: number; - // @DataMember(Order=5) - public accessToken?: string; + 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(); + } + } - // @DataMember(Order=6) - public accessTokenSecret?: string; + /** @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(Order=7) - public returnUrl?: string; + // @DataMember + public databaseIntegrationId?: string; - // @DataMember(Order=8) - public errorView?: string; + // @DataMember + public filter: string; - // @DataMember(Order=9) - public meta?: { [index: string]: string }; + // @DataMember + public allRecords?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'Authenticate'; + return 'DeleteManyRequest'; } public getMethod() { - return 'POST'; + return 'DELETE'; } public createResponse() { - return new AuthenticateResponse(); + return new EmptyResponse(); } } - // @Route("/access-token") + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "DELETE") + // @Api(Description="Database") // @DataContract - export class GetAccessToken implements IReturn, IPost { - // @DataMember(Order=1) - public refreshToken?: string; + export class DeleteOneRequest extends CodeMashRequestBase implements IReturn { + // @DataMember + public collectionName: string; - // @DataMember(Order=2) - public meta?: { [index: string]: string }; + // @DataMember + public id: string; - public constructor(init?: Partial) { + // @DataMember + public databaseIntegrationId?: string; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetAccessToken'; + return 'DeleteOneRequest'; } public getMethod() { - return 'POST'; + return 'DELETE'; } public createResponse() { - return new GetAccessTokenResponse(); + return new EmptyResponse(); } } - // @sdk-dto-patches (injected by sync-types.mjs) - export class UserApiKey { - public key?: string; - public keyType?: string; - public expiryDate?: string; - public meta?: { [index: string]: string }; + /** @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); - } - } - export class GetApiKeysResponse { - public results?: UserApiKey[]; - public meta?: { [index: string]: string }; - public responseStatus?: ResponseStatus; + // @DataMember + public databaseIntegrationId?: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - export class RegenerateApiKeysResponse { - public results?: UserApiKey[]; - public meta?: { [index: string]: string }; - public responseStatus?: ResponseStatus; + // @DataMember + public field: string; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - // @Route("/apikeys") - // @Route("/apikeys/{Environment}") - export class GetApiKeys implements IReturn, IGet { - public environment?: string; - public meta?: { [index: string]: string }; + // @DataMember + public filter?: string; - public constructor(init?: Partial) { + // @DataMember + public schemaVersion?: number; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'GetApiKeys'; + return 'DistinctRequest'; } public getMethod() { return 'GET'; } public createResponse() { - return new GetApiKeysResponse(); + return new DistinctResponse(); } } - // @Route("/apikeys/regenerate") - // @Route("/apikeys/regenerate/{Environment}") - export class RegenerateApiKeys implements IReturn, IPost { - public environment?: string; - public meta?: { [index: string]: string }; - public constructor(init?: Partial) { + /** @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; + + // @DataMember + public aggregateId: string; + + // @DataMember + public databaseIntegrationId?: string; + + // @DataMember + public tokens?: { [index: string]: string }; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } public getTypeName() { - return 'RegenerateApiKeys'; + return 'ExecuteAggregateRequest'; } public getMethod() { return 'POST'; } public createResponse() { - return new RegenerateApiKeysResponse(); + return new ExecuteAggregateResponse(); } } - // @sdk-api-field-dtos: the Api /types surface does not export the JsonSchemaFieldDto - // subclasses (gateway ticket 11-code C22); kept from the previous Api file until the - // Api host anchors them like the Hub does. - export class ArrayFieldDto extends JsonSchemaFieldDto { + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}", "GET") + // @Api(Description="Database") + // @DataContract + export class FindRequest + extends CodeMashListPaginationRequestBase + implements IReturn + { // @DataMember - public items: JsonSchemaFieldDto; + public collectionName: string; // @DataMember - public minItems?: number; + public databaseIntegrationId?: string; // @DataMember - public maxItems?: number; + public filter?: string; // @DataMember - public uniqueItems?: boolean; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public schemaVersion?: number; - export class BooleanFieldDto extends JsonSchemaFieldDto { // @DataMember - public default?: boolean; + public pagingArgs?: PagingArgs; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public sortBy?: string; - export class CollectionSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public collectionId?: string; + public sortOrder?: number; // @DataMember - public displayField?: string; + public expandReferences: boolean; // @DataMember - public multiple: boolean; + public allLanguages: boolean; - public constructor(init?: Partial) { + 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(); + } } - export class CurrencyDefaultDto { + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "GET") + // @Api(Description="Database") + // @DataContract + export class FindOneRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public value: number; + public collectionName: string; // @DataMember - public currency: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + public id: string; - export class CurrencyFieldDto extends JsonSchemaFieldDto { // @DataMember - public allowedCurrencies?: IReadOnlyList; + public databaseIntegrationId?: string; // @DataMember - public multipleOf?: number; + public expandReferences: boolean; // @DataMember - public minimum?: number; + public allLanguages: boolean; - // @DataMember - public maximum?: number; - - // @DataMember - public default?: CurrencyDefaultDto; - - public constructor(init?: Partial) { + 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(); + } } - export class DateFieldDto extends JsonSchemaFieldDto { - // @DataMember - public minimum?: number; - + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/own", "GET") + // @Api(Description="Database") + // @DataContract + export class FindOwnRequest + extends CodeMashListPaginationRequestBase + implements IReturn + { // @DataMember - public maximum?: number; + public collectionName: string; // @DataMember - public default?: number; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public databaseIntegrationId?: string; - export class DecimalFieldDto extends JsonSchemaFieldDto { // @DataMember - public minimum?: number; + public filter?: string; // @DataMember - public maximum?: number; + public schemaVersion?: number; // @DataMember - public multipleOf?: number; + public pagingArgs?: PagingArgs; + /** @description Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids. */ // @DataMember - public default?: number; + // @ApiMember(Description="Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids.") + public expandReferences: boolean; // @DataMember - public unique?: boolean; + public allLanguages: boolean; - public constructor(init?: Partial) { + 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(); + } } - export class EnumSelectionFieldDto extends JsonSchemaFieldDto { + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/many", "POST") + // @Api(Description="Database") + // @DataContract + export class InsertManyRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public values?: IReadOnlyList; + public collectionName: string; // @DataMember - public multiple: boolean; + public databaseIntegrationId?: string; // @DataMember - public default?: IReadOnlyList; + public documents: string; - public constructor(init?: Partial) { + 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(); + } } - export class FileFieldDto extends JsonSchemaFieldDto { - // @DataMember - public storages?: IReadOnlyList; - - // @DataMember - public minItems?: number; - + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}", "POST") + // @Api(Description="Database") + // @DataContract + export class InsertOneRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public maxItems?: number; + public collectionName: string; // @DataMember - public allowedFileType?: string; + public databaseIntegrationId?: string; // @DataMember - public maxSizeMb?: number; + public document: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } - } - - export class GeolocationFieldDto extends JsonSchemaFieldDto { - // @DataMember - public allowedTypes?: IReadOnlyList; - - 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(); } } - export class IntegerFieldDto extends JsonSchemaFieldDto { + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}/replace", "PUT") + // @Api(Description="Database") + // @DataContract + export class ReplaceOneRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public minimum?: number; + public collectionName: string; // @DataMember - public maximum?: number; + public id: string; // @DataMember - public default?: number; + public databaseIntegrationId?: string; // @DataMember - public unique?: boolean; + public replacement: string; - public constructor(init?: Partial) { + 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(); + } } - export class JsonFieldDto extends JsonSchemaFieldDto { + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/many", "PUT") + // @Api(Description="Database") + // @DataContract + export class UpdateManyRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public maxBytes?: number; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public collectionName: string; - export class ObjectFieldDto extends JsonSchemaFieldDto { // @DataMember - public properties: IReadOnlyList; + public databaseIntegrationId?: string; // @DataMember - public required?: IReadOnlyList; + public filter: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public allRecords?: boolean; - export class RoleSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public multiple: boolean; + public update: string; // @DataMember - public displayField?: string; + public arrayFilters?: string; - public constructor(init?: Partial) { + 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(); + } } - export class StringFieldDto extends JsonSchemaFieldDto { - // @DataMember - public format?: string; - - // @DataMember - public pattern?: string; - + /** @description Database */ + // @Route("/{version}/database/collections/{collectionName}/{id}", "PUT") + // @Api(Description="Database") + // @DataContract + export class UpdateOneRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public minLength?: number; + public collectionName: string; // @DataMember - public maxLength?: number; + public id: string; // @DataMember - public translateOptions?: IReadOnlyDictionary; + public databaseIntegrationId?: string; // @DataMember - public default?: string; + public update: string; // @DataMember - public unique?: boolean; + public arrayFilters?: string; - public constructor(init?: Partial) { + 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(); + } } - export class TagsFieldDto extends JsonSchemaFieldDto { - // @DataMember - public minItems?: number; - + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/commit", "POST") + // @Api(Description="Files") + // @DataContract + export class CommitUploadRequest extends CodeMashRequestBase implements IReturn { // @DataMember - public maxItems?: number; + public filesIntegrationId: string; // @DataMember - public default?: IReadOnlyList; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public path: string; - export class TaxonomySelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public taxonomyId?: string; + public contentType?: string; // @DataMember - public multiple: boolean; + public sizeBytes?: number; // @DataMember - public displayField?: string; + public fileName?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } - } - - export class UserSelectionFieldDto extends JsonSchemaFieldDto { - // @DataMember - public multiple: boolean; - + 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 displayField?: string; + public filesIntegrationId: string; - public constructor(init?: Partial) { + // @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}/by-id/{id}", "GET") + // @Api(Description="Files") + // @DataContract + export class GetFileByIdRequest + extends CodeMashRequestBase + implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + // @DataMember + public id: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'GetFileByIdRequest'; + } + public getMethod() { + return 'GET'; + } + public createResponse() { + return new GetFileByIdResponse(); + } + } + + /** @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(); + } + } + + /** @description Files */ + // @Route("/{version}/files/{filesIntegrationId}/test", "POST") + // @Api(Description="Files") + // @DataContract + export class TestFilesIntegrationRequest + extends CodeMashRequestBase + implements IReturn + { + // @DataMember + public filesIntegrationId: string; + + 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 Files */ + // @Route("/{version}/files/{filesIntegrationId}/use", "POST") + // @Api(Description="Files") + // @DataContract + export class UseFileRequest 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 'UseFileRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new IdResponse(); + } + } + + /** @description Registers or refreshes a push device for the signed-in user. */ + // @Route("/{version}/notifications/push/devices", "POST") + // @Api(Description="Registers or refreshes a push device for the signed-in user.") + export class RegisterOwnPushDeviceRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description Who issued the token: expo (getExpoPushTokenAsync), fcm (Android / Firebase) or apns (iOS). */ + // @ApiMember(Description="Who issued the token: expo (getExpoPushTokenAsync), fcm (Android / Firebase) or apns (iOS).", IsRequired=true) + public provider: string; + + /** @description The push token, exactly as the provider gave it. */ + // @ApiMember(Description="The push token, exactly as the provider gave it.", IsRequired=true) + public token: string; + + /** @description The app's platform: ios, android or web. */ + // @ApiMember(Description="The app's platform: ios, android or web.") + public platform?: string; + + /** @description Operating system name, e.g. iOS. */ + // @ApiMember(Description="Operating system name, e.g. iOS.") + public osName?: string; + + /** @description Operating system version, e.g. 18.1. */ + // @ApiMember(Description="Operating system version, e.g. 18.1.") + public osVersion?: string; + + /** @description The app version, e.g. 2.4.1. */ + // @ApiMember(Description="The app version, e.g. 2.4.1.") + public appVersion?: string; + + /** @description The device name the user sees, e.g. Anna's iPhone. */ + // @ApiMember(Description="The device name the user sees, e.g. Anna's iPhone.") + public deviceName?: string; + + /** @description The device model, e.g. iPhone 15. */ + // @ApiMember(Description="The device model, e.g. iPhone 15.") + public modelName?: string; + + public brand?: string; + public manufacturer?: string; + /** @description A stable id the app keeps for this installation (not the token). */ + // @ApiMember(Description="A stable id the app keeps for this installation (not the token).") + public installationId?: string; + + /** @description The device locale, e.g. lt-LT. */ + // @ApiMember(Description="The device locale, e.g. lt-LT.") + public locale?: string; + + /** @description The device time zone (IANA), e.g. Europe/Vilnius. */ + // @ApiMember(Description="The device time zone (IANA), e.g. Europe/Vilnius.") + public timeZone?: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'RegisterOwnPushDeviceRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new IdResponse(); + } + } + + /** @description Lists the signed-in user's own push devices. */ + // @Route("/{version}/notifications/push/devices", "GET") + // @Api(Description="Lists the signed-in user's own push devices.") + export class GetOwnPushDevicesRequest + extends CodeMashRequestBase + implements IReturn + { + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'GetOwnPushDevicesRequest'; + } + public getMethod() { + return 'GET'; + } + public createResponse() { + return new GetOwnPushDevicesResponse(); + } + } + + /** @description Removes one of the signed-in user's own push devices by id. */ + // @Route("/{version}/notifications/push/devices/{Id}", "DELETE") + // @Api(Description="Removes one of the signed-in user's own push devices by id.") + export class DeleteOwnPushDeviceRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description The device id (pnd_…) from the devices list or the register answer. */ + // @ApiMember(Description="The device id (pnd_…) from the devices list or the register answer.", IsRequired=true) + public id: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'DeleteOwnPushDeviceRequest'; + } + public getMethod() { + return 'DELETE'; + } + public createResponse() { + return new EmptyResponse(); + } + } + + /** @description Removes the signed-in user's push device registered with a token (sign-out). */ + // @Route("/{version}/notifications/push/devices", "DELETE") + // @Api(Description="Removes the signed-in user's push device registered with a token (sign-out).") + export class DeleteOwnPushDeviceByTokenRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description The push token the device was registered with. */ + // @ApiMember(Description="The push token the device was registered with.", IsRequired=true) + public token: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'DeleteOwnPushDeviceByTokenRequest'; + } + public getMethod() { + return 'DELETE'; + } + public createResponse() { + return new EmptyResponse(); + } + } + + /** @description Lists the push messages sent to the signed-in user. */ + // @Route("/{version}/notifications/push/messages", "GET") + // @Api(Description="Lists the push messages sent to the signed-in user.") + export class GetOwnPushMessagesRequest + extends CodeMashListPaginationRequestBase + implements IReturn + { + /** @description Only messages the caller has not marked read. */ + // @ApiMember(Description="Only messages the caller has not marked read.") + public unreadOnly: boolean; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'GetOwnPushMessagesRequest'; + } + public getMethod() { + return 'GET'; + } + public createResponse() { + return new GetOwnPushMessagesResponse(); + } + } + + /** @description Marks one push message sent to the signed-in user read. */ + // @Route("/{version}/notifications/push/messages/{Id}/read", "POST") + // @Api(Description="Marks one push message sent to the signed-in user read.") + export class MarkOwnPushMessageReadRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description The message id (ntf_…) from the messages list. */ + // @ApiMember(Description="The message id (ntf_…) from the messages list.", IsRequired=true) + public id: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'MarkOwnPushMessageReadRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new EmptyResponse(); + } + } + + /** @description Marks every push message sent to the signed-in user read. */ + // @Route("/{version}/notifications/push/messages/read", "POST") + // @Api(Description="Marks every push message sent to the signed-in user read.") + export class MarkAllOwnPushMessagesReadRequest + extends CodeMashRequestBase + implements IReturn + { + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'MarkAllOwnPushMessagesReadRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new EmptyResponse(); + } + } + + /** @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(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(); + } + } + + // @sdk-dto-patches (injected by sync-types.mjs) + export class UserApiKey { + public key?: string; + public keyType?: string; + public expiryDate?: string; + public meta?: { [index: string]: string }; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class GetApiKeysResponse { + public results?: UserApiKey[]; + public meta?: { [index: string]: string }; + public responseStatus?: ResponseStatus; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class RegenerateApiKeysResponse { + public results?: UserApiKey[]; + public meta?: { [index: string]: string }; + public responseStatus?: ResponseStatus; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + // @Route("/apikeys") + // @Route("/apikeys/{Environment}") + export class GetApiKeys implements IReturn, IGet { + public environment?: string; + 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}") + export class RegenerateApiKeys implements IReturn, IPost { + public environment?: string; + 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/src/types/hub2.contract.json b/src/types/hub2.contract.json index 8df27f5..95bdf14 100644 --- a/src/types/hub2.contract.json +++ b/src/types/hub2.contract.json @@ -791,6 +791,10 @@ "requiresAuth": true, "returnsBytes": false }, + "GetAiContextRequest": { + "requiresAuth": true, + "returnsBytes": false + }, "GetAiProjectTrigger": { "requiresAuth": true, "returnsBytes": false @@ -1471,6 +1475,10 @@ "requiresAuth": true, "returnsBytes": false }, + "ImportUsersRequest": { + "requiresAuth": true, + "returnsBytes": false + }, "InsertManyRecords": { "requiresAuth": true, "returnsBytes": false @@ -1687,6 +1695,10 @@ "requiresAuth": true, "returnsBytes": false }, + "RepairLoginProjectIdsRequest": { + "requiresAuth": true, + "returnsBytes": false + }, "ReplaceMarketplaceIntegrationSecretsRequest": { "requiresAuth": true, "returnsBytes": false @@ -1971,6 +1983,10 @@ "requiresAuth": true, "returnsBytes": false }, + "SharedTypeGen": { + "requiresAuth": false, + "returnsBytes": false + }, "SignOutMarketplaceIntegration": { "requiresAuth": true, "returnsBytes": false diff --git a/src/types/hub2.dtos.ts b/src/types/hub2.dtos.ts index 8dd6745..f696c64 100644 --- a/src/types/hub2.dtos.ts +++ b/src/types/hub2.dtos.ts @@ -1,6 +1,6 @@ // @ts-nocheck /* Options: -Date: 2026-10-14 07:55:10 +Date: 2026-10-14 16:40:18 Version: 10.20 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: http://localhost:5001 @@ -2348,6 +2348,9 @@ export module CodeMashHub2 { // @DataMember public languages?: string[]; + // @DataMember + public recordIds?: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); @@ -2421,6 +2424,9 @@ export module CodeMashHub2 { // @DataMember public languages?: string[]; + // @DataMember + public recordIds?: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); @@ -2504,6 +2510,9 @@ export module CodeMashHub2 { // @DataMember public languages?: string[]; + // @DataMember + public recordIds?: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); @@ -3660,6 +3669,9 @@ export module CodeMashHub2 { // @DataMember public status?: string; + // @DataMember + public warnings?: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); @@ -4513,683 +4525,683 @@ export module CodeMashHub2 { } } - export class JsonSchemaFieldDto { - // @DataMember - public fieldName: string; + export enum CodeFunctionSource { + Database = 'Database', + Membership = 'Membership', + Files = 'Files', + Payments = 'Payments', + Ai = 'Ai', + Scheduler = 'Scheduler', + Manual = 'Manual', + } - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } + export enum CodeFunctionCallerKind { + User = 'User', + ApiKey = 'ApiKey', + System = 'System', } - export class StringFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class CodeFunctionCallerDto { // @DataMember - public format?: string; + public userId: string; // @DataMember - public pattern?: string; + public email?: string; // @DataMember - public minLength?: number; + public kind: CodeFunctionCallerKind; - // @DataMember - public maxLength?: number; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + // @DataContract + export class CodeFunctionRunAsDto { // @DataMember - public translateOptions?: IReadOnlyDictionary; + public userId: string; // @DataMember - public default?: string; + public accessToken?: string; // @DataMember - public unique?: boolean; + public expiresAt?: string; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class DecimalFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class CodeFunctionContextDto { // @DataMember - public minimum?: number; + public accountId: string; // @DataMember - public maximum?: number; + public projectId: string; // @DataMember - public multipleOf?: number; + public environment: string; // @DataMember - public default?: number; + public region?: string; // @DataMember - public unique?: boolean; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public hubUrl: string; - export class CurrencyDefaultDto { // @DataMember - public value: number; + public apiUrl: string; // @DataMember - public currency: string; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + public echoUrl: string; - export class CurrencyFieldDto extends JsonSchemaFieldDto { // @DataMember - public allowedCurrencies?: IReadOnlyList; + public triggerId?: string; // @DataMember - public multipleOf?: number; + public taskId?: string; // @DataMember - public minimum?: number; + public correlationId?: string; // @DataMember - public maximum?: number; + public caller?: CodeFunctionCallerDto; // @DataMember - public default?: CurrencyDefaultDto; + public runAs?: CodeFunctionRunAsDto; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class BooleanFieldDto extends JsonSchemaFieldDto { - // @DataMember - public default?: boolean; + export enum ResourceKindDto { + Contact = 'contact', + Document = 'document', + File = 'file', + PaymentCustomer = 'paymentCustomer', + Order = 'order', + Payment = 'payment', + Product = 'product', + Integration = 'integration', + } - public constructor(init?: Partial) { + export class ResourceRefDto { + public projectId: string; + public integrationId?: string; + public kind: ResourceKindDto; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class DocumentRefDto extends ResourceRefDto { + public kind: ResourceKindDto; + public databaseIntegrationId: string; + public schemaId: string; + public externalId: string; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export class DateFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class DatabaseRecordChangeDto { // @DataMember - public minimum?: number; + public collection: string; // @DataMember - public maximum?: number; + public schemaId: string; // @DataMember - public default?: number; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + public schemaVersion?: number; - export class IntegerFieldDto extends JsonSchemaFieldDto { // @DataMember - public minimum?: number; + public recordId?: string; // @DataMember - public maximum?: number; + public old?: { [index: string]: Object }; // @DataMember - public default?: number; + public new?: { [index: string]: Object }; // @DataMember - public unique?: boolean; + public truncated: boolean; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public oldRef?: DocumentRefDto; - export class GeolocationFieldDto extends JsonSchemaFieldDto { // @DataMember - public allowedTypes?: IReadOnlyList; + public newRef?: DocumentRefDto; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class TagsFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class UserChangeDto { // @DataMember - public minItems?: number; + public userId: string; // @DataMember - public maxItems?: number; + public old?: { [index: string]: Object }; // @DataMember - public default?: IReadOnlyList; + public new?: { [index: string]: Object }; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class FileFieldDto extends JsonSchemaFieldDto { - // @DataMember - public storages?: IReadOnlyList; - - // @DataMember - public minItems?: number; - + // @DataContract + export class FileChangeDto { // @DataMember - public maxItems?: number; + public old?: { [index: string]: Object }; // @DataMember - public allowedFileType?: string; + public new?: { [index: string]: Object }; // @DataMember - public maxSizeMb?: number; + public path?: string; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class TaxonomySelectionFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class PaymentFactDto { // @DataMember - public taxonomyId?: string; + public integrationId: string; // @DataMember - public multiple: boolean; + public provider: string; // @DataMember - public displayField?: string; + public providerEventId: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public eventName: string; - export class CollectionSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public collectionId?: string; + public status: string; // @DataMember - public displayField?: string; + public amountMinor?: number; // @DataMember - public multiple: boolean; + public currency?: string; - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } + // @DataMember + public externalIds?: { [index: string]: string }; - export class UserSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public multiple: boolean; + public occurredOn?: string; // @DataMember - public displayField?: string; + public receivedOn: string; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class RoleSelectionFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class AiUsageEventDto { // @DataMember - public multiple: boolean; + public payload: { [index: string]: Object } = {}; // @DataMember - public displayField?: string; + public targetUserId?: string; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class EnumSelectionFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class ScheduledTaskInfoDto { // @DataMember - public values?: IReadOnlyList; + public taskId: string; // @DataMember - public multiple: boolean; + public name: string; // @DataMember - public default?: IReadOnlyList; + public firedAt: string; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class ObjectFieldDto extends JsonSchemaFieldDto { - // @DataMember - public properties: IReadOnlyList; - - // @DataMember - public required?: IReadOnlyList; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export class ArrayFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class MarketplaceFunctionCallDto { // @DataMember - public items: JsonSchemaFieldDto; + public functionId: string; // @DataMember - public minItems?: number; + public functionKey: string; // @DataMember - public maxItems?: number; + public integrationId: string; // @DataMember - public uniqueItems?: boolean; + public payload: { [index: string]: Object } = {}; - public constructor(init?: Partial) { - super(init); + public constructor(init?: Partial) { (Object as any).assign(this, init); } } - export class JsonFieldDto extends JsonSchemaFieldDto { + // @DataContract + export class CodeFunctionDataDto { // @DataMember - public maxBytes?: number; - - public constructor(init?: Partial) { - super(init); - (Object as any).assign(this, init); - } - } - - export enum CodeFunctionSource { - Database = 'Database', - Membership = 'Membership', - Files = 'Files', - Payments = 'Payments', - Ai = 'Ai', - Scheduler = 'Scheduler', - Manual = 'Manual', - } - - export enum CodeFunctionCallerKind { - User = 'User', - ApiKey = 'ApiKey', - System = 'System', - } + public database?: DatabaseRecordChangeDto; - // @DataContract - export class CodeFunctionCallerDto { // @DataMember - public userId: string; + public user?: UserChangeDto; // @DataMember - public email?: string; + public file?: FileChangeDto; // @DataMember - public kind: CodeFunctionCallerKind; + public payment?: PaymentFactDto; - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + // @DataMember + public ai?: AiUsageEventDto; - // @DataContract - export class CodeFunctionRunAsDto { // @DataMember - public userId: string; + public task?: ScheduledTaskInfoDto; // @DataMember - public accessToken?: string; + public payload?: { [index: string]: Object }; // @DataMember - public expiresAt?: string; + public marketplace?: MarketplaceFunctionCallDto; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } // @DataContract - export class CodeFunctionContextDto { - // @DataMember - public accountId: string; - - // @DataMember - public projectId: string; - + export class CodeFunctionEventDto { // @DataMember - public environment: string; + public specVersion: string; // @DataMember - public region?: string; + public id: string; // @DataMember - public hubUrl: string; + public eventId: string; // @DataMember - public apiUrl: string; + public event: string; // @DataMember - public echoUrl: string; + public source: CodeFunctionSource; // @DataMember - public triggerId?: string; + public createdOn: string; // @DataMember - public taskId?: string; + public context: CodeFunctionContextDto; // @DataMember - public correlationId?: string; + public data: CodeFunctionDataDto; // @DataMember - public caller?: CodeFunctionCallerDto; + public config?: { [index: string]: Object }; - // @DataMember - public runAs?: CodeFunctionRunAsDto; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } - public constructor(init?: Partial) { + export class FakeCodeIntegrationDto extends CodeIntegrationDto { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export enum ResourceKindDto { - Contact = 'contact', - Document = 'document', - File = 'file', - PaymentCustomer = 'paymentCustomer', - Order = 'order', - Payment = 'payment', - Product = 'product', - Integration = 'integration', + export class FakeCodeIntegrationRequest extends CodeIntegrationRequest { + public provider: CodeProvider; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } } - export class ResourceRefDto { - public projectId: string; - public integrationId?: string; - public kind: ResourceKindDto; + export class CodeFunctionSchedulerTaskRequest extends SchedulerTaskRequest { + public type: SchedulerTaskType; + public functionRef?: FunctionRefDto; + public invocationType: CodeInvocationType; + public config?: string; + public mappedTokens?: TokenMappingDto[]; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class DocumentRefDto extends ResourceRefDto { - public kind: ResourceKindDto; - public databaseIntegrationId: string; - public schemaId: string; - public externalId: string; + export class MarketplaceFunctionSchedulerTaskRequest extends SchedulerTaskRequest { + public type: SchedulerTaskType; + public functionId?: string; + public payload?: { [index: string]: string }; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - // @DataContract - export class DatabaseRecordChangeDto { + export class JsonSchemaFieldDto { // @DataMember - public collection: string; + public fieldName: string; - // @DataMember - public schemaId: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class StringFieldDto extends JsonSchemaFieldDto { // @DataMember - public schemaVersion?: number; + public format?: string; // @DataMember - public recordId?: string; + public pattern?: string; // @DataMember - public old?: { [index: string]: Object }; + public minLength?: number; // @DataMember - public new?: { [index: string]: Object }; + public maxLength?: number; // @DataMember - public truncated: boolean; + public translateOptions?: IReadOnlyDictionary; // @DataMember - public oldRef?: DocumentRefDto; + public default?: string; // @DataMember - public newRef?: DocumentRefDto; + public unique?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class UserChangeDto { - // @DataMember - public userId: string; - + export class DecimalFieldDto extends JsonSchemaFieldDto { // @DataMember - public old?: { [index: string]: Object }; + public minimum?: number; // @DataMember - public new?: { [index: string]: Object }; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } + public maximum?: number; - // @DataContract - export class FileChangeDto { // @DataMember - public old?: { [index: string]: Object }; + public multipleOf?: number; // @DataMember - public new?: { [index: string]: Object }; + public default?: number; // @DataMember - public path?: string; + public unique?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class PaymentFactDto { + export class CurrencyDefaultDto { // @DataMember - public integrationId: string; + public value: number; // @DataMember - public provider: string; + public currency: string; - // @DataMember - public providerEventId: string; + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class CurrencyFieldDto extends JsonSchemaFieldDto { // @DataMember - public eventName: string; + public allowedCurrencies?: IReadOnlyList; // @DataMember - public status: string; + public multipleOf?: number; // @DataMember - public amountMinor?: number; + public minimum?: number; // @DataMember - public currency?: string; + public maximum?: number; // @DataMember - public externalIds?: { [index: string]: string }; + public default?: CurrencyDefaultDto; - // @DataMember - public occurredOn?: string; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class BooleanFieldDto extends JsonSchemaFieldDto { // @DataMember - public receivedOn: string; + public default?: boolean; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class AiUsageEventDto { + export class DateFieldDto extends JsonSchemaFieldDto { // @DataMember - public payload: { [index: string]: Object } = {}; + public minimum?: number; // @DataMember - public targetUserId?: string; + public maximum?: number; - public constructor(init?: Partial) { + // @DataMember + public default?: number; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class ScheduledTaskInfoDto { + export class IntegerFieldDto extends JsonSchemaFieldDto { // @DataMember - public taskId: string; + public minimum?: number; // @DataMember - public name: string; + public maximum?: number; // @DataMember - public firedAt: string; + public default?: number; - public constructor(init?: Partial) { + // @DataMember + public unique?: boolean; + + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class MarketplaceFunctionCallDto { + export class GeolocationFieldDto extends JsonSchemaFieldDto { // @DataMember - public functionId: string; + public allowedTypes?: IReadOnlyList; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + + export class TagsFieldDto extends JsonSchemaFieldDto { // @DataMember - public functionKey: string; + public minItems?: number; // @DataMember - public integrationId: string; + public maxItems?: number; // @DataMember - public payload: { [index: string]: Object } = {}; + public default?: IReadOnlyList; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class CodeFunctionDataDto { + export class FileFieldDto extends JsonSchemaFieldDto { // @DataMember - public database?: DatabaseRecordChangeDto; + public storages?: IReadOnlyList; // @DataMember - public user?: UserChangeDto; + public minItems?: number; // @DataMember - public file?: FileChangeDto; + public maxItems?: number; // @DataMember - public payment?: PaymentFactDto; + public allowedFileType?: string; // @DataMember - public ai?: AiUsageEventDto; + public maxSizeMb?: number; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class TaxonomySelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public task?: ScheduledTaskInfoDto; + public taxonomyId?: string; // @DataMember - public payload?: { [index: string]: Object }; + public multiple: boolean; // @DataMember - public marketplace?: MarketplaceFunctionCallDto; + public displayField?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - // @DataContract - export class CodeFunctionEventDto { + export class CollectionSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public specVersion: string; + public collectionId?: string; // @DataMember - public id: string; + public displayField?: string; // @DataMember - public eventId: string; + public multiple: boolean; - // @DataMember - public event: string; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class UserSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public source: CodeFunctionSource; + public multiple: boolean; // @DataMember - public createdOn: string; + public displayField?: string; - // @DataMember - public context: CodeFunctionContextDto; + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class RoleSelectionFieldDto extends JsonSchemaFieldDto { // @DataMember - public data: CodeFunctionDataDto; + public multiple: boolean; // @DataMember - public config?: { [index: string]: Object }; + public displayField?: string; - public constructor(init?: Partial) { + public constructor(init?: Partial) { + super(init); (Object as any).assign(this, init); } } - export class FakeCodeIntegrationDto extends CodeIntegrationDto { - public constructor(init?: Partial) { + export class EnumSelectionFieldDto extends JsonSchemaFieldDto { + // @DataMember + public values?: IReadOnlyList; + + // @DataMember + public multiple: boolean; + + // @DataMember + public default?: IReadOnlyList; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export class FakeCodeIntegrationRequest extends CodeIntegrationRequest { - public provider: CodeProvider; + export class ObjectFieldDto extends JsonSchemaFieldDto { + // @DataMember + public properties: IReadOnlyList; - public constructor(init?: Partial) { + // @DataMember + public required?: IReadOnlyList; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export class CodeFunctionSchedulerTaskRequest extends SchedulerTaskRequest { - public type: SchedulerTaskType; - public functionRef?: FunctionRefDto; - public invocationType: CodeInvocationType; - public config?: string; - public mappedTokens?: TokenMappingDto[]; + export class ArrayFieldDto extends JsonSchemaFieldDto { + // @DataMember + public items: JsonSchemaFieldDto; - public constructor(init?: Partial) { + // @DataMember + public minItems?: number; + + // @DataMember + public maxItems?: number; + + // @DataMember + public uniqueItems?: boolean; + + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } } - export class MarketplaceFunctionSchedulerTaskRequest extends SchedulerTaskRequest { - public type: SchedulerTaskType; - public functionId?: string; - public payload?: { [index: string]: string }; + export class JsonFieldDto extends JsonSchemaFieldDto { + // @DataMember + public maxBytes?: number; - public constructor(init?: Partial) { + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); } @@ -5431,6 +5443,81 @@ export module CodeMashHub2 { } } + export enum Gender { + Male = 'Male', + Female = 'Female', + Other = 'Other', + } + + export enum MarketingBlockReason { + Unspecified = 'Unspecified', + Unsubscribed = 'Unsubscribed', + Complaint = 'Complaint', + HardBounce = 'HardBounce', + InvalidEmail = 'InvalidEmail', + AdminBlock = 'AdminBlock', + } + + 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; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + // @DataContract + export class ImportUserRowDto { + // @DataMember(Name="email") + public email?: string; + + // @DataMember(Name="userName") + public userName?: string; + + // @DataMember(Name="userGeneralInfo") + public userGeneralInfo?: UserGeneralInfoDto; + + // @DataMember(Name="roles") + public roles?: string[]; + + // @DataMember(Name="createdOn") + public createdOn?: number; + + // @DataMember(Name="hashFormat") + public hashFormat?: string; + + // @DataMember(Name="passwordHash") + public passwordHash?: string; + + // @DataMember(Name="passwordSalt") + public passwordSalt?: string; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + // @DataContract export class DeleteTrigger extends CodeMashRequestBase { // @DataMember @@ -5569,6 +5656,12 @@ export module CodeMashHub2 { // @DataMember public field: string; + // @DataMember + public primary: boolean; + + // @DataMember + public linkReference: boolean; + public constructor(init?: Partial) { (Object as any).assign(this, init); } @@ -6607,6 +6700,9 @@ export module CodeMashHub2 { // @DataMember public customPolicies?: PolicyItemDto[]; + // @DataMember + public systemRoleAttachments?: RoleItemDto[]; + // @DataMember public authorization?: AuthorizationDto; @@ -7220,62 +7316,18 @@ export module CodeMashHub2 { } export class RegistrationDto { - public registrationInformation: AccessInformationDto; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export class LoginDto { - public needChangePasswordOnNextLogin: boolean; - public lastAccessInformation?: AccessInformationDto; - - public constructor(init?: Partial) { - (Object as any).assign(this, init); - } - } - - export enum Gender { - Male = 'Male', - Female = 'Female', - Other = 'Other', - } + public registrationInformation: AccessInformationDto; - export enum MarketingBlockReason { - Unspecified = 'Unspecified', - Unsubscribed = 'Unsubscribed', - Complaint = 'Complaint', - HardBounce = 'HardBounce', - InvalidEmail = 'InvalidEmail', - AdminBlock = 'AdminBlock', + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } } - 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; + export class LoginDto { + public needChangePasswordOnNextLogin: boolean; + public lastAccessInformation?: AccessInformationDto; - public constructor(init?: Partial) { + public constructor(init?: Partial) { (Object as any).assign(this, init); } } @@ -7283,6 +7335,7 @@ export module CodeMashHub2 { export enum AuthStatus { Registered = 0, PendingValidation = 2, + Invited = 4, Active = 8, Unregistered = 16, Suspended = 32, @@ -7671,6 +7724,100 @@ export module CodeMashHub2 { } } + // @DataContract + export class ImportUserErrorDto { + // @DataMember(Name="code") + public code?: string; + + // @DataMember(Name="message") + public message: string; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + // @DataContract + export class ImportUserOutcomeDto { + // @DataMember(Name="row") + public row: number; + + // @DataMember(Name="login") + public login?: string; + + // @DataMember(Name="outcome") + public outcome: string; + + // @DataMember(Name="userId") + public userId?: string; + + // @DataMember(Name="errors") + public errors: ImportUserErrorDto[] = []; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + // @DataContract + export class UsersImportDto { + // @DataMember(Name="dryRun") + public dryRun: boolean; + + // @DataMember(Name="received") + public received: number; + + // @DataMember(Name="imported") + public imported: number; + + // @DataMember(Name="valid") + public valid: number; + + // @DataMember(Name="existing") + public existing: number; + + // @DataMember(Name="invalid") + public invalid: number; + + // @DataMember(Name="failed") + public failed: number; + + // @DataMember(Name="rows") + public rows: ImportUserOutcomeDto[] = []; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + // @DataContract + export class LoginProjectRepairDto { + // @DataMember(Name="dryRun") + public dryRun: boolean; + + // @DataMember(Name="loginsWithoutProject") + public loginsWithoutProject: number; + + // @DataMember(Name="loginsToRepair") + public loginsToRepair: number; + + // @DataMember(Name="loginsRepaired") + public loginsRepaired: number; + + // @DataMember(Name="accountLoginsSkipped") + public accountLoginsSkipped: number; + + // @DataMember(Name="otherProjectLoginsSkipped") + public otherProjectLoginsSkipped: number; + + // @DataMember(Name="loginsWithoutEvidence") + public loginsWithoutEvidence: number; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class ServiceUserApiKeyDto { public id: number; public name: string; @@ -7912,6 +8059,30 @@ export module CodeMashHub2 { // @DataMember public passwordComplexity?: PasswordComplexityDto; + // @DataMember + public defaultRoles?: string[]; + + // @DataMember + public allowedRegistrationRoles?: string[]; + + // @DataMember + public allowGuestUsers: boolean; + + // @DataMember + public guestCleanupPeriodDays?: number; + + // @DataMember + public allowEmailRegistration: boolean; + + // @DataMember + public allowUsernameRegistration: boolean; + + // @DataMember + public inviteOnly: boolean; + + // @DataMember + public allowAnyoneToSignUp: boolean; + public constructor(init?: Partial) { (Object as any).assign(this, init); } @@ -10123,6 +10294,73 @@ export module CodeMashHub2 { } } + export class AiProjectContextCallerWireDto { + public kind: string; + public name?: string; + public accountId?: string; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class AiProjectContextIntegrationWireDto { + public id: string; + public name?: string; + public kind?: string; + public enabled?: boolean; + public defaultIn: string[] = []; + public env?: string; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class AiProjectContextModuleWireDto { + public name: string; + public integrationsReadable?: boolean; + public integrations?: AiProjectContextIntegrationWireDto[]; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class AiProjectContextProjectWireDto { + public id: string; + public name: string; + public uniqueName?: string; + public access: string; + public description?: string; + public defaultLanguage?: string; + public languages: string[] = []; + public environments?: string[]; + public primaryRegion?: string; + public additionalRegions?: string[]; + public corsOrigins?: string[]; + public apiHost?: string; + public adminUrl?: string; + public marketingUrl?: string; + public adminPortalEnabled?: boolean; + public modules?: AiProjectContextModuleWireDto[]; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + + export class AiProjectContextWireDto { + public version: string; + public caller: AiProjectContextCallerWireDto; + public projects: AiProjectContextProjectWireDto[] = []; + public hints: string[] = []; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + } + export class AiToolManifestParameter { public name: string; public type: string; @@ -11976,6 +12214,24 @@ export module CodeMashHub2 { } } + export class ImportUsersResponse extends ResponseBase { + public result?: UsersImportDto; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + + export class RepairLoginProjectIdsResponse extends ResponseBase { + public result?: LoginProjectRepairDto; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class IssueServiceUserApiKeyResponse { public id: number; public name: string; @@ -13526,6 +13782,18 @@ export module CodeMashHub2 { } } + export class GetAiContextResponse extends ResponseBase { + public version?: string; + public unchanged: boolean; + public context?: AiProjectContextWireDto; + public markdown?: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + } + export class GetAiToolsResponse extends ResponseBase { public tools?: AiToolManifestItem[]; @@ -13630,6 +13898,7 @@ export module CodeMashHub2 { public valid: boolean; public issues?: ScaffoldIssue[]; public collections?: string[]; + public warnings?: ScaffoldIssue[]; public constructor(init?: Partial) { super(init); @@ -15145,23 +15414,6 @@ export module CodeMashHub2 { public typegen_243_ActionPendingEntryWireDto?: ActionPendingEntryWireDto; public typegen_244_NoticeEntryWireDto?: NoticeEntryWireDto; public typegen_245_ConversationSnapshotEntryWireDto?: ConversationSnapshotEntryWireDto; - public typegen_252_StringFieldDto?: StringFieldDto; - public typegen_253_DecimalFieldDto?: DecimalFieldDto; - public typegen_254_CurrencyFieldDto?: CurrencyFieldDto; - public typegen_255_BooleanFieldDto?: BooleanFieldDto; - public typegen_256_DateFieldDto?: DateFieldDto; - public typegen_257_IntegerFieldDto?: IntegerFieldDto; - public typegen_258_GeolocationFieldDto?: GeolocationFieldDto; - public typegen_259_TagsFieldDto?: TagsFieldDto; - public typegen_260_FileFieldDto?: FileFieldDto; - public typegen_261_TaxonomySelectionFieldDto?: TaxonomySelectionFieldDto; - public typegen_262_CollectionSelectionFieldDto?: CollectionSelectionFieldDto; - public typegen_263_UserSelectionFieldDto?: UserSelectionFieldDto; - public typegen_264_RoleSelectionFieldDto?: RoleSelectionFieldDto; - public typegen_265_EnumSelectionFieldDto?: EnumSelectionFieldDto; - public typegen_266_ObjectFieldDto?: ObjectFieldDto; - public typegen_267_ArrayFieldDto?: ArrayFieldDto; - public typegen_268_JsonFieldDto?: JsonFieldDto; public typegen_269_FunctionRefDto?: FunctionRefDto; public typegen_270_CodeFunctionEventDto?: CodeFunctionEventDto; public typegen_271_CodeFunctionContextDto?: CodeFunctionContextDto; @@ -15191,6 +15443,37 @@ export module CodeMashHub2 { public createResponse() {} } + export class SharedTypeGen { + public typegen_StringFieldDto?: StringFieldDto; + public typegen_DecimalFieldDto?: DecimalFieldDto; + public typegen_CurrencyFieldDto?: CurrencyFieldDto; + public typegen_BooleanFieldDto?: BooleanFieldDto; + public typegen_DateFieldDto?: DateFieldDto; + public typegen_IntegerFieldDto?: IntegerFieldDto; + public typegen_GeolocationFieldDto?: GeolocationFieldDto; + public typegen_TagsFieldDto?: TagsFieldDto; + public typegen_FileFieldDto?: FileFieldDto; + public typegen_TaxonomySelectionFieldDto?: TaxonomySelectionFieldDto; + public typegen_CollectionSelectionFieldDto?: CollectionSelectionFieldDto; + public typegen_UserSelectionFieldDto?: UserSelectionFieldDto; + public typegen_RoleSelectionFieldDto?: RoleSelectionFieldDto; + public typegen_EnumSelectionFieldDto?: EnumSelectionFieldDto; + public typegen_ObjectFieldDto?: ObjectFieldDto; + public typegen_ArrayFieldDto?: ArrayFieldDto; + public typegen_JsonFieldDto?: JsonFieldDto; + + public constructor(init?: Partial) { + (Object as any).assign(this, init); + } + public getTypeName() { + return 'SharedTypeGen'; + } + public getMethod() { + return 'POST'; + } + public createResponse() {} + } + // @Route("/{version}/echo", "GET") export class Echo extends RequestBase implements IReturn { public constructor(init?: Partial) { @@ -16147,8 +16430,8 @@ export module CodeMashHub2 { // @Route("/{version}/account/projects/{projectId}/settings/admin-url", "PATCH") // @Api(Description="Updates the project's admin-portal URL override") export class UpdateProjectAdminUrl extends CodeMashRequestBase implements IReturn { - /** @description Custom admin-portal URL to use instead of the canonical address. Null/empty restores the canonical pr_{id}.admin.{host} address. */ - // @ApiMember(Description="Custom admin-portal URL to use instead of the canonical address. Null/empty restores the canonical pr_{id}.admin.{host} address.") + /** @description Custom admin-portal URL to use instead of the canonical address. Null/empty restores the canonical pr-{project hex}.admin.{host} address. */ + // @ApiMember(Description="Custom admin-portal URL to use instead of the canonical address. Null/empty restores the canonical pr-{project hex}.admin.{host} address.") public url?: string; public constructor(init?: Partial) { @@ -16583,8 +16866,8 @@ export module CodeMashHub2 { // @ApiMember(Description="The complete new list of allowed origin URLs, e.g. [\"https://app.example.com\", \"https://example.com\"]. An entry with no scheme (e.g. \"example.com\") defaults to https. Whatever is not in this list stops being allowed.") public origins?: string[]; - /** @description Optional. true removes the project's own Admin Portal origin (pr_{projectId}.{admin host}) on purpose. Without it, a list that drops that origin is rejected with CM-ERRORS-PROJECTS-037, because the Norbix-generated end-user portal could no longer call the project's API. */ - // @ApiMember(Description="Optional. true removes the project's own Admin Portal origin (pr_{projectId}.{admin host}) on purpose. Without it, a list that drops that origin is rejected with CM-ERRORS-PROJECTS-037, because the Norbix-generated end-user portal could no longer call the project's API.") + /** @description Optional. true removes the project's own Admin Portal origin (pr-{project hex}.{admin host}) on purpose. Without it, a list that drops that origin is rejected with CM-ERRORS-PROJECTS-037, because the Norbix-generated end-user portal could no longer call the project's API. */ + // @ApiMember(Description="Optional. true removes the project's own Admin Portal origin (pr-{project hex}.{admin host}) on purpose. Without it, a list that drops that origin is rejected with CM-ERRORS-PROJECTS-037, because the Norbix-generated end-user portal could no longer call the project's API.") public removeAdminPortalOrigin?: boolean; public constructor(init?: Partial) { @@ -17921,6 +18204,66 @@ export module CodeMashHub2 { } } + /** @description Import users with their existing password hashes */ + // @Route("/{version}/membership/users/import", "POST") + // @Api(Description="Import users with their existing password hashes") + export class ImportUsersRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description True (default) = check every row and write nothing. False = write. */ + // @ApiMember(Description="True (default) = check every row and write nothing. False = write.") + public dryRun: boolean; + + /** @description True = do not add the project's default roles (as 'ignoreUserRegistersAsRole' on registration). */ + // @ApiMember(Description="True = do not add the project's default roles (as 'ignoreUserRegistersAsRole' on registration).") + public ignoreDefaultRoles: boolean; + + /** @description The users to import, 1 to 1000 per request. */ + // @ApiMember(Description="The users to import, 1 to 1000 per request.", IsRequired=true) + public users: ImportUserRowDto[] = []; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'ImportUsersRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new ImportUsersResponse(); + } + } + + /** @description Repair project logins stored without a project id */ + // @Route("/{version}/membership/users/repair-logins", "POST") + // @Api(Description="Repair project logins stored without a project id") + export class RepairLoginProjectIdsRequest + extends CodeMashRequestBase + implements IReturn + { + /** @description True (default) = only count what would change. False = write. */ + // @ApiMember(Description="True (default) = only count what would change. False = write.") + public dryRun: boolean; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'RepairLoginProjectIdsRequest'; + } + public getMethod() { + return 'POST'; + } + public createResponse() { + return new RepairLoginProjectIdsResponse(); + } + } + /** @description Membership */ // @Route("/{version}/membership/users/{Id}/api-keys", "POST") // @Api(Description="Membership") @@ -18665,11 +19008,26 @@ export module CodeMashHub2 { extends CodeMashRequestBase implements IReturn { + /** @description Single-setting change (dashboard tabs), e.g. 'DefaultRegisterRole' with userRegistersAsRole, or 'PasswordComplexity'. Unknown values are refused. Leave empty to change defaultRoles / allowedRegistrationRoles / allowGuestUsers / guestCleanupPeriodDays — only the fields you send change. */ + // @ApiMember(Description="Single-setting change (dashboard tabs), e.g. 'DefaultRegisterRole' with userRegistersAsRole, or 'PasswordComplexity'. Unknown values are refused. Leave empty to change defaultRoles / allowedRegistrationRoles / allowGuestUsers / guestCleanupPeriodDays — only the fields you send change.") public setting?: string; + + /** @description Role names given to a user who registers without naming roles. Omit = keep; [] = none. */ + // @ApiMember(Description="Role names given to a user who registers without naming roles. Omit = keep; [] = none.") public defaultRoles?: string[]; + + /** @description Role names a user may pick when registering. Omit = keep; [] = none. */ + // @ApiMember(Description="Role names a user may pick when registering. Omit = keep; [] = none.") public allowedRegistrationRoles?: string[]; - public allowGuestUsers: boolean; + + /** @description Whether guest (anonymous) users may be created. Omit = keep. When sent, guestCleanupPeriodDays is taken with it (null = never clean up). */ + // @ApiMember(Description="Whether guest (anonymous) users may be created. Omit = keep. When sent, guestCleanupPeriodDays is taken with it (null = never clean up).") + public allowGuestUsers?: boolean; + + /** @description Days after which inactive guests are removed; null or 0 = never. Omit both guest fields = keep. */ + // @ApiMember(Description="Days after which inactive guests are removed; null or 0 = never. Omit both guest fields = keep.") public guestCleanupPeriodDays?: number; + public userRegistersAsRole?: string; public guestRegistersAsRole?: string; public allowedRegisterRoles?: string[]; @@ -18683,6 +19041,18 @@ export module CodeMashHub2 { public emailVerificationExpiration?: number; public deactivationExpiration?: number; public defaultSubscribeToNews: boolean; + /** @description "Email registration": the public register/email route accepts sign-ups. Omit = keep. */ + // @ApiMember(Description="\"Email registration\": the public register/email route accepts sign-ups. Omit = keep.") + public allowEmailRegistration?: boolean; + + /** @description "Invite-only": public sign-up (email and username) is refused; only invitations create users. Omit = keep. */ + // @ApiMember(Description="\"Invite-only\": public sign-up (email and username) is refused; only invitations create users. Omit = keep.") + public inviteOnly?: boolean; + + /** @description "Allow anyone to sign up": grants (true) / revokes (false) membership:register on the project's Guest role. Omit = keep. */ + // @ApiMember(Description="\"Allow anyone to sign up\": grants (true) / revokes (false) membership:register on the project's Guest role. Omit = keep.") + public allowAnyoneToSignUp?: boolean; + public minLength: number; public maxLength?: number; public minNumbers?: number; @@ -26378,6 +26748,29 @@ export module CodeMashHub2 { } } + /** @description The AI project-context summary: the projects the caller may work on, with their settings — never a secret. */ + // @Route("/{version}/account/ai/context", "GET") + // @Api(Description="The AI project-context summary: the projects the caller may work on, with their settings — never a secret.") + export class GetAiContextRequest extends RequestBase implements IReturn { + public projectId?: string; + public format?: string; + public knownVersion?: string; + + public constructor(init?: Partial) { + super(init); + (Object as any).assign(this, init); + } + public getTypeName() { + return 'GetAiContextRequest'; + } + public getMethod() { + return 'GET'; + } + public createResponse() { + return new GetAiContextResponse(); + } + } + /** @description Lists the AI tools this host exposes (external-agent bridge). */ // @Route("/{version}/account/ai/tools", "GET") // @Api(Description="Lists the AI tools this host exposes (external-agent bridge).") @@ -28566,6 +28959,30 @@ export module CodeMashHub2 { // @ApiMember(Description="How many contacts to return per page (default 50).") public pageSize?: number; + /** @description Free text, case-insensitive: matches the email, phone, display / first / last / full name, or any login's user name or email. */ + // @ApiMember(Description="Free text, case-insensitive: matches the email, phone, display / first / last / full name, or any login's user name or email.") + public search?: string; + + /** @description Case-insensitive part of the email (primary email or any login's email). */ + // @ApiMember(Description="Case-insensitive part of the email (primary email or any login's email).") + public email?: string; + + /** @description Case-insensitive part of any login's user name. */ + // @ApiMember(Description="Case-insensitive part of any login's user name.") + public userName?: string; + + /** @description Login status names, any of: Registered, PendingValidation, Active, Unregistered, Suspended, InActive, Blocked. */ + // @ApiMember(Description="Login status names, any of: Registered, PendingValidation, Active, Unregistered, Suspended, InActive, Blocked.") + public statuses?: string[]; + + /** @description Login type names, any of: Service, Email, UserName, Phone, Guest, Social. */ + // @ApiMember(Description="Login type names, any of: Service, Email, UserName, Phone, Guest, Social.") + public types?: string[]; + + /** @description Composite project-role ids (pr_{project}_nr_{role}); the contact holds any of them. */ + // @ApiMember(Description="Composite project-role ids (pr_{project}_nr_{role}); the contact holds any of them.") + public roleNames?: string[]; + public constructor(init?: Partial) { super(init); (Object as any).assign(this, init); diff --git a/tests/api/files.test.ts b/tests/api/files.test.ts index c47b306..4c215f1 100644 --- a/tests/api/files.test.ts +++ b/tests/api/files.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for api.files (13 endpoints). + * Tests for api.files (14 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('api.files', () => { - it('module exposes 13 method(s)', () => { + it('module exposes 14 method(s)', () => { const mock = createMockFetch(); const mod = new FilesModule({} as never); void mod; // silence unused — we only need the type @@ -42,6 +42,7 @@ describe('api.files', () => { expect(typeof ns['getPublicFile']).toBe('function'); expect(typeof ns['requestUploadUrl']).toBe('function'); expect(typeof ns['testFilesIntegration']).toBe('function'); + expect(typeof ns['useFile']).toBe('function'); }); it('commitUpload: POST /{version}/files/{filesIntegrationId}/commit', async () => { @@ -342,4 +343,27 @@ describe('api.files', () => { expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + + it('useFile: POST /{version}/files/{filesIntegrationId}/use', async () => { + const stub = stubRequestForPath('/{version}/files/{filesIntegrationId}/use'); + const expected = expectedUrl({ + baseUrl: 'https://api.norbix.io', + path: '/{version}/files/{filesIntegrationId}/use', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.api as unknown as Record< + string, + Record Promise> + > + )['files']!['useFile']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); }); diff --git a/tests/api/membership.test.ts b/tests/api/membership.test.ts index e97ae55..20db095 100644 --- a/tests/api/membership.test.ts +++ b/tests/api/membership.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for api.membership (42 endpoints). + * Tests for api.membership (43 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('api.membership', () => { - it('module exposes 42 method(s)', () => { + it('module exposes 43 method(s)', () => { const mock = createMockFetch(); const mod = new MembershipModule({} as never); void mod; // silence unused — we only need the type @@ -32,9 +32,9 @@ describe('api.membership', () => { expect(typeof ns['blockUser']).toBe('function'); expect(typeof ns['saveSystemUserWithPermissions']).toBe('function'); expect(typeof ns['saveGuestUser']).toBe('function'); + expect(typeof ns['savePhoneUser']).toBe('function'); expect(typeof ns['saveUserNameUser']).toBe('function'); expect(typeof ns['saveEmailUser']).toBe('function'); - expect(typeof ns['savePhoneUser']).toBe('function'); expect(typeof ns['savePhoneUserNameWithPermissions']).toBe('function'); expect(typeof ns['saveEmailUserNameWithPermissions']).toBe('function'); expect(typeof ns['saveUserNameWithPermissions']).toBe('function'); @@ -44,6 +44,7 @@ describe('api.membership', () => { expect(typeof ns['getUserPreferences']).toBe('function'); expect(typeof ns['grantContactConsent']).toBe('function'); expect(typeof ns['inviteUser']).toBe('function'); + expect(typeof ns['finishInvitation']).toBe('function'); expect(typeof ns['linkIdentity']).toBe('function'); expect(typeof ns['mapAuthToUser']).toBe('function'); expect(typeof ns['assignRolePermissions']).toBe('function'); @@ -142,11 +143,11 @@ describe('api.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('saveUserNameUser: POST /{version}/membership/auth/register/user-name', async () => { + it('savePhoneUser: POST /{version}/membership/auth/register/phone', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://api.norbix.io', - path: '/{version}/membership/auth/register/user-name', + path: '/{version}/membership/auth/register/phone', version: 'v2', stub, }); @@ -156,7 +157,7 @@ describe('api.membership', () => { string, Record Promise> > - )['membership']!['saveUserNameUser']!; + )['membership']!['savePhoneUser']!; await fn(stub); expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); @@ -165,11 +166,11 @@ describe('api.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('saveEmailUser: POST /{version}/membership/auth/register/email', async () => { + it('saveUserNameUser: POST /{version}/membership/auth/register/user-name', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://api.norbix.io', - path: '/{version}/membership/auth/register/email', + path: '/{version}/membership/auth/register/user-name', version: 'v2', stub, }); @@ -179,7 +180,7 @@ describe('api.membership', () => { string, Record Promise> > - )['membership']!['saveEmailUser']!; + )['membership']!['saveUserNameUser']!; await fn(stub); expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); @@ -188,11 +189,11 @@ describe('api.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('savePhoneUser: POST /{version}/membership/auth/register/phone', async () => { + it('saveEmailUser: POST /{version}/membership/auth/register/email', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://api.norbix.io', - path: '/{version}/membership/auth/register/phone', + path: '/{version}/membership/auth/register/email', version: 'v2', stub, }); @@ -202,7 +203,7 @@ describe('api.membership', () => { string, Record Promise> > - )['membership']!['savePhoneUser']!; + )['membership']!['saveEmailUser']!; await fn(stub); expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); @@ -420,6 +421,29 @@ describe('api.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('finishInvitation: POST /{version}/membership/auth/invitation/finish', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://api.norbix.io', + path: '/{version}/membership/auth/invitation/finish', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.api as unknown as Record< + string, + Record Promise> + > + )['membership']!['finishInvitation']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('linkIdentity: POST /{version}/membership/auth/{userId}/link-identity', async () => { const stub = stubRequestForPath('/{version}/membership/auth/{userId}/link-identity'); const expected = expectedUrl({ diff --git a/tests/api/public.test.ts b/tests/api/public.test.ts index 4950f01..6987648 100644 --- a/tests/api/public.test.ts +++ b/tests/api/public.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for api.public (2 endpoints). + * Tests for api.public (3 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('api.public', () => { - it('module exposes 2 method(s)', () => { + it('module exposes 3 method(s)', () => { const mock = createMockFetch(); const mod = new PublicModule({} as never); void mod; // silence unused — we only need the type @@ -29,10 +29,34 @@ describe('api.public', () => { >; expect(ns).toBeDefined(); void mock; + expect(typeof ns['getPublicProjectBrandAsset']).toBe('function'); expect(typeof ns['getPublicProjectConfig']).toBe('function'); expect(typeof ns['getPublicProjectLegal']).toBe('function'); }); + it('getPublicProjectBrandAsset: GET /{version}/public/projects/{ProjectId}/brand/{Kind}', async () => { + const stub = stubRequestForPath('/{version}/public/projects/{ProjectId}/brand/{Kind}'); + const expected = expectedUrl({ + baseUrl: 'https://api.norbix.io', + path: '/{version}/public/projects/{ProjectId}/brand/{Kind}', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.api as unknown as Record< + string, + Record Promise> + > + )['public']!['getPublicProjectBrandAsset']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('getPublicProjectConfig: GET /{version}/public/projects/{ProjectId}/config', async () => { const stub = stubRequestForPath('/{version}/public/projects/{ProjectId}/config'); const expected = expectedUrl({ diff --git a/tests/client.test.ts b/tests/client.test.ts index a5cffc1..4e685d3 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -264,7 +264,7 @@ describe('Headers + scoping', () => { { envSource: {} }, ); await call(norbix, 'hub', 'account', 'verifyAccount', { accountId: 'a1', token: 't1' }); - expect(new URL(captured!.url).searchParams.get('accountId')).toBe('a1'); + expect(JSON.parse(String(captured!.init.body))).toMatchObject({ accountId: 'a1' }); expect(new Headers(captured!.init.headers).has('Authorization')).toBe(false); }); }); diff --git a/tests/hub/account-anonymous.test.ts b/tests/hub/account-anonymous.test.ts index 2748a22..0f29301 100644 --- a/tests/hub/account-anonymous.test.ts +++ b/tests/hub/account-anonymous.test.ts @@ -9,7 +9,8 @@ import { createMockFetch } from '../_helpers.js'; * caller that has no token and no account id yet. The SDK sends them with * the `'unauthenticated'` scope: no `Authorization` header, no token check, * no account-scope check. `verifyAccount` carries its account id in the - * request only (query string), never from the client. + * request only (JSON body — the gateway made it a POST in 4ece218e6), never + * from the client. */ const HUB = 'https://hub.norbix.io'; @@ -59,7 +60,7 @@ const cases: Array<{ name: string; call: Call; method: string; path: string }> = { name: 'hub.account.verifyAccount', call: (n) => n.hub.account.verifyAccount({ accountId: 'acc-1', token: 'verify-1' }), - method: 'GET', + method: 'POST', path: '/v2/account/verify', }, ]; @@ -78,12 +79,12 @@ describe('hub.account — anonymous calls (no token, no accountId)', () => { expect(sent.headers.has('norbix-account-id')).toBe(false); }); - it('hub.account.verifyAccount: accountId and token travel in the query', async () => { + it('hub.account.verifyAccount: accountId and token travel in the body', async () => { const { norbix, mock } = anonymousClient(); await norbix.hub.account.verifyAccount({ accountId: 'acc-1', token: 'verify-1' }); - const query = new URL(mock.lastCall!.url).searchParams; - expect(query.get('accountId')).toBe('acc-1'); - expect(query.get('token')).toBe('verify-1'); + const body = JSON.parse(mock.lastCall!.body ?? '{}') as Record; + expect(body['accountId']).toBe('acc-1'); + expect(body['token']).toBe('verify-1'); }); }); diff --git a/tests/hub/account.test.ts b/tests/hub/account.test.ts index d27d23a..dfa0ce2 100644 --- a/tests/hub/account.test.ts +++ b/tests/hub/account.test.ts @@ -7,18 +7,17 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.account (113 endpoints). + * Tests for hub.account (121 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) * - issued HTTP verb + URL with version segment substituted and path * tokens interpolated from a stubbed request * - auth, project, and (when applicable) account headers - * - no Authorization header on the anonymous routes (createAccount, - * createTeamMemberFromInvitation, getAccountRegions, verifyAccount) + * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.account', () => { - it('module exposes 113 method(s)', () => { + it('module exposes 121 method(s)', () => { const mock = createMockFetch(); const mod = new AccountModule({} as never); void mod; // silence unused — we only need the type @@ -58,11 +57,19 @@ describe('hub.account', () => { expect(typeof ns['waitForProjectActive']).toBe('function'); expect(typeof ns['getProjectTokens']).toBe('function'); expect(typeof ns['setAdminPortalEnabled']).toBe('function'); + expect(typeof ns['updateProjectExposeBrand']).toBe('function'); + expect(typeof ns['updateProjectExposeAuth']).toBe('function'); expect(typeof ns['assignAdminPortalServiceUser']).toBe('function'); expect(typeof ns['getAdminPortalStructure']).toBe('function'); expect(typeof ns['updateProjectAdminUrl']).toBe('function'); + expect(typeof ns['createAiCreditPackCheckout']).toBe('function'); + expect(typeof ns['getProjectAiPlans']).toBe('function'); + expect(typeof ns['updateProjectAiPlans']).toBe('function'); + expect(typeof ns['updateProjectAiPlanAssignments']).toBe('function'); + expect(typeof ns['getProjectAiUserPlans']).toBe('function'); expect(typeof ns['getProjectAiSettings']).toBe('function'); expect(typeof ns['updateProjectAiSettings']).toBe('function'); + expect(typeof ns['updateProjectAiKnowledge']).toBe('function'); expect(typeof ns['createProjectAiAssistant']).toBe('function'); expect(typeof ns['updateProjectAiAssistant']).toBe('function'); expect(typeof ns['deleteProjectAiAssistant']).toBe('function'); @@ -80,8 +87,6 @@ describe('hub.account', () => { expect(typeof ns['checkProjectLanguages']).toBe('function'); expect(typeof ns['updateProjectLegalDocuments']).toBe('function'); expect(typeof ns['updateProjectExposeLegal']).toBe('function'); - expect(typeof ns['updateProjectExposeBrand']).toBe('function'); - expect(typeof ns['updateProjectExposeAuth']).toBe('function'); expect(typeof ns['updateProjectUrl']).toBe('function'); expect(typeof ns['updateProjectName']).toBe('function'); expect(typeof ns['updateProjectRegions']).toBe('function'); @@ -116,12 +121,14 @@ describe('hub.account', () => { expect(typeof ns['getLicenseDomainDnsStatus']).toBe('function'); expect(typeof ns['getLicenses']).toBe('function'); expect(typeof ns['getInstallationLicenseStatus']).toBe('function'); + expect(typeof ns['getLicenseKey']).toBe('function'); expect(typeof ns['createAiServiceUser']).toBe('function'); expect(typeof ns['listAiServiceUsers']).toBe('function'); expect(typeof ns['rotateAiServiceUserKey']).toBe('function'); expect(typeof ns['revokeAiServiceUserKey']).toBe('function'); expect(typeof ns['deleteAiServiceUser']).toBe('function'); expect(typeof ns['getAgentOnboarding']).toBe('function'); + expect(typeof ns['getAiContext']).toBe('function'); expect(typeof ns['getAiTools']).toBe('function'); expect(typeof ns['invokeAiTool']).toBe('function'); expect(typeof ns['uploadChatAttachment']).toBe('function'); @@ -191,7 +198,7 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('resendAccountVerificationToken: GET /{version}/account/verify/resend', async () => { + it('resendAccountVerificationToken: POST /{version}/account/verify/resend', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://hub.norbix.io', @@ -208,7 +215,7 @@ describe('hub.account', () => { )['account']!['resendAccountVerificationToken']!; await fn(stub); expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.method).toBe('POST'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); @@ -302,7 +309,6 @@ describe('hub.account', () => { expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - // Anonymous route: no Authorization header even when the client has a token. expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); @@ -330,7 +336,7 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('verifyAccount: GET /{version}/account/verify', async () => { + it('verifyAccount: POST /{version}/account/verify', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://hub.norbix.io', @@ -338,58 +344,21 @@ describe('hub.account', () => { version: 'v2', stub, }); - const { norbix, mock } = makeClient({ accountId: 'acc-1' }); + const { norbix, mock } = makeClient({}); const fn = ( norbix.hub as unknown as Record< string, Record Promise> > )['account']!['verifyAccount']!; - await fn({ ...stub, accountId: 'acc-1' }); + await fn(stub); expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.method).toBe('POST'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - // Anonymous route: no Authorization header even when the client has a token. expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('verifyAccount: works without accountId on the client (it travels in the query)', async () => { - const { norbix, mock } = makeClient(); - const fn = ( - norbix.hub as unknown as Record< - string, - Record Promise> - > - )['account']!['verifyAccount']!; - await fn({ accountId: 'acc-1', token: 'verify-1' }); - expect(mock.lastCall?.method).toBe('GET'); - expect(new URL(mock.lastCall!.url).searchParams.get('accountId')).toBe('acc-1'); - expect(mock.lastCall?.headers.has('norbix-account-id')).toBe(false); - }); - - it('verifyAccount: succeeds when accountId is configured', async () => { - const stub = {}; - const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/account/verify', - version: 'v2', - stub, - }); - const { norbix, mock } = makeClient({ accountId: 'acc-1' }); - const fn = ( - norbix.hub as unknown as Record< - string, - Record Promise> - > - )['account']!['verifyAccount']!; - await fn({ ...stub, accountId: 'acc-1' }); - expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('GET'); - expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - expect(mock.lastCall?.headers.get('norbix-account-id')).toBe('acc-1'); - }); - it('deleteNotificationsGroup: DELETE /{version}/account/projects/{projectId}/notifications/settings/group', async () => { const stub = stubRequestForPath( '/{version}/account/projects/{projectId}/notifications/settings/group', @@ -766,7 +735,6 @@ describe('hub.account', () => { expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('GET'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - // Anonymous route: no Authorization header even when the client has a token. expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); @@ -840,6 +808,54 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('updateProjectExposeBrand: PATCH /{version}/account/projects/{projectId}/settings/brand/expose', async () => { + const stub = stubRequestForPath( + '/{version}/account/projects/{projectId}/settings/brand/expose', + ); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/settings/brand/expose', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['updateProjectExposeBrand']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PATCH'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('updateProjectExposeAuth: PATCH /{version}/account/projects/{projectId}/settings/auth/expose', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/settings/auth/expose'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/settings/auth/expose', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['updateProjectExposeAuth']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PATCH'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('assignAdminPortalServiceUser: PUT /{version}/account/projects/{projectId}/settings/admin-portal/service-user', async () => { const stub = stubRequestForPath( '/{version}/account/projects/{projectId}/settings/admin-portal/service-user', @@ -913,6 +929,121 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('createAiCreditPackCheckout: POST /{version}/account/projects/{projectId}/ai/credits/checkout', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/credits/checkout'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/credits/checkout', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['createAiCreditPackCheckout']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getProjectAiPlans: GET /{version}/account/projects/{projectId}/ai/plans', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/plans'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/plans', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['getProjectAiPlans']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('updateProjectAiPlans: PUT /{version}/account/projects/{projectId}/ai/plans', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/plans'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/plans', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['updateProjectAiPlans']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('updateProjectAiPlanAssignments: PUT /{version}/account/projects/{projectId}/ai/plans/assignments', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/plans/assignments'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/plans/assignments', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['updateProjectAiPlanAssignments']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getProjectAiUserPlans: GET /{version}/account/projects/{projectId}/ai/plans/users', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/plans/users'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/plans/users', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['getProjectAiUserPlans']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('getProjectAiSettings: GET /{version}/account/projects/{projectId}/ai/settings', async () => { const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/settings'); const expected = expectedUrl({ @@ -959,6 +1090,29 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('updateProjectAiKnowledge: PUT /{version}/account/projects/{projectId}/ai/knowledge', async () => { + const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/knowledge'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/projects/{projectId}/ai/knowledge', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['updateProjectAiKnowledge']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('createProjectAiAssistant: POST /{version}/account/projects/{projectId}/ai/assistants', async () => { const stub = stubRequestForPath('/{version}/account/projects/{projectId}/ai/assistants'); const expected = expectedUrl({ @@ -1362,54 +1516,6 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('updateProjectExposeBrand: PATCH /{version}/account/projects/{projectId}/settings/brand/expose', async () => { - const stub = stubRequestForPath( - '/{version}/account/projects/{projectId}/settings/brand/expose', - ); - const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/account/projects/{projectId}/settings/brand/expose', - version: 'v2', - stub, - }); - const { norbix, mock } = makeClient({}); - const fn = ( - norbix.hub as unknown as Record< - string, - Record Promise> - > - )['account']!['updateProjectExposeBrand']!; - await fn(stub); - expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('PATCH'); - expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); - expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); - }); - - it('updateProjectExposeAuth: PATCH /{version}/account/projects/{projectId}/settings/auth/expose', async () => { - const stub = stubRequestForPath('/{version}/account/projects/{projectId}/settings/auth/expose'); - const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/account/projects/{projectId}/settings/auth/expose', - version: 'v2', - stub, - }); - const { norbix, mock } = makeClient({}); - const fn = ( - norbix.hub as unknown as Record< - string, - Record Promise> - > - )['account']!['updateProjectExposeAuth']!; - await fn(stub); - expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('PATCH'); - expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); - expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); - }); - it('updateProjectUrl: PATCH /{version}/account/projects/{projectId}/settings/url', async () => { const stub = stubRequestForPath('/{version}/account/projects/{projectId}/settings/url'); const expected = expectedUrl({ @@ -1498,7 +1604,6 @@ describe('hub.account', () => { expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - // Anonymous route: no Authorization header even when the client has a token. expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); @@ -2193,6 +2298,29 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('getLicenseKey: GET /{version}/account/licenses/{Id}/key', async () => { + const stub = stubRequestForPath('/{version}/account/licenses/{Id}/key'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/licenses/{Id}/key', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['getLicenseKey']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('createAiServiceUser: POST /{version}/account/ai/service-users', async () => { const stub = {}; const expected = expectedUrl({ @@ -2331,6 +2459,29 @@ describe('hub.account', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('getAiContext: GET /{version}/account/ai/context', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/account/ai/context', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['account']!['getAiContext']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('getAiTools: GET /{version}/account/ai/tools', async () => { const stub = {}; const expected = expectedUrl({ diff --git a/tests/hub/ai.test.ts b/tests/hub/ai.test.ts index b322eed..23f479b 100644 --- a/tests/hub/ai.test.ts +++ b/tests/hub/ai.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.ai (20 endpoints). + * Tests for hub.ai (26 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.ai', () => { - it('module exposes 20 method(s)', () => { + it('module exposes 26 method(s)', () => { const mock = createMockFetch(); const mod = new AiModule({} as never); void mod; // silence unused — we only need the type @@ -26,6 +26,12 @@ describe('hub.ai', () => { const ns = (norbix.hub as unknown as Record)['ai'] as Record; expect(ns).toBeDefined(); void mock; + expect(typeof ns['saveAiProjectTrigger']).toBe('function'); + expect(typeof ns['getAiProjectTriggers']).toBe('function'); + expect(typeof ns['getAiProjectTrigger']).toBe('function'); + expect(typeof ns['enableAiProjectTrigger']).toBe('function'); + expect(typeof ns['disableAiProjectTrigger']).toBe('function'); + expect(typeof ns['deleteAiProjectTrigger']).toBe('function'); expect(typeof ns['deleteEmbeddingIntegration']).toBe('function'); expect(typeof ns['getEmbeddingIntegration']).toBe('function'); expect(typeof ns['getEmbeddingIntegrations']).toBe('function'); @@ -48,6 +54,144 @@ describe('hub.ai', () => { expect(typeof ns['testMcpIntegration']).toBe('function'); }); + it('saveAiProjectTrigger: POST /{version}/ai/triggers', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['saveAiProjectTrigger']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getAiProjectTriggers: GET /{version}/ai/triggers', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['getAiProjectTriggers']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getAiProjectTrigger: GET /{version}/ai/triggers/{id}', async () => { + const stub = stubRequestForPath('/{version}/ai/triggers/{id}'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers/{id}', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['getAiProjectTrigger']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('enableAiProjectTrigger: PATCH /{version}/ai/triggers/{triggerId}/enable', async () => { + const stub = stubRequestForPath('/{version}/ai/triggers/{triggerId}/enable'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers/{triggerId}/enable', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['enableAiProjectTrigger']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PATCH'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('disableAiProjectTrigger: PATCH /{version}/ai/triggers/{triggerId}/disable', async () => { + const stub = stubRequestForPath('/{version}/ai/triggers/{triggerId}/disable'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers/{triggerId}/disable', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['disableAiProjectTrigger']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PATCH'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('deleteAiProjectTrigger: DELETE /{version}/ai/triggers/{triggerId}', async () => { + const stub = stubRequestForPath('/{version}/ai/triggers/{triggerId}'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/ai/triggers/{triggerId}', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['ai']!['deleteAiProjectTrigger']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('DELETE'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('deleteEmbeddingIntegration: DELETE /{version}/ai/integrations/embeddings/{Id}', async () => { const stub = stubRequestForPath('/{version}/ai/integrations/embeddings/{Id}'); const expected = expectedUrl({ diff --git a/tests/hub/auth.test.ts b/tests/hub/auth.test.ts index 6c0a328..aa13404 100644 --- a/tests/hub/auth.test.ts +++ b/tests/hub/auth.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient } from '../_helpers.js'; * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.auth (1 endpoints). + * Tests for hub.auth (5 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient } from '../_helpers.js'; * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.auth', () => { - it('module exposes 1 method(s)', () => { + it('module exposes 5 method(s)', () => { const mock = createMockFetch(); const mod = new AuthModule({} as never); void mod; // silence unused — we only need the type @@ -29,9 +29,105 @@ describe('hub.auth', () => { >; expect(ns).toBeDefined(); void mock; + expect(typeof ns['authDeviceStart']).toBe('function'); + expect(typeof ns['authDeviceToken']).toBe('function'); + expect(typeof ns['authDeviceConsent']).toBe('function'); + expect(typeof ns['authDeviceConsentDecision']).toBe('function'); expect(typeof ns['authenticate']).toBe('function'); }); + it('authDeviceStart: POST /{version}/auth/device/start', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/auth/device/start', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['auth']!['authDeviceStart']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('authDeviceToken: POST /{version}/auth/device/token', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/auth/device/token', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['auth']!['authDeviceToken']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('authDeviceConsent: GET /{version}/auth/device/consent', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/auth/device/consent', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['auth']!['authDeviceConsent']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('authDeviceConsentDecision: POST /{version}/auth/device/consent', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/auth/device/consent', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['auth']!['authDeviceConsentDecision']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('authenticate: POST /v3/auth', async () => { const stub = {}; const expected = expectedUrl({ diff --git a/tests/hub/database.test.ts b/tests/hub/database.test.ts index 2b7ce9e..19b75fc 100644 --- a/tests/hub/database.test.ts +++ b/tests/hub/database.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.database (73 endpoints). + * Tests for hub.database (74 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.database', () => { - it('module exposes 73 method(s)', () => { + it('module exposes 74 method(s)', () => { const mock = createMockFetch(); const mod = new DatabaseModule({} as never); void mod; // silence unused — we only need the type @@ -703,6 +703,29 @@ describe('hub.database', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('getDatabaseSchemaIndexStatus: GET /{version}/database/schemas/{Id}/index-status', async () => { + const stub = stubRequestForPath('/{version}/database/schemas/{Id}/index-status'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/database/schemas/{Id}/index-status', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['database']!['getDatabaseSchemaIndexStatus']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('getDatabaseSchemaListSettings: GET /{version}/database/schemas/{Id}/list-settings', async () => { const stub = stubRequestForPath('/{version}/database/schemas/{Id}/list-settings'); const expected = expectedUrl({ diff --git a/tests/hub/email.test.ts b/tests/hub/email.test.ts index 52a8f97..6b9a1bd 100644 --- a/tests/hub/email.test.ts +++ b/tests/hub/email.test.ts @@ -29,44 +29,38 @@ describe('hub.email', () => { >; expect(ns).toBeDefined(); void mock; - expect(typeof ns['getEmailPreferencesByLink']).toBe('function'); expect(typeof ns['oneClickUnsubscribe']).toBe('function'); + expect(typeof ns['getEmailPreferencesByLink']).toBe('function'); }); - it('getEmailPreferencesByLink: GET /{version}/email/preferences', async () => { - const stub = { token: 'signed.link.token' }; + it('oneClickUnsubscribe: POST /{version}/email/one-click-unsubscribe', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/email/one-click-unsubscribe', + version: 'v2', + stub, + }); const { norbix, mock } = makeClient({}); const fn = ( norbix.hub as unknown as Record< string, Record Promise> > - )['email']!['getEmailPreferencesByLink']!; + )['email']!['oneClickUnsubscribe']!; await fn(stub); expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('GET'); - expect(mock.lastCall?.url).toBe( - 'https://hub.norbix.io/v2/email/preferences?token=signed.link.token', - ); - // A signed-in client still sends its token (scope 'optional'). + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('getEmailPreferencesByLink: works with no apiKey / bearerToken and sends no Authorization', async () => { - const { norbix, mock } = makeClient({ bearerToken: undefined, apiKey: undefined }); - await norbix.hub.email.getEmailPreferencesByLink({ token: 'signed.link.token' }); - expect(mock.lastCall?.method).toBe('GET'); - expect(mock.lastCall?.url).toBe( - 'https://hub.norbix.io/v2/email/preferences?token=signed.link.token', - ); - expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); - }); - - it('oneClickUnsubscribe: POST /{version}/email/one-click-unsubscribe', async () => { + it('getEmailPreferencesByLink: GET /{version}/email/preferences', async () => { const stub = {}; const expected = expectedUrl({ baseUrl: 'https://hub.norbix.io', - path: '/{version}/email/one-click-unsubscribe', + path: '/{version}/email/preferences', version: 'v2', stub, }); @@ -76,20 +70,12 @@ describe('hub.email', () => { string, Record Promise> > - )['email']!['oneClickUnsubscribe']!; + )['email']!['getEmailPreferencesByLink']!; await fn(stub); expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.method).toBe('GET'); expect(mock.lastCall?.url.startsWith(expected)).toBe(true); expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - - it('oneClickUnsubscribe: works with no apiKey / bearerToken and sends no Authorization', async () => { - const { norbix, mock } = makeClient({ bearerToken: undefined, apiKey: undefined }); - await norbix.hub.email.oneClickUnsubscribe({}); - expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url).toBe('https://hub.norbix.io/v2/email/one-click-unsubscribe'); - expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); - }); }); diff --git a/tests/hub/files.test.ts b/tests/hub/files.test.ts index f9f81da..35a8e66 100644 --- a/tests/hub/files.test.ts +++ b/tests/hub/files.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.files (23 endpoints). + * Tests for hub.files (24 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.files', () => { - it('module exposes 23 method(s)', () => { + it('module exposes 24 method(s)', () => { const mock = createMockFetch(); const mod = new FilesModule({} as never); void mod; // silence unused — we only need the type @@ -52,6 +52,7 @@ describe('hub.files', () => { expect(typeof ns['getFile']).toBe('function'); expect(typeof ns['getFileById']).toBe('function'); expect(typeof ns['getFolderFiles']).toBe('function'); + expect(typeof ns['useFile']).toBe('function'); }); it('disableFiles: PUT /{version}/files/disable', async () => { @@ -582,4 +583,27 @@ describe('hub.files', () => { expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + + it('useFile: POST /{version}/files/item/use', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/files/item/use', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['files']!['useFile']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); }); diff --git a/tests/hub/logs.test.ts b/tests/hub/logs.test.ts index 18ebc49..86fe0ba 100644 --- a/tests/hub/logs.test.ts +++ b/tests/hub/logs.test.ts @@ -321,22 +321,6 @@ describe('hub.logs', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('getLogs: metaKey / metaValue go in the query string with the other filters', async () => { - const { norbix, mock } = makeClient({}); - await norbix.hub.logs.getLogs({ - module: 'Scheduler', - metaKey: 'taskId', - metaValue: 'tsk_123', - }); - expect(mock.lastCall?.method).toBe('GET'); - const url = new URL(mock.lastCall!.url); - expect(`${url.origin}${url.pathname}`).toBe('https://hub.norbix.io/v2/logs'); - expect(url.searchParams.get('module')).toBe('Scheduler'); - expect(url.searchParams.get('metaKey')).toBe('taskId'); - expect(url.searchParams.get('metaValue')).toBe('tsk_123'); - expect(mock.lastCall?.body).toBeUndefined(); - }); - it('getLogSettings: GET /{version}/logs/settings', async () => { const stub = {}; const expected = expectedUrl({ @@ -382,4 +366,22 @@ describe('hub.logs', () => { expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + + // @hand-written:begin + it('getLogs: metaKey / metaValue go in the query string with the other filters', async () => { + const { norbix, mock } = makeClient({}); + await norbix.hub.logs.getLogs({ + module: 'Scheduler', + metaKey: 'taskId', + metaValue: 'tsk_123', + }); + expect(mock.lastCall?.method).toBe('GET'); + const url = new URL(mock.lastCall!.url); + expect(`${url.origin}${url.pathname}`).toBe('https://hub.norbix.io/v2/logs'); + expect(url.searchParams.get('module')).toBe('Scheduler'); + expect(url.searchParams.get('metaKey')).toBe('taskId'); + expect(url.searchParams.get('metaValue')).toBe('tsk_123'); + expect(mock.lastCall?.body).toBeUndefined(); + }); + // @hand-written:end }); diff --git a/tests/hub/membership.test.ts b/tests/hub/membership.test.ts index ffaea2e..4e9ade3 100644 --- a/tests/hub/membership.test.ts +++ b/tests/hub/membership.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.membership (44 endpoints). + * Tests for hub.membership (48 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.membership', () => { - it('module exposes 44 method(s)', () => { + it('module exposes 48 method(s)', () => { const mock = createMockFetch(); const mod = new MembershipModule({} as never); void mod; // silence unused — we only need the type @@ -31,6 +31,8 @@ describe('hub.membership', () => { void mock; expect(typeof ns['disableMembership']).toBe('function'); expect(typeof ns['enableMembership']).toBe('function'); + expect(typeof ns['importUsers']).toBe('function'); + expect(typeof ns['repairLoginProjectIds']).toBe('function'); expect(typeof ns['issueServiceUserApiKey']).toBe('function'); expect(typeof ns['listServiceUserApiKeys']).toBe('function'); expect(typeof ns['deleteServiceUserApiKey']).toBe('function'); @@ -64,11 +66,13 @@ describe('hub.membership', () => { expect(typeof ns['updatePasswordComplexity']).toBe('function'); expect(typeof ns['getAuthenticationSettings']).toBe('function'); expect(typeof ns['updateAuthenticationSettings']).toBe('function'); + expect(typeof ns['setUserAiPlan']).toBe('function'); expect(typeof ns['createContact']).toBe('function'); expect(typeof ns['deleteContact']).toBe('function'); expect(typeof ns['getContact']).toBe('function'); expect(typeof ns['getAllContacts']).toBe('function'); expect(typeof ns['mergeContacts']).toBe('function'); + expect(typeof ns['repairContactRoles']).toBe('function'); expect(typeof ns['updateContact']).toBe('function'); expect(typeof ns['addContactIdentity']).toBe('function'); expect(typeof ns['promoteContactIdentity']).toBe('function'); @@ -121,6 +125,52 @@ describe('hub.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('importUsers: POST /{version}/membership/users/import', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/membership/users/import', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['membership']!['importUsers']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('repairLoginProjectIds: POST /{version}/membership/users/repair-logins', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/membership/users/repair-logins', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['membership']!['repairLoginProjectIds']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('issueServiceUserApiKey: POST /{version}/membership/users/{Id}/api-keys', async () => { const stub = stubRequestForPath('/{version}/membership/users/{Id}/api-keys'); const expected = expectedUrl({ @@ -880,6 +930,29 @@ describe('hub.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('setUserAiPlan: PUT /{version}/membership/users/{userId}/ai-plan', async () => { + const stub = stubRequestForPath('/{version}/membership/users/{userId}/ai-plan'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/membership/users/{userId}/ai-plan', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['membership']!['setUserAiPlan']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('createContact: POST /{version}/membership/users', async () => { const stub = {}; const expected = expectedUrl({ @@ -995,6 +1068,29 @@ describe('hub.membership', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); + it('repairContactRoles: POST /{version}/membership/users/repair-roles', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/membership/users/repair-roles', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['membership']!['repairContactRoles']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('updateContact: PATCH /{version}/membership/users/{contactId}', async () => { const stub = stubRequestForPath('/{version}/membership/users/{contactId}'); const expected = expectedUrl({ diff --git a/tests/hub/notifications.test.ts b/tests/hub/notifications.test.ts index 7e2b0e2..f91bdc5 100644 --- a/tests/hub/notifications.test.ts +++ b/tests/hub/notifications.test.ts @@ -29,6 +29,7 @@ describe('hub.notifications', () => { >; expect(ns).toBeDefined(); void mock; + expect(typeof ns['createSmsCampaign']).toBe('function'); expect(typeof ns['disableEmail']).toBe('function'); expect(typeof ns['getEmailDisableDependencies']).toBe('function'); expect(typeof ns['enableEmail']).toBe('function'); @@ -100,7 +101,6 @@ describe('hub.notifications', () => { expect(typeof ns['saveSmsIntegration']).toBe('function'); expect(typeof ns['setSmsIntegrationAsDefault']).toBe('function'); expect(typeof ns['testSmsIntegration']).toBe('function'); - expect(typeof ns['createSmsCampaign']).toBe('function'); expect(typeof ns['deleteSmsCampaign']).toBe('function'); expect(typeof ns['getSmsCampaign']).toBe('function'); expect(typeof ns['getSmsCampaigns']).toBe('function'); @@ -155,6 +155,29 @@ describe('hub.notifications', () => { expect(typeof ns['unsubscribeContact']).toBe('function'); }); + it('createSmsCampaign: POST /{version}/notifications/sms/campaigns', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/notifications/sms/campaigns', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['notifications']!['createSmsCampaign']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('POST'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('disableEmail: PUT /{version}/notifications/email/disable', async () => { const stub = {}; const expected = expectedUrl({ @@ -1794,29 +1817,6 @@ describe('hub.notifications', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('createSmsCampaign: POST /{version}/notifications/sms/campaigns', async () => { - const stub = {}; - const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/notifications/sms/campaigns', - version: 'v2', - stub, - }); - const { norbix, mock } = makeClient({}); - const fn = ( - norbix.hub as unknown as Record< - string, - Record Promise> - > - )['notifications']!['createSmsCampaign']!; - await fn(stub); - expect(mock.lastCall).toBeDefined(); - expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url.startsWith(expected)).toBe(true); - expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); - expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); - }); - it('deleteSmsCampaign: DELETE /{version}/notifications/sms/campaigns/{id}', async () => { const stub = stubRequestForPath('/{version}/notifications/sms/campaigns/{id}'); const expected = expectedUrl({ @@ -2977,13 +2977,13 @@ describe('hub.notifications', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('grantContactConsent: POST /{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent', async () => { + it('grantContactConsent: POST /{version}/membership/users/{contactId}/marketing-state/{channel}/consent', async () => { const stub = stubRequestForPath( - '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent', + '/{version}/membership/users/{contactId}/marketing-state/{channel}/consent', ); const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/consent', + baseUrl: 'https://api.norbix.io', + path: '/{version}/membership/users/{contactId}/marketing-state/{channel}/consent', version: 'v2', stub, }); @@ -3002,13 +3002,13 @@ describe('hub.notifications', () => { expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); - it('unsubscribeContact: POST /{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe', async () => { + it('unsubscribeContact: POST /{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe', async () => { const stub = stubRequestForPath( - '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe', + '/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe', ); const expected = expectedUrl({ - baseUrl: 'https://hub.norbix.io', - path: '/{version}/notifications/contacts/{contactId}/marketing-state/{channel}/unsubscribe', + baseUrl: 'https://api.norbix.io', + path: '/{version}/membership/users/{contactId}/marketing-state/{channel}/unsubscribe', version: 'v2', stub, }); diff --git a/tests/hub/public.test.ts b/tests/hub/public.test.ts index 4b4e1aa..dfb1b6c 100644 --- a/tests/hub/public.test.ts +++ b/tests/hub/public.test.ts @@ -7,7 +7,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` * to refresh this file from the DTO definitions. * - * Tests for hub.public (2 endpoints). + * Tests for hub.public (3 endpoints). * * Each method is asserted against: * - presence on the module (smoke check) @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '.. * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ describe('hub.public', () => { - it('module exposes 2 method(s)', () => { + it('module exposes 3 method(s)', () => { const mock = createMockFetch(); const mod = new PublicModule({} as never); void mod; // silence unused — we only need the type @@ -29,10 +29,34 @@ describe('hub.public', () => { >; expect(ns).toBeDefined(); void mock; + expect(typeof ns['getPublicProjectBrandAsset']).toBe('function'); expect(typeof ns['getPublicProjectConfig']).toBe('function'); expect(typeof ns['getPublicProjectLegal']).toBe('function'); }); + it('getPublicProjectBrandAsset: GET /{version}/public/projects/{ProjectId}/brand/{Kind}', async () => { + const stub = stubRequestForPath('/{version}/public/projects/{ProjectId}/brand/{Kind}'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/public/projects/{ProjectId}/brand/{Kind}', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['public']!['getPublicProjectBrandAsset']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBeNull(); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + it('getPublicProjectConfig: GET /{version}/public/projects/{ProjectId}/config', async () => { const stub = stubRequestForPath('/{version}/public/projects/{ProjectId}/config'); const expected = expectedUrl({ diff --git a/tests/hub/scheduler.test.ts b/tests/hub/scheduler.test.ts index e435d75..878ba87 100644 --- a/tests/hub/scheduler.test.ts +++ b/tests/hub/scheduler.test.ts @@ -1,371 +1,249 @@ import { describe, expect, it } from 'vitest'; -import type { - SaveSchedulerTaskInput, - SchedulerTaskInput, - SchedulerTaskRunsResponse, -} from '../../src/hub/index.js'; -import { CodeMashHub2 } from '../../src/types/hub2.dtos.js'; -import { createMockFetch, makeClient } from '../_helpers.js'; +import { SchedulerModule } from '../../src/hub/scheduler.js'; +import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '../_helpers.js'; /** + * Auto-generated. Do not edit by hand — run `npm run generate-endpoints` + * to refresh this file from the DTO definitions. + * * Tests for hub.scheduler (9 endpoints). * * Each method is asserted against: - * - the HTTP verb and the full URL (version segment + path tokens) - * - where the request fields go: path, query string or JSON body - * - auth and project headers - * - * `saveSchedulerTask` also checks the JSON body: the gateway picks the task - * subtype from `task.type` (`EmailCampaign`, `SmsCampaign` or `PushCampaign`) - * and the campaign audience from `task.campaign.source` (email, push) or - * `task.campaign.deliveryType` (SMS). Every call goes to a mock fetch. + * - presence on the module (smoke check) + * - issued HTTP verb + URL with version segment substituted and path + * tokens interpolated from a stubbed request + * - auth, project, and (when applicable) account headers + * - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId */ -const HUB = 'https://hub.norbix.io/v2'; - -function client() { - const { norbix, mock } = makeClient({}); - return { scheduler: norbix.hub.scheduler, mock }; -} - -function expectAuthHeaders(headers: Headers | undefined) { - expect(headers?.get('Authorization')).toBe('Bearer test-token'); - expect(headers?.get('norbix-project-id')).toBe('test-project'); -} - -function sentBody(raw: string | undefined): Record { - expect(raw).toBeDefined(); - return JSON.parse(raw!) as Record; -} - describe('hub.scheduler', () => { it('module exposes 9 method(s)', () => { - const { scheduler } = client(); - const methods = Object.entries(scheduler) - .filter(([, v]) => typeof v === 'function') - .map(([k]) => k); - expect(methods.sort()).toEqual( - [ - 'deleteSchedulerTask', - 'disableScheduler', - 'disableSchedulerTask', - 'enableScheduler', - 'enableSchedulerTask', - 'getSchedulerTask', - 'getSchedulerTaskRuns', - 'getSchedulerTasks', - 'saveSchedulerTask', - ].sort(), - ); - }); - - it('enableScheduler: PUT /{version}/scheduler/enable, no body', async () => { - const { scheduler, mock } = client(); - await scheduler.enableScheduler(); - expect(mock.lastCall?.method).toBe('PUT'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/enable`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('disableScheduler: PUT /{version}/scheduler/disable, no body', async () => { - const { scheduler, mock } = client(); - await scheduler.disableScheduler(); - expect(mock.lastCall?.method).toBe('PUT'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/disable`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('getSchedulerTasks: GET /{version}/scheduler/tasks, filters in the query string', async () => { - const { scheduler, mock } = client(); - await scheduler.getSchedulerTasks({ - type: CodeMashHub2.SchedulerTaskType.EmailCampaign, - enabled: true, + const mock = createMockFetch(); + const mod = new SchedulerModule({} as never); + void mod; // silence unused — we only need the type + // Sanity check the auto-mapped surface exists on the namespaced client. + const { norbix } = makeClient(); + const ns = (norbix.hub as unknown as Record)['scheduler'] as Record< + string, + unknown + >; + expect(ns).toBeDefined(); + void mock; + expect(typeof ns['disableScheduler']).toBe('function'); + expect(typeof ns['enableScheduler']).toBe('function'); + expect(typeof ns['deleteSchedulerTask']).toBe('function'); + expect(typeof ns['disableSchedulerTask']).toBe('function'); + expect(typeof ns['enableSchedulerTask']).toBe('function'); + expect(typeof ns['getSchedulerTask']).toBe('function'); + expect(typeof ns['getSchedulerTasks']).toBe('function'); + expect(typeof ns['getSchedulerTaskRuns']).toBe('function'); + expect(typeof ns['saveSchedulerTask']).toBe('function'); + }); + + it('disableScheduler: PUT /{version}/scheduler/disable', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/disable', + version: 'v2', + stub, }); - expect(mock.lastCall?.method).toBe('GET'); - const url = new URL(mock.lastCall!.url); - expect(`${url.origin}${url.pathname}`).toBe(`${HUB}/scheduler/tasks`); - expect(url.searchParams.get('type')).toBe('EmailCampaign'); - expect(url.searchParams.get('enabled')).toBe('true'); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('getSchedulerTask: GET /{version}/scheduler/tasks/{id}, id in the path', async () => { - const { scheduler, mock } = client(); - await scheduler.getSchedulerTask({ id: 'tsk_123' }); - expect(mock.lastCall?.method).toBe('GET'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('getSchedulerTaskRuns: GET /{version}/scheduler/tasks/{id}/runs, id in the path, take in the query', async () => { - const { scheduler, mock } = client(); - await scheduler.getSchedulerTaskRuns({ id: 'tsk_123', take: 25 }); - expect(mock.lastCall?.method).toBe('GET'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123/runs?take=25`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('getSchedulerTaskRuns: no take sends no query string (the gateway defaults to 10)', async () => { - const { scheduler, mock } = client(); - await scheduler.getSchedulerTaskRuns({ id: 'tsk_123' }); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123/runs`); - }); - - it('getSchedulerTaskRuns: returns the runs with the outcome as the wire string', async () => { - const body = { - logsEnabled: true, - runs: [ - { - logId: 'log_2', - atUtc: '2026-10-07T10:00:00Z', - atUnix: 1791367200, - outcome: 'Failed', - reason: 'run-failed', - detail: 'Template not found', - correlationId: 'corr_2', - }, - { logId: 'log_1', atUtc: '2026-10-07T09:00:00Z', atUnix: 1791363600, outcome: 'Fired' }, - ], - }; - const mock = createMockFetch({ body }); - const { norbix } = makeClient({ fetch: mock.fetch }); - const result: SchedulerTaskRunsResponse = await norbix.hub.scheduler.getSchedulerTaskRuns({ - id: 'tsk_123', - }); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123/runs`); - expect(result.logsEnabled).toBe(true); - expect(result.runs.map((r) => [r.outcome, r.reason])).toEqual([ - ['Failed', 'run-failed'], - ['Fired', undefined], - ]); - }); - - it('getSchedulerTaskRuns: the task id is required', () => { - const { scheduler } = client(); - // @ts-expect-error — `id` is required - const call = () => scheduler.getSchedulerTaskRuns({ take: 5 }); - expect(typeof call).toBe('function'); - }); - - it('enableSchedulerTask: PUT /{version}/scheduler/tasks/{Id}/enable, id in the path', async () => { - const { scheduler, mock } = client(); - await scheduler.enableSchedulerTask({ id: 'tsk_123' }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['disableScheduler']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('PUT'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123/enable`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('disableSchedulerTask: PUT /{version}/scheduler/tasks/{Id}/disable, id in the path', async () => { - const { scheduler, mock } = client(); - await scheduler.disableSchedulerTask({ id: 'tsk_123' }); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('enableScheduler: PUT /{version}/scheduler/enable', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/enable', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['enableScheduler']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('PUT'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123/disable`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('deleteSchedulerTask: DELETE /{version}/scheduler/tasks/{Id}, id in the path', async () => { - const { scheduler, mock } = client(); - await scheduler.deleteSchedulerTask({ id: 'tsk_123' }); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('deleteSchedulerTask: DELETE /{version}/scheduler/tasks/{Id}', async () => { + const stub = stubRequestForPath('/{version}/scheduler/tasks/{Id}'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks/{Id}', + version: 'v2', + stub, + }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['deleteSchedulerTask']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('DELETE'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks/tsk_123`); - expect(mock.lastCall?.body).toBeUndefined(); - expectAuthHeaders(mock.lastCall?.headers); - }); - - it('saveSchedulerTask: POST /{version}/scheduler/tasks, typed EmailCampaign task in the JSON body', async () => { - const { scheduler, mock } = client(); - // Plain string literals for `type` and `source`, no cast: this call is - // also the type-check that the typed task body is accepted. - await scheduler.saveSchedulerTask({ - name: 'Weekly digest', - cron: '0 9 * * 1', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'EmailCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tpl_123', - rolesNames: ['subscriber'], - }, - }, + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('disableSchedulerTask: PUT /{version}/scheduler/tasks/{Id}/disable', async () => { + const stub = stubRequestForPath('/{version}/scheduler/tasks/{Id}/disable'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks/{Id}/disable', + version: 'v2', + stub, }); - expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks`); - expect(mock.lastCall?.headers.get('Content-Type')).toBe('application/json'); - expectAuthHeaders(mock.lastCall?.headers); - expect(sentBody(mock.lastCall?.body)).toEqual({ - name: 'Weekly digest', - cron: '0 9 * * 1', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'EmailCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tpl_123', - rolesNames: ['subscriber'], - }, - }, + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['disableSchedulerTask']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('enableSchedulerTask: PUT /{version}/scheduler/tasks/{Id}/enable', async () => { + const stub = stubRequestForPath('/{version}/scheduler/tasks/{Id}/enable'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks/{Id}/enable', + version: 'v2', + stub, }); - }); - - it('saveSchedulerTask: update sends taskId in the body; DTO class instances are accepted', async () => { - const { scheduler, mock } = client(); - const request: SaveSchedulerTaskInput = { - taskId: 'tsk_123', - name: 'Weekly digest', - cron: '0 9 * * 1', - initiatorUserId: 'usr_123', - isEnabled: false, - stopOnError: true, - task: new CodeMashHub2.EmailCampaignSchedulerTaskRequest({ - type: CodeMashHub2.SchedulerTaskType.EmailCampaign, - databaseIntegrationId: 'int_db', - campaign: new CodeMashHub2.EmailToAllUsersDeliverySettingsRequest({ - source: CodeMashHub2.EmailCampaignRecipientsSourceTypes.AllUsers, - templateId: 'tpl_123', - }), - }), - }; - await scheduler.saveSchedulerTask(request); - expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks`); - expect(sentBody(mock.lastCall?.body)).toEqual({ - taskId: 'tsk_123', - name: 'Weekly digest', - cron: '0 9 * * 1', - initiatorUserId: 'usr_123', - isEnabled: false, - stopOnError: true, - task: { - type: 'EmailCampaign', - databaseIntegrationId: 'int_db', - campaign: { source: 'AllUsers', templateId: 'tpl_123' }, - }, + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['enableSchedulerTask']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('PUT'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getSchedulerTask: GET /{version}/scheduler/tasks/{id}', async () => { + const stub = stubRequestForPath('/{version}/scheduler/tasks/{id}'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks/{id}', + version: 'v2', + stub, }); - }); - it('saveSchedulerTask: POST /{version}/scheduler/tasks, typed SmsCampaign task in the JSON body', async () => { - const { scheduler, mock } = client(); - // Plain object literal, no cast: also the type-check of the SMS task input. - await scheduler.saveSchedulerTask({ - name: 'Daily SMS reminder', - cron: '0 8 * * *', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'SmsCampaign', - databaseIntegrationId: 'int_db', - campaign: { - templateId: 'tmpl_sms', - integrationId: 'int_sms', - deliveryType: 'SpecifiedUsers', - specifiedUsers: { - recipientsSourceType: 'SpecifiedUsers', - recipients: ['usr_1', 'usr_2'], - }, - }, - }, + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['getSchedulerTask']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getSchedulerTasks: GET /{version}/scheduler/tasks', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks', + version: 'v2', + stub, }); - expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks`); - expect(mock.lastCall?.headers.get('Content-Type')).toBe('application/json'); - expectAuthHeaders(mock.lastCall?.headers); - expect(sentBody(mock.lastCall?.body)).toEqual({ - name: 'Daily SMS reminder', - cron: '0 8 * * *', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: false, - task: { - type: 'SmsCampaign', - databaseIntegrationId: 'int_db', - campaign: { - templateId: 'tmpl_sms', - integrationId: 'int_sms', - deliveryType: 'SpecifiedUsers', - specifiedUsers: { - recipientsSourceType: 'SpecifiedUsers', - recipients: ['usr_1', 'usr_2'], - }, - }, - }, + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['getSchedulerTasks']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('getSchedulerTaskRuns: GET /{version}/scheduler/tasks/{id}/runs', async () => { + const stub = stubRequestForPath('/{version}/scheduler/tasks/{id}/runs'); + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks/{id}/runs', + version: 'v2', + stub, }); - }); - - it('saveSchedulerTask: POST /{version}/scheduler/tasks, typed PushCampaign task in the JSON body', async () => { - const { scheduler, mock } = client(); - // Plain object literal, no cast: also the type-check of the push task input. - await scheduler.saveSchedulerTask({ - name: 'Weekly push', - cron: '0 18 * * 5', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: true, - task: { - type: 'PushCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tmpl_push', - integrationId: 'int_push', - rolesNames: ['subscriber'], - platforms: ['Ios', 'Android'], - }, - }, + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['getSchedulerTaskRuns']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); + expect(mock.lastCall?.method).toBe('GET'); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); + }); + + it('saveSchedulerTask: POST /{version}/scheduler/tasks', async () => { + const stub = {}; + const expected = expectedUrl({ + baseUrl: 'https://hub.norbix.io', + path: '/{version}/scheduler/tasks', + version: 'v2', + stub, }); + const { norbix, mock } = makeClient({}); + const fn = ( + norbix.hub as unknown as Record< + string, + Record Promise> + > + )['scheduler']!['saveSchedulerTask']!; + await fn(stub); + expect(mock.lastCall).toBeDefined(); expect(mock.lastCall?.method).toBe('POST'); - expect(mock.lastCall?.url).toBe(`${HUB}/scheduler/tasks`); - expect(mock.lastCall?.headers.get('Content-Type')).toBe('application/json'); - expectAuthHeaders(mock.lastCall?.headers); - expect(sentBody(mock.lastCall?.body)).toEqual({ - name: 'Weekly push', - cron: '0 18 * * 5', - initiatorUserId: 'usr_123', - isEnabled: true, - stopOnError: true, - task: { - type: 'PushCampaign', - campaign: { - source: 'AllUsers', - templateId: 'tmpl_push', - integrationId: 'int_push', - rolesNames: ['subscriber'], - platforms: ['Ios', 'Android'], - }, - }, - }); - }); - - it('SchedulerTaskInput: an unknown type literal or a missing required field fails the typecheck', () => { - // @ts-expect-error — 'WebhookCall' tasks are not supported yet (no typed input) - const webhook: SchedulerTaskInput = { type: 'WebhookCall' }; - // @ts-expect-error — not a task type at all - const bogus: SchedulerTaskInput = { type: 'SmsCampaigns', campaign: {} }; - const noIntegration: SchedulerTaskInput = { - type: 'SmsCampaign', - // @ts-expect-error — an SMS campaign needs `integrationId` and an audience - campaign: { templateId: 'tmpl_sms' }, - }; - const noTemplate: SchedulerTaskInput = { - type: 'PushCampaign', - // @ts-expect-error — a push campaign needs `templateId` - campaign: { source: 'AllUsers' }, - }; - expect([webhook, bogus, noIntegration, noTemplate].map((t) => t.type)).toEqual([ - 'WebhookCall', - 'SmsCampaigns', - 'SmsCampaign', - 'PushCampaign', - ]); + expect(mock.lastCall?.url.startsWith(expected)).toBe(true); + expect(mock.lastCall?.headers.get('Authorization')).toBe('Bearer test-token'); + expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project'); }); });