Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/hub/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Accessed as `norbix.hub.code` on the [`Norbix`](../../README.md#authentication)
| [`saveMarketplaceIntegrationCustomAccess`](#savemarketplaceintegrationcustomaccess) | `POST` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/access/roles/custom` | `project` |
| [`getMarketplaceIntegrationTools`](#getmarketplaceintegrationtools) | `GET` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/tools` | `project` |
| [`startMarketplaceIntegrationSignIn`](#startmarketplaceintegrationsignin) | `POST` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/start` | `project` |
| [`signOutMarketplaceIntegration`](#signoutmarketplaceintegration) | `POST` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out` | `project` |
| [`replaceMarketplaceIntegrationSecrets`](#replacemarketplaceintegrationsecrets) | `PUT` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/secrets` | `project` |
| [`revealMarketplaceIntegrationSecrets`](#revealmarketplaceintegrationsecrets) | `POST` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/secrets/reveal` | `project` |
| [`setMarketplaceIntegrationTokenMappings`](#setmarketplaceintegrationtokenmappings) | `PUT` | `/{version}/code/marketplace/integrations/{IntegrationViewId}/token-mappings` | `project` |
Expand Down Expand Up @@ -802,6 +803,27 @@ const result = await norbix.hub.code.startMarketplaceIntegrationSignIn({

[↑ Top](#endpoints)

### signOutMarketplaceIntegration

`POST` `/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out`

**Request DTO**: `CodeMashHub2.SignOutMarketplaceIntegration`
**Response**: `CodeMashHub2.SignOutMarketplaceIntegrationResponse`

```ts
import { Norbix } from '@norbix.ai/ts';

const norbix = new Norbix();

const result = await norbix.hub.code.signOutMarketplaceIntegration({
IntegrationViewId: 'IntegrationViewId-here',
// Other fields: see CodeMash type for the full request shape.
});
// → typed as CodeMashHub2.SignOutMarketplaceIntegrationResponse
```

[↑ Top](#endpoints)

### replaceMarketplaceIntegrationSecrets

`PUT` `/{version}/code/marketplace/integrations/{IntegrationViewId}/secrets`
Expand Down
21 changes: 20 additions & 1 deletion src/hub/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LogsModule } from './logs.js';
* to refresh this file from the DTO definitions.
*
* Group: code
* Endpoints: 43
* Endpoints: 44
*/
export class CodeModule {
constructor(private readonly transport: Transport) {}
Expand Down Expand Up @@ -640,6 +640,25 @@ export class CodeModule {
});
};

/**
* POST /{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out
* Request DTO: SignOutMarketplaceIntegration
*/
signOutMarketplaceIntegration = (
request: Partial<CodeMashHub2.SignOutMarketplaceIntegration> = {} as Partial<CodeMashHub2.SignOutMarketplaceIntegration>,
options: RequestOverrideOptions = {},
): Promise<CodeMashHub2.SignOutMarketplaceIntegrationResponse> => {
return this.transport.send<CodeMashHub2.SignOutMarketplaceIntegrationResponse>({
target: 'hub',
path: '/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out',
method: 'POST',
request,
pathParams: ['IntegrationViewId'],
scope: 'project',
...options,
});
};

/**
* PUT /{version}/code/marketplace/integrations/{IntegrationViewId}/secrets
* Request DTO: ReplaceMarketplaceIntegrationSecretsRequest
Expand Down
4 changes: 4 additions & 0 deletions src/types/hub2.contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,10 @@
"requiresAuth": true,
"returnsBytes": false
},
"SignOutMarketplaceIntegration": {
"requiresAuth": true,
"returnsBytes": false
},
"StartLicenseDomainVerificationRequest": {
"requiresAuth": true,
"returnsBytes": false
Expand Down
106 changes: 105 additions & 1 deletion src/types/hub2.dtos.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/* Options:
Date: 2026-10-13 13:23:35
Date: 2026-10-13 16:21:07
Version: 10.20
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: http://localhost:5001
Expand Down Expand Up @@ -7678,6 +7678,7 @@ export module CodeMashHub2 {
public name: string;
public visibleKey?: string;
public scopes: string[] = [];
public environment?: string;
public createdDate: string;
public expiryDate?: string;
public cancelledDate?: string;
Expand Down Expand Up @@ -9465,6 +9466,9 @@ export module CodeMashHub2 {
// @DataMember
public defaultNotApplied?: string;

// @DataMember
public canChange: boolean;

public constructor(init?: Partial<MarketplaceAccessRoleDto>) {
(Object as any).assign(this, init);
}
Expand Down Expand Up @@ -9500,6 +9504,12 @@ export module CodeMashHub2 {
// @DataMember
public grantable: boolean;

// @DataMember
public curated: boolean;

// @DataMember
public excludedFromFullAccess: boolean;

public constructor(init?: Partial<MarketplaceAccessToolDto>) {
(Object as any).assign(this, init);
}
Expand Down Expand Up @@ -9606,6 +9616,12 @@ export module CodeMashHub2 {
// @DataMember
public notGrantable: IReadOnlyList<string>;

// @DataMember
public readOnlyHintOverridden: IReadOnlyList<string>;

// @DataMember
public excludedFromFullAccess: IReadOnlyList<string>;

public constructor(init?: Partial<MarketplaceAccessChangesDto>) {
(Object as any).assign(this, init);
}
Expand Down Expand Up @@ -9683,6 +9699,12 @@ export module CodeMashHub2 {
// @DataMember
public input?: string;

// @DataMember
public integrationId?: string;

// @DataMember
public toolName?: string;

public constructor(init?: Partial<MarketplaceFunctionRunDto>) {
(Object as any).assign(this, init);
}
Expand Down Expand Up @@ -9855,6 +9877,24 @@ export module CodeMashHub2 {
// @DataMember
public platformApiLevel?: number;

// @DataMember
public platform?: string;

// @DataMember
public appVersion?: string;

// @DataMember
public installationId?: string;

// @DataMember
public locale?: string;

// @DataMember
public timeZone?: string;

// @DataMember
public updatedAtUtc?: string;

public constructor(init?: Partial<PushDeviceListProjection>) {
(Object as any).assign(this, init);
}
Expand Down Expand Up @@ -9945,6 +9985,19 @@ export module CodeMashHub2 {
}
}

// @DataContract
export class NotificationReadMarkDto {
// @DataMember
public userId: string;

// @DataMember
public readAtUtc: string;

public constructor(init?: Partial<NotificationReadMarkDto>) {
(Object as any).assign(this, init);
}
}

// @DataContract
export class PushCampaignBatchNotificationDto extends CampaignBatchNotificationDto {
// @DataMember
Expand All @@ -9956,6 +10009,9 @@ export module CodeMashHub2 {
// @DataMember
public content?: PushMessageContentDto;

// @DataMember
public readBy?: NotificationReadMarkDto[];

public constructor(init?: Partial<PushCampaignBatchNotificationDto>) {
super(init);
(Object as any).assign(this, init);
Expand Down Expand Up @@ -11911,6 +11967,8 @@ export module CodeMashHub2 {
public id: number;
public name: string;
public key: string;
public environment?: string;
public responseStatus?: CodeMashResponseStatus;

public constructor(init?: Partial<IssueServiceUserApiKeyResponse>) {
(Object as any).assign(this, init);
Expand All @@ -11919,6 +11977,7 @@ export module CodeMashHub2 {

export class ListServiceUserApiKeysResponse {
public keys: ServiceUserApiKeyDto[] = [];
public responseStatus?: CodeMashResponseStatus;

public constructor(init?: Partial<ListServiceUserApiKeysResponse>) {
(Object as any).assign(this, init);
Expand Down Expand Up @@ -12898,6 +12957,9 @@ export module CodeMashHub2 {
// @DataMember
public functions: IReadOnlyList<MarketplaceAccessFunctionDto>;

// @DataMember
public canManage: boolean;

public constructor(init?: Partial<GetMarketplaceIntegrationAccessResponse>) {
super(init);
(Object as any).assign(this, init);
Expand Down Expand Up @@ -12962,6 +13024,16 @@ export module CodeMashHub2 {
}
}

export class SignOutMarketplaceIntegrationResponse extends ResponseBase {
public wasSignedIn: boolean;
public revoke?: string;

public constructor(init?: Partial<SignOutMarketplaceIntegrationResponse>) {
super(init);
(Object as any).assign(this, init);
}
}

export class EmptyMarketplaceSecretsResponse extends ResponseBase {
public constructor(init?: Partial<EmptyMarketplaceSecretsResponse>) {
super(init);
Expand Down Expand Up @@ -20137,6 +20209,8 @@ export module CodeMashHub2 {
// @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;

public allLanguages: boolean;

public constructor(init?: Partial<FindRecords>) {
super(init);
(Object as any).assign(this, init);
Expand Down Expand Up @@ -20169,6 +20243,8 @@ export module CodeMashHub2 {
// @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;

public allLanguages: boolean;

public constructor(init?: Partial<FindOneRecord>) {
super(init);
(Object as any).assign(this, init);
Expand Down Expand Up @@ -24028,6 +24104,30 @@ export module CodeMashHub2 {
}
}

// @Route("/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out", "POST")
export class SignOutMarketplaceIntegration
extends CodeMashRequestBase
implements IReturn<SignOutMarketplaceIntegrationResponse>
{
/** @description Integration view id, from get_marketplace_integrations. */
// @ApiMember(Description="Integration view id, from get_marketplace_integrations.", IsRequired=true)
public integrationViewId: string;

public constructor(init?: Partial<SignOutMarketplaceIntegration>) {
super(init);
(Object as any).assign(this, init);
}
public getTypeName() {
return 'SignOutMarketplaceIntegration';
}
public getMethod() {
return 'POST';
}
public createResponse() {
return new SignOutMarketplaceIntegrationResponse();
}
}

// @Route("/{version}/code/marketplace/integrations/{IntegrationViewId}/secrets", "PUT")
// @DataContract
export class ReplaceMarketplaceIntegrationSecretsRequest
Expand Down Expand Up @@ -24153,6 +24253,10 @@ export module CodeMashHub2 {
// @ApiMember(Description="The scheduler task whose marketplace function runs to list (tsk_…). One of functionId / triggerId / taskId.")
public taskId?: string;

/** @description The MCP connection whose tool runs to list — the calls an AI chat made to one of its tools without a saved function (int_…). One of functionId / triggerId / taskId / integrationId. */
// @ApiMember(Description="The MCP connection whose tool runs to list — the calls an AI chat made to one of its tools without a saved function (int_…). One of functionId / triggerId / taskId / integrationId.")
public integrationId?: string;

/** @description How many runs, newest first: 1-50. Default 20. */
// @ApiMember(DataType="integer", Description="How many runs, newest first: 1-50. Default 20.")
public limit?: number;
Expand Down
30 changes: 28 additions & 2 deletions tests/hub/code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.code (43 endpoints).
* Tests for hub.code (44 endpoints).
*
* Each method is asserted against:
* - presence on the module (smoke check)
Expand All @@ -17,7 +17,7 @@ import { createMockFetch, expectedUrl, makeClient, stubRequestForPath } from '..
* - account-scope guard: throws NORBIX_ACCOUNT_SCOPE_REQUIRED without accountId
*/
describe('hub.code', () => {
it('module exposes 43 method(s)', () => {
it('module exposes 44 method(s)', () => {
const mock = createMockFetch();
const mod = new CodeModule({} as never);
void mod; // silence unused — we only need the type
Expand Down Expand Up @@ -62,6 +62,7 @@ describe('hub.code', () => {
expect(typeof ns['saveMarketplaceIntegrationCustomAccess']).toBe('function');
expect(typeof ns['getMarketplaceIntegrationTools']).toBe('function');
expect(typeof ns['startMarketplaceIntegrationSignIn']).toBe('function');
expect(typeof ns['signOutMarketplaceIntegration']).toBe('function');
expect(typeof ns['replaceMarketplaceIntegrationSecrets']).toBe('function');
expect(typeof ns['revealMarketplaceIntegrationSecrets']).toBe('function');
expect(typeof ns['setMarketplaceIntegrationTokenMappings']).toBe('function');
Expand Down Expand Up @@ -867,6 +868,31 @@ describe('hub.code', () => {
expect(mock.lastCall?.headers.get('norbix-project-id')).toBe('test-project');
});

it('signOutMarketplaceIntegration: POST /{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out', async () => {
const stub = stubRequestForPath(
'/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out',
);
const expected = expectedUrl({
baseUrl: 'https://hub.norbix.io',
path: '/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out',
version: 'v2',
stub,
});
const { norbix, mock } = makeClient({});
const fn = (
norbix.hub as unknown as Record<
string,
Record<string, (a?: unknown, o?: unknown) => Promise<unknown>>
>
)['code']!['signOutMarketplaceIntegration']!;
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('replaceMarketplaceIntegrationSecrets: PUT /{version}/code/marketplace/integrations/{IntegrationViewId}/secrets', async () => {
const stub = stubRequestForPath(
'/{version}/code/marketplace/integrations/{IntegrationViewId}/secrets',
Expand Down
Loading
Loading