@mitralab.io/sdk-core 0.2.0-beta.0 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +44 -5
- package/contracts/README.md +20 -4
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.0-beta.1/sdk-parity.json +2902 -0
- package/dist/index.cjs +116 -14
- package/dist/index.d.cts +91 -7
- package/dist/index.d.ts +91 -7
- package/dist/index.js +109 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,9 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
API_KEY_EXCHANGE_PATH: () => API_KEY_EXCHANGE_PATH,
|
|
23
24
|
AgentTaskTurnError: () => AgentTaskTurnError,
|
|
24
25
|
SdkCoreConfigurationError: () => SdkCoreConfigurationError,
|
|
25
26
|
SdkCoreResponseError: () => SdkCoreResponseError,
|
|
27
|
+
appAccessTokenPath: () => appAccessTokenPath,
|
|
26
28
|
createAgentConnectionsModule: () => createAgentConnectionsModule,
|
|
27
29
|
createAgentCredentialsModule: () => createAgentCredentialsModule,
|
|
28
30
|
createAgentTaskSessionManager: () => createAgentTaskSessionManager,
|
|
@@ -58,7 +60,12 @@ __export(index_exports, {
|
|
|
58
60
|
expectObjectArray: () => expectObjectArray,
|
|
59
61
|
expectPage: () => expectPage,
|
|
60
62
|
expectStringArray: () => expectStringArray,
|
|
63
|
+
isWorkspaceSession: () => isWorkspaceSession,
|
|
64
|
+
readTokenAppId: () => readTokenAppId,
|
|
65
|
+
readTokenExpiry: () => readTokenExpiry,
|
|
66
|
+
resolveApiKeyToken: () => resolveApiKeyToken,
|
|
61
67
|
toAgentTimelineItem: () => toAgentTimelineItem,
|
|
68
|
+
tokenAuthorizesApp: () => tokenAuthorizesApp,
|
|
62
69
|
withAgentTaskSessions: () => withAgentTaskSessions
|
|
63
70
|
});
|
|
64
71
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -848,24 +855,25 @@ function expectIntegrationTemplate(value, context, errors = defaultSdkCoreErrorF
|
|
|
848
855
|
expectIntegrationLoginConfig(template.loginConfig, `${context} loginConfig`, errors);
|
|
849
856
|
}
|
|
850
857
|
expectIntegrationRequestConfig(template.requestConfig, `${context} requestConfig`, errors);
|
|
851
|
-
|
|
852
|
-
(field, position) => {
|
|
853
|
-
const fieldContext = `${context} field ${position}`;
|
|
854
|
-
if (typeof field.key !== "string") invalidField(fieldContext, "key", errors);
|
|
855
|
-
if (typeof field.label !== "string") invalidField(fieldContext, "label", errors);
|
|
856
|
-
if (!isOneOf(field.type, ["url", "text", "secret"])) {
|
|
857
|
-
invalidField(fieldContext, "type", errors);
|
|
858
|
-
}
|
|
859
|
-
if (typeof field.required !== "boolean") invalidField(fieldContext, "required", errors);
|
|
860
|
-
if (!isNullableString(field.placeholder)) invalidField(fieldContext, "placeholder", errors);
|
|
861
|
-
if (!isNullableString(field.default)) invalidField(fieldContext, "default", errors);
|
|
862
|
-
}
|
|
863
|
-
);
|
|
858
|
+
expectIntegrationFieldsSchema(template.fieldsSchema, `${context} fieldsSchema`, errors);
|
|
864
859
|
if (!isNullableString(template.documentationUrl)) {
|
|
865
860
|
invalidField(context, "documentationUrl", errors);
|
|
866
861
|
}
|
|
867
862
|
return template;
|
|
868
863
|
}
|
|
864
|
+
function expectIntegrationFieldsSchema(value, context, errors) {
|
|
865
|
+
expectObjectArray(value, context, errors).forEach((field, position) => {
|
|
866
|
+
const fieldContext = `${context} field ${position}`;
|
|
867
|
+
if (typeof field.key !== "string") invalidField(fieldContext, "key", errors);
|
|
868
|
+
if (typeof field.label !== "string") invalidField(fieldContext, "label", errors);
|
|
869
|
+
if (!isOneOf(field.type, ["url", "text", "secret"])) {
|
|
870
|
+
invalidField(fieldContext, "type", errors);
|
|
871
|
+
}
|
|
872
|
+
if (typeof field.required !== "boolean") invalidField(fieldContext, "required", errors);
|
|
873
|
+
if (!isNullableString(field.placeholder)) invalidField(fieldContext, "placeholder", errors);
|
|
874
|
+
if (!isNullableString(field.default)) invalidField(fieldContext, "default", errors);
|
|
875
|
+
});
|
|
876
|
+
}
|
|
869
877
|
function expectIntegrationLoginConfig(value, context, errors) {
|
|
870
878
|
const config = expectObject(value, context, errors);
|
|
871
879
|
if (!isNullableString(config.url)) invalidField(context, "url", errors);
|
|
@@ -912,13 +920,33 @@ function expectIntegrationRequestConfig(value, context, errors) {
|
|
|
912
920
|
});
|
|
913
921
|
}
|
|
914
922
|
}
|
|
923
|
+
function expectInlineDefinition(config, context, errors) {
|
|
924
|
+
if (hasOwn(config, "fieldsSchemaInline") && config.fieldsSchemaInline !== null) {
|
|
925
|
+
expectIntegrationFieldsSchema(
|
|
926
|
+
config.fieldsSchemaInline,
|
|
927
|
+
`${context} fieldsSchemaInline`,
|
|
928
|
+
errors
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
if (hasOwn(config, "requestConfigInline") && config.requestConfigInline !== null) {
|
|
932
|
+
expectIntegrationRequestConfig(
|
|
933
|
+
config.requestConfigInline,
|
|
934
|
+
`${context} requestConfigInline`,
|
|
935
|
+
errors
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
if (hasOwn(config, "loginConfigInline") && config.loginConfigInline !== null) {
|
|
939
|
+
expectIntegrationLoginConfig(config.loginConfigInline, `${context} loginConfigInline`, errors);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
915
942
|
function expectTemplateConfigSummary(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
916
943
|
const config = expectObject(value, context, errors);
|
|
917
944
|
if (typeof config.id !== "string") invalidField(context, "id", errors);
|
|
918
945
|
if (!isNullableString(config.appId)) invalidField(context, "appId", errors);
|
|
919
946
|
if (!isNullableInteger(config.legacyId)) invalidField(context, "legacyId", errors);
|
|
920
|
-
if (
|
|
947
|
+
if (!isNullableString(config.templateId)) invalidField(context, "templateId", errors);
|
|
921
948
|
if (typeof config.alias !== "string") invalidField(context, "alias", errors);
|
|
949
|
+
expectInlineDefinition(config, context, errors);
|
|
922
950
|
if (config.status !== null && !isOneOf(config.status, ["unchecked", "connected", "error"])) {
|
|
923
951
|
invalidField(context, "status", errors);
|
|
924
952
|
}
|
|
@@ -3673,11 +3701,80 @@ var CoreAgentTaskSession = class {
|
|
|
3673
3701
|
}
|
|
3674
3702
|
}
|
|
3675
3703
|
};
|
|
3704
|
+
|
|
3705
|
+
// src/apiKeySession.ts
|
|
3706
|
+
var API_KEY_EXCHANGE_PATH = "/api/v1/auth/exchange";
|
|
3707
|
+
function appAccessTokenPath(appId) {
|
|
3708
|
+
return `/api/v1/auth/apps/${encodeURIComponent(appId)}/access-token`;
|
|
3709
|
+
}
|
|
3710
|
+
function decodeTokenPayload(token) {
|
|
3711
|
+
const segment = token.split(".")[1];
|
|
3712
|
+
if (!segment || typeof globalThis.atob !== "function") return null;
|
|
3713
|
+
try {
|
|
3714
|
+
const base64 = segment.replaceAll("-", "+").replaceAll("_", "/");
|
|
3715
|
+
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
3716
|
+
const decoded = JSON.parse(globalThis.atob(padded));
|
|
3717
|
+
if (!decoded || typeof decoded !== "object" || Array.isArray(decoded)) return null;
|
|
3718
|
+
return decoded;
|
|
3719
|
+
} catch {
|
|
3720
|
+
return null;
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
function readTokenAppId(token) {
|
|
3724
|
+
const appId = decodeTokenPayload(token)?.app_id;
|
|
3725
|
+
return typeof appId === "string" && appId ? appId : null;
|
|
3726
|
+
}
|
|
3727
|
+
function readTokenExpiry(token) {
|
|
3728
|
+
const exp = decodeTokenPayload(token)?.exp;
|
|
3729
|
+
return typeof exp === "number" && Number.isFinite(exp) ? exp * 1e3 : null;
|
|
3730
|
+
}
|
|
3731
|
+
function tokenAuthorizesApp(token, appId) {
|
|
3732
|
+
const payload = decodeTokenPayload(token);
|
|
3733
|
+
if (!payload) return true;
|
|
3734
|
+
return payload.app_id === appId;
|
|
3735
|
+
}
|
|
3736
|
+
function isWorkspaceSession(token) {
|
|
3737
|
+
const payload = decodeTokenPayload(token);
|
|
3738
|
+
return payload !== null && payload.app_id === void 0;
|
|
3739
|
+
}
|
|
3740
|
+
function readAccessToken(payload, operation, errors) {
|
|
3741
|
+
const token = payload && typeof payload === "object" ? payload.accessToken : void 0;
|
|
3742
|
+
if (typeof token !== "string" || !token.trim()) {
|
|
3743
|
+
throw errors.invalidResponse(`The ${operation} response did not include an access token`);
|
|
3744
|
+
}
|
|
3745
|
+
return token;
|
|
3746
|
+
}
|
|
3747
|
+
async function resolveApiKeyToken(call, appId, apiKey, errors = defaultSdkCoreErrorFactory) {
|
|
3748
|
+
if (!apiKey.trim()) {
|
|
3749
|
+
throw errors.configuration("An api key is required to authenticate with an api key");
|
|
3750
|
+
}
|
|
3751
|
+
if (!appId.trim()) {
|
|
3752
|
+
throw errors.configuration("An app id is required to authenticate with an api key");
|
|
3753
|
+
}
|
|
3754
|
+
const exchanged = readAccessToken(
|
|
3755
|
+
await call(API_KEY_EXCHANGE_PATH, { body: { apiKey } }),
|
|
3756
|
+
"api key exchange",
|
|
3757
|
+
errors
|
|
3758
|
+
);
|
|
3759
|
+
if (tokenAuthorizesApp(exchanged, appId)) return exchanged;
|
|
3760
|
+
if (!isWorkspaceSession(exchanged)) {
|
|
3761
|
+
throw errors.configuration(
|
|
3762
|
+
`This api key belongs to app ${readTokenAppId(exchanged) ?? "unknown"}, not to ${appId}. Create the key for this app, or use a workspace key.`
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
return readAccessToken(
|
|
3766
|
+
await call(appAccessTokenPath(appId), { bearer: exchanged }),
|
|
3767
|
+
"app token",
|
|
3768
|
+
errors
|
|
3769
|
+
);
|
|
3770
|
+
}
|
|
3676
3771
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3677
3772
|
0 && (module.exports = {
|
|
3773
|
+
API_KEY_EXCHANGE_PATH,
|
|
3678
3774
|
AgentTaskTurnError,
|
|
3679
3775
|
SdkCoreConfigurationError,
|
|
3680
3776
|
SdkCoreResponseError,
|
|
3777
|
+
appAccessTokenPath,
|
|
3681
3778
|
createAgentConnectionsModule,
|
|
3682
3779
|
createAgentCredentialsModule,
|
|
3683
3780
|
createAgentTaskSessionManager,
|
|
@@ -3713,6 +3810,11 @@ var CoreAgentTaskSession = class {
|
|
|
3713
3810
|
expectObjectArray,
|
|
3714
3811
|
expectPage,
|
|
3715
3812
|
expectStringArray,
|
|
3813
|
+
isWorkspaceSession,
|
|
3814
|
+
readTokenAppId,
|
|
3815
|
+
readTokenExpiry,
|
|
3816
|
+
resolveApiKeyToken,
|
|
3716
3817
|
toAgentTimelineItem,
|
|
3818
|
+
tokenAuthorizesApp,
|
|
3717
3819
|
withAgentTaskSessions
|
|
3718
3820
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -390,12 +390,26 @@ interface FunctionDefinition {
|
|
|
390
390
|
createdAt: string | null;
|
|
391
391
|
updatedAt: string;
|
|
392
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Creates an integration config from a catalog template or from an inline definition.
|
|
395
|
+
*
|
|
396
|
+
* Send exactly one of the two: either `templateId`, or the inline definition carried by
|
|
397
|
+
* `fieldsSchemaInline` and `requestConfigInline` with the optional `loginConfigInline`. Sending
|
|
398
|
+
* both or neither is rejected by the producer; Core does not check it locally. An inline
|
|
399
|
+
* definition connects a provider that has no template in the catalog.
|
|
400
|
+
*/
|
|
393
401
|
interface TemplateConfigCreateInput {
|
|
394
|
-
/** Integration template UUID. */
|
|
395
|
-
templateId
|
|
402
|
+
/** Integration template UUID. Omitted when the inline definition is sent. */
|
|
403
|
+
templateId?: string | null;
|
|
396
404
|
/** App-unique alias used by proxy execution. */
|
|
397
405
|
alias: string;
|
|
398
406
|
legacyId?: number;
|
|
407
|
+
/** Inline field definitions, in the same shape as a template `fieldsSchema`. */
|
|
408
|
+
fieldsSchemaInline?: IntegrationFieldSchemaInput[];
|
|
409
|
+
/** Inline header and credential placement rules, in the same shape as a template. */
|
|
410
|
+
requestConfigInline?: IntegrationRequestConfig;
|
|
411
|
+
/** Inline login handshake. Null when the provider authenticates on the request itself. */
|
|
412
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
399
413
|
/** Complete credential and configuration map. Values are write-only. */
|
|
400
414
|
values: Record<string, JsonValue>;
|
|
401
415
|
}
|
|
@@ -422,8 +436,13 @@ interface TemplateConfigSummary {
|
|
|
422
436
|
id: string;
|
|
423
437
|
appId: string | null;
|
|
424
438
|
legacyId: number | null;
|
|
425
|
-
|
|
439
|
+
/** Null on a config created from an inline definition. */
|
|
440
|
+
templateId: string | null;
|
|
426
441
|
alias: string;
|
|
442
|
+
/** Inline definition echoed back. Absent or null on a template-backed config. */
|
|
443
|
+
fieldsSchemaInline?: IntegrationFieldSchema[] | null;
|
|
444
|
+
requestConfigInline?: IntegrationRequestConfig | null;
|
|
445
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
427
446
|
status: IntegrationConnectionStatus | null;
|
|
428
447
|
lastCheckedAt: string | null;
|
|
429
448
|
}
|
|
@@ -440,8 +459,21 @@ interface ListTemplateConfigsOptions {
|
|
|
440
459
|
size?: number;
|
|
441
460
|
sort?: string;
|
|
442
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* Tests credentials against a catalog template or against an inline definition.
|
|
464
|
+
*
|
|
465
|
+
* Follows the same exclusivity as `TemplateConfigCreateInput`: exactly one of `templateId` or the
|
|
466
|
+
* inline definition, checked by the producer and not by Core. Nothing is stored either way.
|
|
467
|
+
*/
|
|
443
468
|
interface TestCredentialsInput {
|
|
444
|
-
|
|
469
|
+
/** Integration template UUID. Omitted when the inline definition is sent. */
|
|
470
|
+
templateId?: string | null;
|
|
471
|
+
/** Inline field definitions, in the same shape as a template `fieldsSchema`. */
|
|
472
|
+
fieldsSchemaInline?: IntegrationFieldSchemaInput[];
|
|
473
|
+
/** Inline header and credential placement rules, in the same shape as a template. */
|
|
474
|
+
requestConfigInline?: IntegrationRequestConfig;
|
|
475
|
+
/** Inline login handshake. Null when the provider authenticates on the request itself. */
|
|
476
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
445
477
|
values: Record<string, JsonValue>;
|
|
446
478
|
}
|
|
447
479
|
interface ConnectionTestResult {
|
|
@@ -964,6 +996,8 @@ interface IntegrationFieldSchema {
|
|
|
964
996
|
placeholder: string | null;
|
|
965
997
|
default: string | null;
|
|
966
998
|
}
|
|
999
|
+
/** Inline field authoring shape. The producer stores an omitted `placeholder` or `default` as null. */
|
|
1000
|
+
type IntegrationFieldSchemaInput = Omit<IntegrationFieldSchema, "placeholder" | "default"> & Partial<Pick<IntegrationFieldSchema, "placeholder" | "default">>;
|
|
967
1001
|
interface IntegrationTemplate extends IntegrationTemplateSummary {
|
|
968
1002
|
loginConfig: IntegrationLoginConfig | null;
|
|
969
1003
|
requestConfig: IntegrationRequestConfig;
|
|
@@ -1340,7 +1374,12 @@ interface FunctionsAdminModule {
|
|
|
1340
1374
|
declare function createFunctionsAdminModule(transport: Transport, errors?: SdkCoreErrorFactory): FunctionsAdminModule;
|
|
1341
1375
|
|
|
1342
1376
|
interface IntegrationAdminModule {
|
|
1343
|
-
/**
|
|
1377
|
+
/**
|
|
1378
|
+
* Creates one integration config from a catalog template or from an inline definition.
|
|
1379
|
+
*
|
|
1380
|
+
* Secret values are write-only. Send `templateId` or the inline definition, never both: the
|
|
1381
|
+
* exclusivity is the producer's, so Core forwards whatever the caller sends.
|
|
1382
|
+
*/
|
|
1344
1383
|
create(input: TemplateConfigCreateInput): Promise<TemplateConfig>;
|
|
1345
1384
|
/** Updates one config. Omitting `values` preserves stored credentials. */
|
|
1346
1385
|
update(id: string, input: Omit<TemplateConfigUpdateInput, "configId">): Promise<TemplateConfig>;
|
|
@@ -1351,6 +1390,7 @@ interface IntegrationAdminModule {
|
|
|
1351
1390
|
*
|
|
1352
1391
|
* The whole batch is validated first, then items run in order, NOT atomically: read `results`
|
|
1353
1392
|
* for the outcome of each one. `values` hold credentials and never come back in any response.
|
|
1393
|
+
* Each item independently chooses a catalog template or an inline definition.
|
|
1354
1394
|
*/
|
|
1355
1395
|
bulkCreate(configs: TemplateConfigCreateInput[]): Promise<TemplateConfigBulkResult>;
|
|
1356
1396
|
/**
|
|
@@ -1363,7 +1403,7 @@ interface IntegrationAdminModule {
|
|
|
1363
1403
|
bulkUpdate(configs: TemplateConfigUpdateInput[]): Promise<TemplateConfigBulkResult>;
|
|
1364
1404
|
/** Deletes 1 to 100 template configs by id, in order and NOT atomically. */
|
|
1365
1405
|
bulkDelete(configIds: string[]): Promise<TemplateConfigBulkResult>;
|
|
1366
|
-
/** Tests provisional credentials against a template
|
|
1406
|
+
/** Tests provisional credentials against a template or inline definition, storing nothing. */
|
|
1367
1407
|
testCredentials(request: TestCredentialsInput): Promise<ConnectionTestResult>;
|
|
1368
1408
|
/** Tests a stored template config using the credentials it already holds. */
|
|
1369
1409
|
testConfig(configId: string): Promise<ConnectionTestResult>;
|
|
@@ -1806,6 +1846,50 @@ declare function toAgentTimelineItem(message: AgentMessage): AgentTimelineItem;
|
|
|
1806
1846
|
declare function createAgentTaskSessionManager(options: AgentTaskSessionManagerOptions): AgentTaskSessionManager;
|
|
1807
1847
|
declare function withAgentTaskSessions(tasks: AgentTasksModule, manager: AgentTaskSessionManager): AgentTasksWithSessions;
|
|
1808
1848
|
|
|
1849
|
+
/**
|
|
1850
|
+
* What the SDKs have to know about trading an api key for a token.
|
|
1851
|
+
*
|
|
1852
|
+
* The knowledge lives here rather than in each SDK because it is a contract with IAM, not a
|
|
1853
|
+
* utility: which claim names the app, what the exchange answers, and when a token still needs
|
|
1854
|
+
* a second call before it authorizes anything. When IAM changes any of that, it changes once.
|
|
1855
|
+
*
|
|
1856
|
+
* This module makes no HTTP call of its own — this package defines `Transport`, it does not
|
|
1857
|
+
* implement one. The caller performs the request and keeps whatever belongs to it: caching,
|
|
1858
|
+
* renewal, its own error type, its own runtime guards.
|
|
1859
|
+
*/
|
|
1860
|
+
/** IAM path, relative to the service root, that trades an api key for a token. */
|
|
1861
|
+
declare const API_KEY_EXCHANGE_PATH = "/api/v1/auth/exchange";
|
|
1862
|
+
/** IAM path, relative to the service root, that issues an app token from a workspace session. */
|
|
1863
|
+
declare function appAccessTokenPath(appId: string): string;
|
|
1864
|
+
/** Performs one POST against IAM and returns the parsed body. */
|
|
1865
|
+
type ApiKeyExchangeCaller = (path: string, init: {
|
|
1866
|
+
body?: unknown;
|
|
1867
|
+
bearer?: string;
|
|
1868
|
+
}) => Promise<unknown>;
|
|
1869
|
+
/** The app a token authorizes, or `null` for a workspace session and for anything unreadable. */
|
|
1870
|
+
declare function readTokenAppId(token: string): string | null;
|
|
1871
|
+
/** When a token stops being accepted, in milliseconds, or `null` when it cannot be read. */
|
|
1872
|
+
declare function readTokenExpiry(token: string): number | null;
|
|
1873
|
+
/**
|
|
1874
|
+
* Whether a token already authorizes `appId`.
|
|
1875
|
+
*
|
|
1876
|
+
* An unreadable token counts as authorized: the platform is the authority on a token it
|
|
1877
|
+
* issued, and refusing one the SDK merely failed to parse would break a caller for no reason.
|
|
1878
|
+
*/
|
|
1879
|
+
declare function tokenAuthorizesApp(token: string, appId: string): boolean;
|
|
1880
|
+
/** Whether a token is a workspace session, the only kind an app token can be issued from. */
|
|
1881
|
+
declare function isWorkspaceSession(token: string): boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Trades an api key for a token that authorizes `appId`.
|
|
1884
|
+
*
|
|
1885
|
+
* A Developer or Business key belongs to a product, so the exchange already answers with that
|
|
1886
|
+
* product's token. An Administrator key belongs to a workspace: the exchange answers with a
|
|
1887
|
+
* workspace session, and the app token is issued from it. That second call is where the
|
|
1888
|
+
* platform decides what the key's owner actually reaches in this product, which is why a
|
|
1889
|
+
* workspace key never turns into blanket access.
|
|
1890
|
+
*/
|
|
1891
|
+
declare function resolveApiKeyToken(call: ApiKeyExchangeCaller, appId: string, apiKey: string, errors?: SdkCoreErrorFactory): Promise<string>;
|
|
1892
|
+
|
|
1809
1893
|
declare function encodePathSegment(value: string | number, name: string, errors?: SdkCoreErrorFactory): string;
|
|
1810
1894
|
|
|
1811
1895
|
declare function expectObject<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory): T;
|
|
@@ -1816,4 +1900,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1816
1900
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1817
1901
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1818
1902
|
|
|
1819
|
-
export { type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, toAgentTimelineItem, withAgentTaskSessions };
|
|
1903
|
+
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|
package/dist/index.d.ts
CHANGED
|
@@ -390,12 +390,26 @@ interface FunctionDefinition {
|
|
|
390
390
|
createdAt: string | null;
|
|
391
391
|
updatedAt: string;
|
|
392
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Creates an integration config from a catalog template or from an inline definition.
|
|
395
|
+
*
|
|
396
|
+
* Send exactly one of the two: either `templateId`, or the inline definition carried by
|
|
397
|
+
* `fieldsSchemaInline` and `requestConfigInline` with the optional `loginConfigInline`. Sending
|
|
398
|
+
* both or neither is rejected by the producer; Core does not check it locally. An inline
|
|
399
|
+
* definition connects a provider that has no template in the catalog.
|
|
400
|
+
*/
|
|
393
401
|
interface TemplateConfigCreateInput {
|
|
394
|
-
/** Integration template UUID. */
|
|
395
|
-
templateId
|
|
402
|
+
/** Integration template UUID. Omitted when the inline definition is sent. */
|
|
403
|
+
templateId?: string | null;
|
|
396
404
|
/** App-unique alias used by proxy execution. */
|
|
397
405
|
alias: string;
|
|
398
406
|
legacyId?: number;
|
|
407
|
+
/** Inline field definitions, in the same shape as a template `fieldsSchema`. */
|
|
408
|
+
fieldsSchemaInline?: IntegrationFieldSchemaInput[];
|
|
409
|
+
/** Inline header and credential placement rules, in the same shape as a template. */
|
|
410
|
+
requestConfigInline?: IntegrationRequestConfig;
|
|
411
|
+
/** Inline login handshake. Null when the provider authenticates on the request itself. */
|
|
412
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
399
413
|
/** Complete credential and configuration map. Values are write-only. */
|
|
400
414
|
values: Record<string, JsonValue>;
|
|
401
415
|
}
|
|
@@ -422,8 +436,13 @@ interface TemplateConfigSummary {
|
|
|
422
436
|
id: string;
|
|
423
437
|
appId: string | null;
|
|
424
438
|
legacyId: number | null;
|
|
425
|
-
|
|
439
|
+
/** Null on a config created from an inline definition. */
|
|
440
|
+
templateId: string | null;
|
|
426
441
|
alias: string;
|
|
442
|
+
/** Inline definition echoed back. Absent or null on a template-backed config. */
|
|
443
|
+
fieldsSchemaInline?: IntegrationFieldSchema[] | null;
|
|
444
|
+
requestConfigInline?: IntegrationRequestConfig | null;
|
|
445
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
427
446
|
status: IntegrationConnectionStatus | null;
|
|
428
447
|
lastCheckedAt: string | null;
|
|
429
448
|
}
|
|
@@ -440,8 +459,21 @@ interface ListTemplateConfigsOptions {
|
|
|
440
459
|
size?: number;
|
|
441
460
|
sort?: string;
|
|
442
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* Tests credentials against a catalog template or against an inline definition.
|
|
464
|
+
*
|
|
465
|
+
* Follows the same exclusivity as `TemplateConfigCreateInput`: exactly one of `templateId` or the
|
|
466
|
+
* inline definition, checked by the producer and not by Core. Nothing is stored either way.
|
|
467
|
+
*/
|
|
443
468
|
interface TestCredentialsInput {
|
|
444
|
-
|
|
469
|
+
/** Integration template UUID. Omitted when the inline definition is sent. */
|
|
470
|
+
templateId?: string | null;
|
|
471
|
+
/** Inline field definitions, in the same shape as a template `fieldsSchema`. */
|
|
472
|
+
fieldsSchemaInline?: IntegrationFieldSchemaInput[];
|
|
473
|
+
/** Inline header and credential placement rules, in the same shape as a template. */
|
|
474
|
+
requestConfigInline?: IntegrationRequestConfig;
|
|
475
|
+
/** Inline login handshake. Null when the provider authenticates on the request itself. */
|
|
476
|
+
loginConfigInline?: IntegrationLoginConfig | null;
|
|
445
477
|
values: Record<string, JsonValue>;
|
|
446
478
|
}
|
|
447
479
|
interface ConnectionTestResult {
|
|
@@ -964,6 +996,8 @@ interface IntegrationFieldSchema {
|
|
|
964
996
|
placeholder: string | null;
|
|
965
997
|
default: string | null;
|
|
966
998
|
}
|
|
999
|
+
/** Inline field authoring shape. The producer stores an omitted `placeholder` or `default` as null. */
|
|
1000
|
+
type IntegrationFieldSchemaInput = Omit<IntegrationFieldSchema, "placeholder" | "default"> & Partial<Pick<IntegrationFieldSchema, "placeholder" | "default">>;
|
|
967
1001
|
interface IntegrationTemplate extends IntegrationTemplateSummary {
|
|
968
1002
|
loginConfig: IntegrationLoginConfig | null;
|
|
969
1003
|
requestConfig: IntegrationRequestConfig;
|
|
@@ -1340,7 +1374,12 @@ interface FunctionsAdminModule {
|
|
|
1340
1374
|
declare function createFunctionsAdminModule(transport: Transport, errors?: SdkCoreErrorFactory): FunctionsAdminModule;
|
|
1341
1375
|
|
|
1342
1376
|
interface IntegrationAdminModule {
|
|
1343
|
-
/**
|
|
1377
|
+
/**
|
|
1378
|
+
* Creates one integration config from a catalog template or from an inline definition.
|
|
1379
|
+
*
|
|
1380
|
+
* Secret values are write-only. Send `templateId` or the inline definition, never both: the
|
|
1381
|
+
* exclusivity is the producer's, so Core forwards whatever the caller sends.
|
|
1382
|
+
*/
|
|
1344
1383
|
create(input: TemplateConfigCreateInput): Promise<TemplateConfig>;
|
|
1345
1384
|
/** Updates one config. Omitting `values` preserves stored credentials. */
|
|
1346
1385
|
update(id: string, input: Omit<TemplateConfigUpdateInput, "configId">): Promise<TemplateConfig>;
|
|
@@ -1351,6 +1390,7 @@ interface IntegrationAdminModule {
|
|
|
1351
1390
|
*
|
|
1352
1391
|
* The whole batch is validated first, then items run in order, NOT atomically: read `results`
|
|
1353
1392
|
* for the outcome of each one. `values` hold credentials and never come back in any response.
|
|
1393
|
+
* Each item independently chooses a catalog template or an inline definition.
|
|
1354
1394
|
*/
|
|
1355
1395
|
bulkCreate(configs: TemplateConfigCreateInput[]): Promise<TemplateConfigBulkResult>;
|
|
1356
1396
|
/**
|
|
@@ -1363,7 +1403,7 @@ interface IntegrationAdminModule {
|
|
|
1363
1403
|
bulkUpdate(configs: TemplateConfigUpdateInput[]): Promise<TemplateConfigBulkResult>;
|
|
1364
1404
|
/** Deletes 1 to 100 template configs by id, in order and NOT atomically. */
|
|
1365
1405
|
bulkDelete(configIds: string[]): Promise<TemplateConfigBulkResult>;
|
|
1366
|
-
/** Tests provisional credentials against a template
|
|
1406
|
+
/** Tests provisional credentials against a template or inline definition, storing nothing. */
|
|
1367
1407
|
testCredentials(request: TestCredentialsInput): Promise<ConnectionTestResult>;
|
|
1368
1408
|
/** Tests a stored template config using the credentials it already holds. */
|
|
1369
1409
|
testConfig(configId: string): Promise<ConnectionTestResult>;
|
|
@@ -1806,6 +1846,50 @@ declare function toAgentTimelineItem(message: AgentMessage): AgentTimelineItem;
|
|
|
1806
1846
|
declare function createAgentTaskSessionManager(options: AgentTaskSessionManagerOptions): AgentTaskSessionManager;
|
|
1807
1847
|
declare function withAgentTaskSessions(tasks: AgentTasksModule, manager: AgentTaskSessionManager): AgentTasksWithSessions;
|
|
1808
1848
|
|
|
1849
|
+
/**
|
|
1850
|
+
* What the SDKs have to know about trading an api key for a token.
|
|
1851
|
+
*
|
|
1852
|
+
* The knowledge lives here rather than in each SDK because it is a contract with IAM, not a
|
|
1853
|
+
* utility: which claim names the app, what the exchange answers, and when a token still needs
|
|
1854
|
+
* a second call before it authorizes anything. When IAM changes any of that, it changes once.
|
|
1855
|
+
*
|
|
1856
|
+
* This module makes no HTTP call of its own — this package defines `Transport`, it does not
|
|
1857
|
+
* implement one. The caller performs the request and keeps whatever belongs to it: caching,
|
|
1858
|
+
* renewal, its own error type, its own runtime guards.
|
|
1859
|
+
*/
|
|
1860
|
+
/** IAM path, relative to the service root, that trades an api key for a token. */
|
|
1861
|
+
declare const API_KEY_EXCHANGE_PATH = "/api/v1/auth/exchange";
|
|
1862
|
+
/** IAM path, relative to the service root, that issues an app token from a workspace session. */
|
|
1863
|
+
declare function appAccessTokenPath(appId: string): string;
|
|
1864
|
+
/** Performs one POST against IAM and returns the parsed body. */
|
|
1865
|
+
type ApiKeyExchangeCaller = (path: string, init: {
|
|
1866
|
+
body?: unknown;
|
|
1867
|
+
bearer?: string;
|
|
1868
|
+
}) => Promise<unknown>;
|
|
1869
|
+
/** The app a token authorizes, or `null` for a workspace session and for anything unreadable. */
|
|
1870
|
+
declare function readTokenAppId(token: string): string | null;
|
|
1871
|
+
/** When a token stops being accepted, in milliseconds, or `null` when it cannot be read. */
|
|
1872
|
+
declare function readTokenExpiry(token: string): number | null;
|
|
1873
|
+
/**
|
|
1874
|
+
* Whether a token already authorizes `appId`.
|
|
1875
|
+
*
|
|
1876
|
+
* An unreadable token counts as authorized: the platform is the authority on a token it
|
|
1877
|
+
* issued, and refusing one the SDK merely failed to parse would break a caller for no reason.
|
|
1878
|
+
*/
|
|
1879
|
+
declare function tokenAuthorizesApp(token: string, appId: string): boolean;
|
|
1880
|
+
/** Whether a token is a workspace session, the only kind an app token can be issued from. */
|
|
1881
|
+
declare function isWorkspaceSession(token: string): boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Trades an api key for a token that authorizes `appId`.
|
|
1884
|
+
*
|
|
1885
|
+
* A Developer or Business key belongs to a product, so the exchange already answers with that
|
|
1886
|
+
* product's token. An Administrator key belongs to a workspace: the exchange answers with a
|
|
1887
|
+
* workspace session, and the app token is issued from it. That second call is where the
|
|
1888
|
+
* platform decides what the key's owner actually reaches in this product, which is why a
|
|
1889
|
+
* workspace key never turns into blanket access.
|
|
1890
|
+
*/
|
|
1891
|
+
declare function resolveApiKeyToken(call: ApiKeyExchangeCaller, appId: string, apiKey: string, errors?: SdkCoreErrorFactory): Promise<string>;
|
|
1892
|
+
|
|
1809
1893
|
declare function encodePathSegment(value: string | number, name: string, errors?: SdkCoreErrorFactory): string;
|
|
1810
1894
|
|
|
1811
1895
|
declare function expectObject<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory): T;
|
|
@@ -1816,4 +1900,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1816
1900
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1817
1901
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1818
1902
|
|
|
1819
|
-
export { type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, toAgentTimelineItem, withAgentTaskSessions };
|
|
1903
|
+
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|