polytomic 25.9.12 → 25.9.13
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/BaseClient.js +2 -2
- package/Client.d.ts +0 -3
- package/Client.js +38 -43
- package/api/resources/bulkSync/client/Client.d.ts +42 -18
- package/api/resources/bulkSync/client/Client.js +54 -22
- package/api/resources/bulkSync/client/requests/BulkSyncGetDestinationRequest.d.ts +10 -0
- package/api/resources/bulkSync/client/requests/index.d.ts +1 -0
- package/api/resources/bulkSync/resources/executions/client/Client.d.ts +17 -10
- package/api/resources/bulkSync/resources/executions/client/Client.js +17 -10
- package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +1 -1
- package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +8 -0
- package/api/resources/bulkSync/resources/schedules/client/Client.js +8 -0
- package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +2 -0
- package/api/resources/connections/client/Client.d.ts +8 -7
- package/api/resources/connections/client/Client.js +8 -7
- package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +4 -1
- package/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +5 -1
- package/api/resources/connections/resources/proxy/client/Client.d.ts +13 -2
- package/api/resources/connections/resources/proxy/client/Client.js +13 -2
- package/api/resources/events/client/Client.d.ts +10 -7
- package/api/resources/events/client/Client.js +10 -7
- package/api/resources/harbors/client/Client.d.ts +73 -1290
- package/api/resources/harbors/client/Client.js +108 -3353
- package/api/resources/harbors/client/requests/index.d.ts +0 -29
- package/api/resources/harbors/resources/actionConfiguration/client/Client.d.ts +267 -0
- package/api/resources/harbors/resources/actionConfiguration/client/Client.js +686 -0
- package/api/resources/harbors/{client/requests/HarborsListActionConfigurationSchemasRequest.d.ts → resources/actionConfiguration/client/requests/ActionConfigurationListSchemasRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsRemoveActionConfigurationRequest.d.ts → resources/actionConfiguration/client/requests/ActionConfigurationRemoveRequest.d.ts} +1 -1
- package/api/resources/harbors/{client → resources/actionConfiguration/client}/requests/SetHarborActionConfigurationRequest.d.ts +1 -1
- package/api/resources/harbors/resources/actionConfiguration/client/requests/index.d.ts +3 -0
- package/api/resources/harbors/resources/actionConfiguration/exports.d.ts +2 -0
- package/api/resources/harbors/resources/actionConfiguration/exports.js +21 -0
- package/api/resources/harbors/resources/actionConfiguration/index.d.ts +1 -0
- package/api/resources/harbors/resources/actionConfiguration/index.js +17 -0
- package/api/resources/harbors/resources/actions/client/Client.d.ts +4 -0
- package/api/resources/harbors/resources/actions/client/Client.js +4 -0
- package/api/resources/{activity → harbors/resources/activity}/client/Client.d.ts +11 -11
- package/api/resources/{activity → harbors/resources/activity}/client/Client.js +12 -12
- package/api/resources/harbors/resources/activity/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/activity/client/index.js +17 -0
- package/api/resources/{activity → harbors/resources/activity}/client/requests/ActivityGetSessionRequest.d.ts +2 -2
- package/api/resources/{activity → harbors/resources/activity}/client/requests/ActivityListRequest.d.ts +2 -2
- package/api/resources/harbors/resources/activity/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/connections/client/Client.d.ts +64 -0
- package/api/resources/harbors/resources/connections/client/Client.js +236 -0
- package/api/resources/harbors/resources/connections/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/connections/client/index.js +17 -0
- package/api/resources/harbors/{client/requests/HarborsDeleteContextRequest.d.ts → resources/connections/client/requests/ConnectionsGetSchemaRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsListAuthorizedSchemasRequest.d.ts → resources/connections/client/requests/ConnectionsListRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsListAuthorizedConnectionsRequest.d.ts → resources/connections/client/requests/ConnectionsListSchemasRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/connections/client/requests/index.d.ts +3 -0
- package/api/resources/harbors/resources/connections/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/connections/exports.d.ts +2 -0
- package/api/resources/harbors/resources/connections/exports.js +21 -0
- package/api/resources/harbors/resources/connections/index.d.ts +1 -0
- package/api/resources/harbors/resources/connections/index.js +17 -0
- package/api/resources/harbors/resources/contexts/client/Client.d.ts +395 -0
- package/api/resources/harbors/resources/contexts/client/Client.js +1142 -0
- package/api/resources/harbors/resources/contexts/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/contexts/client/index.js +17 -0
- package/api/resources/harbors/{client/requests/HarborsGetSavedQueryRequest.d.ts → resources/contexts/client/requests/ContextsDeleteDraftRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsGetContextRequest.d.ts → resources/contexts/client/requests/ContextsDeleteRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsGetContextDraftRequest.d.ts → resources/contexts/client/requests/ContextsGetDraftRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/contexts/client/requests/ContextsGetRequest.d.ts +10 -0
- package/api/resources/harbors/resources/contexts/client/requests/ContextsGetVersionRequest.d.ts +10 -0
- package/api/resources/harbors/{client/requests/HarborsListContextDraftsRequest.d.ts → resources/contexts/client/requests/ContextsListDraftsRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsListContextsRequest.d.ts → resources/contexts/client/requests/ContextsListRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsListContextVersionsRequest.d.ts → resources/contexts/client/requests/ContextsListVersionsRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/contexts/client/requests/ContextsPromoteDraftRequest.d.ts +10 -0
- package/api/resources/harbors/{client → resources/contexts/client}/requests/ResolveHarborSourceMappingsRequest.d.ts +6 -2
- package/api/resources/harbors/resources/contexts/client/requests/index.d.ts +14 -0
- package/api/resources/harbors/resources/contexts/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/contexts/exports.d.ts +2 -0
- package/api/resources/harbors/resources/contexts/exports.js +21 -0
- package/api/resources/harbors/resources/contexts/index.d.ts +1 -0
- package/api/resources/harbors/resources/contexts/index.js +17 -0
- package/api/resources/harbors/resources/index.d.ts +15 -0
- package/api/resources/harbors/resources/index.js +16 -1
- package/api/resources/harbors/resources/keys/client/Client.d.ts +86 -0
- package/api/resources/harbors/resources/keys/client/Client.js +266 -0
- package/api/resources/harbors/resources/keys/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/keys/client/index.js +17 -0
- package/api/resources/harbors/{client/requests/HarborsListKeysRequest.d.ts → resources/keys/client/requests/KeysListRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/keys/client/requests/index.d.ts +1 -0
- package/api/resources/harbors/resources/keys/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/keys/exports.d.ts +2 -0
- package/api/resources/harbors/resources/keys/exports.js +21 -0
- package/api/resources/harbors/resources/keys/index.d.ts +1 -0
- package/api/resources/harbors/resources/keys/index.js +17 -0
- package/api/resources/harbors/resources/savedQueries/client/Client.d.ts +430 -0
- package/api/resources/harbors/resources/savedQueries/client/Client.js +1008 -0
- package/api/resources/harbors/resources/savedQueries/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/savedQueries/client/index.js +17 -0
- package/api/resources/harbors/{client → resources/savedQueries/client}/requests/CreateHarborSavedQueryDraftRequest.d.ts +1 -1
- package/api/resources/harbors/{client → resources/savedQueries/client}/requests/SaveHarborSavedQueryDraftRequest.d.ts +1 -1
- package/api/resources/harbors/resources/savedQueries/client/requests/SavedQueriesGetRequest.d.ts +10 -0
- package/api/resources/harbors/{client/requests/HarborsListSavedQueryDraftsRequest.d.ts → resources/savedQueries/client/requests/SavedQueriesListDraftsRequest.d.ts} +1 -1
- package/api/resources/harbors/{client/requests/HarborsListSavedQueriesRequest.d.ts → resources/savedQueries/client/requests/SavedQueriesListRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/savedQueries/client/requests/index.d.ts +6 -0
- package/api/resources/harbors/resources/savedQueries/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/savedQueries/exports.d.ts +2 -0
- package/api/resources/harbors/resources/savedQueries/exports.js +21 -0
- package/api/resources/harbors/resources/savedQueries/index.d.ts +1 -0
- package/api/resources/harbors/resources/savedQueries/index.js +17 -0
- package/api/resources/harbors/resources/users/client/Client.d.ts +105 -0
- package/api/resources/harbors/resources/users/client/Client.js +342 -0
- package/api/resources/harbors/resources/users/client/index.d.ts +1 -0
- package/api/resources/harbors/resources/users/client/index.js +17 -0
- package/api/resources/harbors/{client/requests/HarborsListUsersRequest.d.ts → resources/users/client/requests/UsersListRequest.d.ts} +1 -1
- package/api/resources/harbors/resources/users/client/requests/UsersListRequest.js +3 -0
- package/api/resources/harbors/resources/users/client/requests/index.d.ts +2 -0
- package/api/resources/harbors/resources/users/client/requests/index.js +2 -0
- package/api/resources/harbors/resources/users/exports.d.ts +2 -0
- package/api/resources/harbors/resources/users/exports.js +21 -0
- package/api/resources/harbors/resources/users/index.d.ts +1 -0
- package/api/resources/harbors/resources/users/index.js +17 -0
- package/api/resources/index.d.ts +0 -3
- package/api/resources/index.js +1 -4
- package/api/resources/modelSync/resources/executions/client/Client.d.ts +12 -6
- package/api/resources/modelSync/resources/executions/client/Client.js +12 -6
- package/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +1 -1
- package/api/resources/models/client/Client.d.ts +2 -8
- package/api/resources/models/client/Client.js +2 -8
- package/api/resources/permissions/resources/policies/client/Client.d.ts +10 -2
- package/api/resources/permissions/resources/policies/client/Client.js +10 -2
- package/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +5 -1
- package/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +5 -1
- package/api/resources/recordViewLinks/client/Client.d.ts +5 -0
- package/api/resources/recordViewLinks/client/Client.js +5 -0
- package/api/resources/schemas/client/Client.d.ts +4 -11
- package/api/resources/schemas/client/Client.js +4 -11
- package/api/resources/temporaryCredentials/client/Client.d.ts +3 -0
- package/api/resources/temporaryCredentials/client/Client.js +3 -0
- package/api/resources/users/client/Client.d.ts +30 -15
- package/api/resources/users/client/Client.js +30 -15
- package/api/resources/webhooks/client/Client.d.ts +7 -7
- package/api/resources/webhooks/client/Client.js +7 -7
- package/api/types/BulkBulkSyncSchedule.d.ts +0 -1
- package/api/types/BulkSchema.d.ts +2 -0
- package/api/types/BulkSelectiveMode.d.ts +9 -0
- package/api/types/BulkSelectiveMode.js +9 -0
- package/api/types/BulkSyncAdditionalScheduleRequest.d.ts +0 -1
- package/api/types/BulkSyncAdditionalScheduleResponse.d.ts +0 -1
- package/api/types/BulkSyncDest.d.ts +2 -0
- package/api/types/BulkSyncScheduleApi.d.ts +0 -1
- package/api/types/BulkSyncSourceCapabilities.d.ts +2 -0
- package/api/types/ConnectAccessLevel.d.ts +5 -0
- package/api/types/ConnectAccessLevel.js +8 -0
- package/api/types/ConnectionType.d.ts +2 -0
- package/api/types/EventPayload.d.ts +1 -1
- package/api/types/EventingBulkSyncCanceledEvent.d.ts +5 -2
- package/api/types/EventingBulkSyncCompletedEvent.d.ts +5 -2
- package/api/types/EventingBulkSyncCompletedWithErrorEvent.d.ts +5 -2
- package/api/types/EventingBulkSyncFailedEvent.d.ts +5 -2
- package/api/types/EventingBulkSyncRunningEvent.d.ts +5 -2
- package/api/types/EventingBulkSyncSchedule.d.ts +1 -1
- package/api/types/EventingIngestionRecoveredEvent.d.ts +17 -0
- package/api/types/EventingIngestionRecoveredEvent.js +3 -0
- package/api/types/EventingIngestionStalledEvent.d.ts +19 -0
- package/api/types/EventingIngestionStalledEvent.js +3 -0
- package/api/types/EventingSyncCanceledEvent.d.ts +5 -2
- package/api/types/EventingSyncCompletedEvent.d.ts +6 -3
- package/api/types/EventingSyncCompletedWithErrorsEvent.d.ts +5 -2
- package/api/types/EventingSyncFailedEvent.d.ts +5 -2
- package/api/types/EventingSyncRunningEvent.d.ts +5 -2
- package/api/types/HarborStatusScheduleResponse.d.ts +0 -1
- package/api/types/HarboractivityapiHarborActivityMetadata.d.ts +2 -2
- package/api/types/SchemaConfiguration.d.ts +2 -0
- package/api/types/index.d.ts +3 -0
- package/api/types/index.js +3 -0
- package/package.json +1 -1
- package/reference.md +2696 -2580
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/harbors/client/requests/HarborsDeleteContextDraftRequest.d.ts +0 -10
- package/api/resources/harbors/client/requests/HarborsGetAuthorizedSchemaRequest.d.ts +0 -10
- package/api/resources/harbors/client/requests/HarborsGetContextVersionRequest.d.ts +0 -10
- package/api/resources/harbors/client/requests/HarborsPromoteContextDraftRequest.d.ts +0 -10
- /package/api/resources/{activity/client/requests/ActivityGetSessionRequest.js → bulkSync/client/requests/BulkSyncGetDestinationRequest.js} +0 -0
- /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/index.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/index.js +0 -0
- /package/api/resources/{activity/client/requests/ActivityListRequest.js → harbors/resources/actionConfiguration/client/requests/ActionConfigurationListSchemasRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/CreateHarborContextDraftRequest.js → resources/actionConfiguration/client/requests/ActionConfigurationRemoveRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/actionConfiguration/client}/requests/SetHarborActionConfigurationRequest.js +0 -0
- /package/api/resources/{activity → harbors/resources/actionConfiguration}/client/requests/index.js +0 -0
- /package/api/resources/harbors/{client/requests/CreateHarborContextRequest.js → resources/activity/client/requests/ActivityGetSessionRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/CreateHarborSavedQueryDraftRequest.js → resources/activity/client/requests/ActivityListRequest.js} +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/client/requests/index.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/exports.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/exports.js +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/index.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/index.js +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/ActivityGetSessionRequestOrder.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/ActivityGetSessionRequestOrder.js +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/ActivityListRequestOrder.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/ActivityListRequestOrder.js +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/index.d.ts +0 -0
- /package/api/resources/{activity → harbors/resources/activity}/types/index.js +0 -0
- /package/api/resources/harbors/{client/requests/ExecuteHarborSavedQueryRequest.js → resources/connections/client/requests/ConnectionsGetSchemaRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsDeleteContextDraftRequest.js → resources/connections/client/requests/ConnectionsListRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsDeleteContextRequest.js → resources/connections/client/requests/ConnectionsListSchemasRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsGetAuthorizedSchemaRequest.js → resources/contexts/client/requests/ContextsDeleteDraftRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsGetContextDraftRequest.js → resources/contexts/client/requests/ContextsDeleteRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsGetContextRequest.js → resources/contexts/client/requests/ContextsGetDraftRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsGetContextVersionRequest.js → resources/contexts/client/requests/ContextsGetRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsGetSavedQueryRequest.js → resources/contexts/client/requests/ContextsGetVersionRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListActionConfigurationSchemasRequest.js → resources/contexts/client/requests/ContextsListDraftsRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListAuthorizedConnectionsRequest.js → resources/contexts/client/requests/ContextsListRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListAuthorizedSchemasRequest.js → resources/contexts/client/requests/ContextsListVersionsRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListContextDraftsRequest.js → resources/contexts/client/requests/ContextsPromoteDraftRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/CreateHarborContextDraftRequest.d.ts +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListContextVersionsRequest.js → resources/contexts/client/requests/CreateHarborContextDraftRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/CreateHarborContextRequest.d.ts +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListContextsRequest.js → resources/contexts/client/requests/CreateHarborContextRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/ResolveHarborSourceMappingsRequest.js +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextDraftRequest.d.ts +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextDraftRequest.js +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextRequest.d.ts +0 -0
- /package/api/resources/harbors/{client → resources/contexts/client}/requests/SaveHarborContextRequest.js +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListKeysRequest.js → resources/keys/client/requests/KeysListRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListSavedQueriesRequest.js → resources/savedQueries/client/requests/CreateHarborSavedQueryDraftRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/savedQueries/client}/requests/ExecuteHarborSavedQueryRequest.d.ts +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListSavedQueryDraftsRequest.js → resources/savedQueries/client/requests/ExecuteHarborSavedQueryRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/savedQueries/client}/requests/SaveHarborSavedQueryDraftRequest.js +0 -0
- /package/api/resources/harbors/{client/requests/HarborsListUsersRequest.js → resources/savedQueries/client/requests/SavedQueriesGetRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsPromoteContextDraftRequest.js → resources/savedQueries/client/requests/SavedQueriesListDraftsRequest.js} +0 -0
- /package/api/resources/harbors/{client/requests/HarborsRemoveActionConfigurationRequest.js → resources/savedQueries/client/requests/SavedQueriesListRequest.js} +0 -0
- /package/api/resources/harbors/{client → resources/users/client}/requests/InviteHarborUserRequest.d.ts +0 -0
- /package/api/resources/harbors/{client → resources/users/client}/requests/InviteHarborUserRequest.js +0 -0
|
@@ -63,192 +63,49 @@ const environments = __importStar(require("../../../../environments"));
|
|
|
63
63
|
const handleNonStatusCodeError_1 = require("../../../../errors/handleNonStatusCodeError");
|
|
64
64
|
const errors = __importStar(require("../../../../errors/index"));
|
|
65
65
|
const Polytomic = __importStar(require("../../../index"));
|
|
66
|
-
const Client_1 = require("../resources/
|
|
66
|
+
const Client_1 = require("../resources/actionConfiguration/client/Client");
|
|
67
|
+
const Client_2 = require("../resources/actions/client/Client");
|
|
68
|
+
const Client_3 = require("../resources/activity/client/Client");
|
|
69
|
+
const Client_4 = require("../resources/connections/client/Client");
|
|
70
|
+
const Client_5 = require("../resources/contexts/client/Client");
|
|
71
|
+
const Client_6 = require("../resources/keys/client/Client");
|
|
72
|
+
const Client_7 = require("../resources/savedQueries/client/Client");
|
|
73
|
+
const Client_8 = require("../resources/users/client/Client");
|
|
67
74
|
class HarborsClient {
|
|
68
75
|
constructor(options = {}) {
|
|
69
76
|
this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
|
|
70
77
|
}
|
|
71
|
-
get
|
|
78
|
+
get connections() {
|
|
72
79
|
var _a;
|
|
73
|
-
return ((_a = this.
|
|
80
|
+
return ((_a = this._connections) !== null && _a !== void 0 ? _a : (this._connections = new Client_4.ConnectionsClient(this._options)));
|
|
74
81
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* @param {Polytomic.HarborsListAuthorizedConnectionsRequest} request
|
|
79
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
-
*
|
|
81
|
-
* @throws {@link errors.PolytomicError}
|
|
82
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* await client.harbors.listAuthorizedConnections({
|
|
86
|
-
* limit: 1,
|
|
87
|
-
* page_token: "page_token"
|
|
88
|
-
* })
|
|
89
|
-
*/
|
|
90
|
-
listAuthorizedConnections(request = {}, requestOptions) {
|
|
91
|
-
return core.HttpResponsePromise.fromPromise(this.__listAuthorizedConnections(request, requestOptions));
|
|
82
|
+
get actionConfiguration() {
|
|
83
|
+
var _a;
|
|
84
|
+
return ((_a = this._actionConfiguration) !== null && _a !== void 0 ? _a : (this._actionConfiguration = new Client_1.ActionConfigurationClient(this._options)));
|
|
92
85
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
97
|
-
const _queryParams = {
|
|
98
|
-
limit,
|
|
99
|
-
page_token: pageToken,
|
|
100
|
-
};
|
|
101
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
102
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
103
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
104
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
105
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
106
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
107
|
-
const _response = yield core.fetcher({
|
|
108
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, "api/harbor/connections"),
|
|
109
|
-
method: "GET",
|
|
110
|
-
headers: _headers,
|
|
111
|
-
queryString: core.url
|
|
112
|
-
.queryBuilder()
|
|
113
|
-
.addMany(_queryParams)
|
|
114
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
115
|
-
.build(),
|
|
116
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
117
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
118
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
119
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
120
|
-
logging: this._options.logging,
|
|
121
|
-
});
|
|
122
|
-
if (_response.ok) {
|
|
123
|
-
return {
|
|
124
|
-
data: _response.body,
|
|
125
|
-
rawResponse: _response.rawResponse,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
if (_response.error.reason === "status-code") {
|
|
129
|
-
throw new errors.PolytomicError({
|
|
130
|
-
statusCode: _response.error.statusCode,
|
|
131
|
-
body: _response.error.body,
|
|
132
|
-
rawResponse: _response.rawResponse,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbor/connections");
|
|
136
|
-
});
|
|
86
|
+
get actions() {
|
|
87
|
+
var _a;
|
|
88
|
+
return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Client_2.ActionsClient(this._options)));
|
|
137
89
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
* @param {string} connection_id - Connection ID
|
|
142
|
-
* @param {Polytomic.HarborsListAuthorizedSchemasRequest} request
|
|
143
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
|
-
*
|
|
145
|
-
* @throws {@link errors.PolytomicError}
|
|
146
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* await client.harbors.listAuthorizedSchemas("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
150
|
-
* limit: 1,
|
|
151
|
-
* page_token: "page_token"
|
|
152
|
-
* })
|
|
153
|
-
*/
|
|
154
|
-
listAuthorizedSchemas(connection_id, request = {}, requestOptions) {
|
|
155
|
-
return core.HttpResponsePromise.fromPromise(this.__listAuthorizedSchemas(connection_id, request, requestOptions));
|
|
90
|
+
get contexts() {
|
|
91
|
+
var _a;
|
|
92
|
+
return ((_a = this._contexts) !== null && _a !== void 0 ? _a : (this._contexts = new Client_5.ContextsClient(this._options)));
|
|
156
93
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
161
|
-
const _queryParams = {
|
|
162
|
-
limit,
|
|
163
|
-
page_token: pageToken,
|
|
164
|
-
};
|
|
165
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
166
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
167
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
168
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
169
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
170
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
171
|
-
const _response = yield core.fetcher({
|
|
172
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbor/connections/${core.url.encodePathParam(connection_id)}/schemas`),
|
|
173
|
-
method: "GET",
|
|
174
|
-
headers: _headers,
|
|
175
|
-
queryString: core.url
|
|
176
|
-
.queryBuilder()
|
|
177
|
-
.addMany(_queryParams)
|
|
178
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
179
|
-
.build(),
|
|
180
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
181
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
182
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
183
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
184
|
-
logging: this._options.logging,
|
|
185
|
-
});
|
|
186
|
-
if (_response.ok) {
|
|
187
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
188
|
-
}
|
|
189
|
-
if (_response.error.reason === "status-code") {
|
|
190
|
-
throw new errors.PolytomicError({
|
|
191
|
-
statusCode: _response.error.statusCode,
|
|
192
|
-
body: _response.error.body,
|
|
193
|
-
rawResponse: _response.rawResponse,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbor/connections/{connection_id}/schemas");
|
|
197
|
-
});
|
|
94
|
+
get keys() {
|
|
95
|
+
var _a;
|
|
96
|
+
return ((_a = this._keys) !== null && _a !== void 0 ? _a : (this._keys = new Client_6.KeysClient(this._options)));
|
|
198
97
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
* @param {string} connection_id - Connection ID
|
|
203
|
-
* @param {string} schema_id - Schema ID
|
|
204
|
-
* @param {Polytomic.HarborsGetAuthorizedSchemaRequest} request
|
|
205
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
-
*
|
|
207
|
-
* @throws {@link errors.PolytomicError}
|
|
208
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* await client.harbors.getAuthorizedSchema("248df4b7-aa70-47b8-a036-33ac447e668d", "schema_id")
|
|
212
|
-
*/
|
|
213
|
-
getAuthorizedSchema(connection_id, schema_id, request = {}, requestOptions) {
|
|
214
|
-
return core.HttpResponsePromise.fromPromise(this.__getAuthorizedSchema(connection_id, schema_id, request, requestOptions));
|
|
98
|
+
get savedQueries() {
|
|
99
|
+
var _a;
|
|
100
|
+
return ((_a = this._savedQueries) !== null && _a !== void 0 ? _a : (this._savedQueries = new Client_7.SavedQueriesClient(this._options)));
|
|
215
101
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
224
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
225
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
226
|
-
const _response = yield core.fetcher({
|
|
227
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbor/connections/${core.url.encodePathParam(connection_id)}/schemas/${core.url.encodePathParam(schema_id)}`),
|
|
228
|
-
method: "GET",
|
|
229
|
-
headers: _headers,
|
|
230
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
231
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
232
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
233
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
234
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
235
|
-
logging: this._options.logging,
|
|
236
|
-
});
|
|
237
|
-
if (_response.ok) {
|
|
238
|
-
return {
|
|
239
|
-
data: _response.body,
|
|
240
|
-
rawResponse: _response.rawResponse,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
if (_response.error.reason === "status-code") {
|
|
244
|
-
throw new errors.PolytomicError({
|
|
245
|
-
statusCode: _response.error.statusCode,
|
|
246
|
-
body: _response.error.body,
|
|
247
|
-
rawResponse: _response.rawResponse,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbor/connections/{connection_id}/schemas/{schema_id}");
|
|
251
|
-
});
|
|
102
|
+
get users() {
|
|
103
|
+
var _a;
|
|
104
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_8.UsersClient(this._options)));
|
|
105
|
+
}
|
|
106
|
+
get activity() {
|
|
107
|
+
var _a;
|
|
108
|
+
return ((_a = this._activity) !== null && _a !== void 0 ? _a : (this._activity = new Client_3.ActivityClient(this._options)));
|
|
252
109
|
}
|
|
253
110
|
/**
|
|
254
111
|
* Registers a service-attested MCP transport session for a scoped Harbor credential.
|
|
@@ -739,50 +596,65 @@ class HarborsClient {
|
|
|
739
596
|
});
|
|
740
597
|
}
|
|
741
598
|
/**
|
|
742
|
-
*
|
|
599
|
+
* Submits a query against the Harbor backing connection for asynchronous execution.
|
|
743
600
|
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
601
|
+
* Use a scoped credential bound to this Harbor. The query runs only against the
|
|
602
|
+
* Harbor's backing connection; you cannot select another connection on this route.
|
|
603
|
+
* Send a unique `X-Polytomic-Activity-Request-ID` UUID with each submission. The
|
|
604
|
+
* `X-Polytomic-Harbor-Session` header is optional; if you send one, it must be
|
|
605
|
+
* valid for this Harbor.
|
|
747
606
|
*
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
*
|
|
607
|
+
* The response contains a query ID and an initial `created` status. Poll
|
|
608
|
+
* [`GET /api/queries/{id}`](../../../../api-reference/query-runner/get-query) with that ID
|
|
609
|
+
* until the status is `done`, `failed`, or `unknown`. Follow the result endpoint's
|
|
610
|
+
* pagination links for additional rows. Results are temporary; check `expires`
|
|
611
|
+
* on the completed query.
|
|
751
612
|
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
613
|
+
* To open a result record in its source application, discover
|
|
614
|
+
* [record-view capabilities](../../../../api-reference/record-view-links/get-capabilities)
|
|
615
|
+
* and create a record-view link for the source Connection and schema. Record-view
|
|
616
|
+
* links are also available independently of Harbor.
|
|
755
617
|
*
|
|
756
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
757
|
-
* @param {
|
|
618
|
+
* @param {string} harbor_id - Unique identifier of the Harbor whose backing connection runs the query
|
|
619
|
+
* @param {Polytomic.RunHarborQueryRequest} request
|
|
620
|
+
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
758
621
|
*
|
|
622
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
759
623
|
* @throws {@link Polytomic.ForbiddenError}
|
|
760
624
|
* @throws {@link Polytomic.NotFoundError}
|
|
761
625
|
* @throws {@link Polytomic.ConflictError}
|
|
762
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
763
626
|
* @throws {@link Polytomic.InternalServerError}
|
|
764
627
|
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
765
628
|
* @throws {@link errors.PolytomicError}
|
|
766
629
|
* @throws {@link errors.PolytomicTimeoutError}
|
|
767
630
|
*
|
|
768
631
|
* @example
|
|
769
|
-
* await client.harbors.
|
|
632
|
+
* await client.harbors.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
633
|
+
* query: "SELECT 1 AS n"
|
|
634
|
+
* })
|
|
770
635
|
*/
|
|
771
|
-
|
|
772
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
636
|
+
runQuery(harbor_id, request, requestOptions) {
|
|
637
|
+
return core.HttpResponsePromise.fromPromise(this.__runQuery(harbor_id, request, requestOptions));
|
|
773
638
|
}
|
|
774
|
-
|
|
639
|
+
__runQuery(harbor_id, request, requestOptions) {
|
|
775
640
|
return __awaiter(this, void 0, void 0, function* () {
|
|
776
641
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
642
|
+
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
|
|
777
643
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
778
644
|
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
645
|
+
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
646
|
+
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
647
|
+
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
779
648
|
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
780
649
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
781
650
|
const _response = yield core.fetcher({
|
|
782
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/
|
|
783
|
-
method: "
|
|
651
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/query`),
|
|
652
|
+
method: "POST",
|
|
784
653
|
headers: _headers,
|
|
654
|
+
contentType: "application/json",
|
|
785
655
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
656
|
+
requestType: "json",
|
|
657
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
786
658
|
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
787
659
|
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
788
660
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -790,21 +662,18 @@ class HarborsClient {
|
|
|
790
662
|
logging: this._options.logging,
|
|
791
663
|
});
|
|
792
664
|
if (_response.ok) {
|
|
793
|
-
return {
|
|
794
|
-
data: _response.body,
|
|
795
|
-
rawResponse: _response.rawResponse,
|
|
796
|
-
};
|
|
665
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
797
666
|
}
|
|
798
667
|
if (_response.error.reason === "status-code") {
|
|
799
668
|
switch (_response.error.statusCode) {
|
|
669
|
+
case 400:
|
|
670
|
+
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
800
671
|
case 403:
|
|
801
672
|
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
802
673
|
case 404:
|
|
803
674
|
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
804
675
|
case 409:
|
|
805
676
|
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
806
|
-
case 422:
|
|
807
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
808
677
|
case 500:
|
|
809
678
|
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
810
679
|
case 503:
|
|
@@ -817,53 +686,69 @@ class HarborsClient {
|
|
|
817
686
|
});
|
|
818
687
|
}
|
|
819
688
|
}
|
|
820
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
689
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/query");
|
|
821
690
|
});
|
|
822
691
|
}
|
|
823
692
|
/**
|
|
824
|
-
*
|
|
693
|
+
* Returns raw Polytomic refresh evidence for datasets written to a Harbor.
|
|
694
|
+
*
|
|
695
|
+
* Each pipeline corresponds to a bulk sync or model sync that writes at least one
|
|
696
|
+
* dataset to the Harbor's backing Connection. Tables populated outside Polytomic
|
|
697
|
+
* are not included, even when they are queryable through a customer-managed
|
|
698
|
+
* backing Connection.
|
|
825
699
|
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
* Organization must have the Harbor Actions entitlement.
|
|
700
|
+
* The response groups shared pipeline evidence so schedules and configuration are
|
|
701
|
+
* not repeated for every dataset:
|
|
829
702
|
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
*
|
|
703
|
+
* - Each entry in `pipelines` identifies the producer through `type` and `id`.
|
|
704
|
+
* Separate pipelines targeting the same physical dataset remain separate
|
|
705
|
+
* entries.
|
|
706
|
+
* - `datasets` is keyed by the effective destination dataset name.
|
|
707
|
+
* `last_success_at` is the start time of the most recent execution in which that
|
|
708
|
+
* dataset completed successfully, including a successful dataset within a bulk
|
|
709
|
+
* execution that completes with errors. The start time is a conservative upper
|
|
710
|
+
* bound because source reads and destination writes happen afterward.
|
|
711
|
+
* - `latest_status` preserves the latest Polytomic execution status. Never-run
|
|
712
|
+
* datasets omit this field.
|
|
713
|
+
* - Pipeline-level `schedules` preserves schedule parameters and selectors. A
|
|
714
|
+
* schedule can be manual, event-driven, advanced, selective, or limited to
|
|
715
|
+
* named source schemas, so callers should not reduce the list to one inferred
|
|
716
|
+
* cadence.
|
|
717
|
+
* - Continuous schedules use the scheduler's persisted next firing. If scheduler
|
|
718
|
+
* state is unavailable, `next_run_at` is omitted rather than recalculated with
|
|
719
|
+
* new jitter.
|
|
720
|
+
* - Paused pipelines remain present with `refresh_enabled` set to `false` and no
|
|
721
|
+
* `next_run_at`.
|
|
834
722
|
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
723
|
+
* Use absolute timestamps and the raw statuses to apply the maximum acceptable
|
|
724
|
+
* staleness for your task. The endpoint does not classify datasets or the Harbor
|
|
725
|
+
* as healthy, stale, or unhealthy.
|
|
837
726
|
*
|
|
838
727
|
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
839
|
-
* @param {HarborsClient.
|
|
728
|
+
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
840
729
|
*
|
|
841
730
|
* @throws {@link Polytomic.ForbiddenError}
|
|
842
731
|
* @throws {@link Polytomic.NotFoundError}
|
|
843
|
-
* @throws {@link Polytomic.ConflictError}
|
|
844
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
845
732
|
* @throws {@link Polytomic.InternalServerError}
|
|
846
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
847
733
|
* @throws {@link errors.PolytomicError}
|
|
848
734
|
* @throws {@link errors.PolytomicTimeoutError}
|
|
849
735
|
*
|
|
850
736
|
* @example
|
|
851
|
-
* await client.harbors.
|
|
737
|
+
* await client.harbors.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
852
738
|
*/
|
|
853
|
-
|
|
854
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
739
|
+
getStatus(harbor_id, requestOptions) {
|
|
740
|
+
return core.HttpResponsePromise.fromPromise(this.__getStatus(harbor_id, requestOptions));
|
|
855
741
|
}
|
|
856
|
-
|
|
742
|
+
__getStatus(harbor_id, requestOptions) {
|
|
857
743
|
return __awaiter(this, void 0, void 0, function* () {
|
|
858
744
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
859
745
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
860
746
|
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
861
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
862
747
|
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
863
748
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
864
749
|
const _response = yield core.fetcher({
|
|
865
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/
|
|
866
|
-
method: "
|
|
750
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/status`),
|
|
751
|
+
method: "GET",
|
|
867
752
|
headers: _headers,
|
|
868
753
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
869
754
|
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
@@ -873,2855 +758,7 @@ class HarborsClient {
|
|
|
873
758
|
logging: this._options.logging,
|
|
874
759
|
});
|
|
875
760
|
if (_response.ok) {
|
|
876
|
-
return {
|
|
877
|
-
data: _response.body,
|
|
878
|
-
rawResponse: _response.rawResponse,
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
if (_response.error.reason === "status-code") {
|
|
882
|
-
switch (_response.error.statusCode) {
|
|
883
|
-
case 403:
|
|
884
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
885
|
-
case 404:
|
|
886
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
887
|
-
case 409:
|
|
888
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
889
|
-
case 422:
|
|
890
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
891
|
-
case 500:
|
|
892
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
893
|
-
case 503:
|
|
894
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
895
|
-
default:
|
|
896
|
-
throw new errors.PolytomicError({
|
|
897
|
-
statusCode: _response.error.statusCode,
|
|
898
|
-
body: _response.error.body,
|
|
899
|
-
rawResponse: _response.rawResponse,
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/action-configuration");
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
/**
|
|
907
|
-
* Lists action-capable source Connections that populate a Harbor.
|
|
908
|
-
*
|
|
909
|
-
* You must be an Organization administrator with permission to edit the Harbor.
|
|
910
|
-
* Use a writable API credential, not a Harbor profile credential. Read-only keys
|
|
911
|
-
* are denied because this endpoint requires Harbor edit permission. Discovery does
|
|
912
|
-
* not require the Harbor Actions entitlement.
|
|
913
|
-
*
|
|
914
|
-
* A Connection is eligible when it supports actions and is a source of a
|
|
915
|
-
* non-deleted Bulk Sync or Model Sync targeting the Harbor's backing Connection.
|
|
916
|
-
* Only saved, non-shared Connections in your Organization that you can query are
|
|
917
|
-
* included. Disabled syncs still establish source membership.
|
|
918
|
-
*
|
|
919
|
-
* Discover schemas and operations before choosing the grants to configure.
|
|
920
|
-
*
|
|
921
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
922
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
923
|
-
*
|
|
924
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
925
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
926
|
-
* @throws {@link Polytomic.ConflictError}
|
|
927
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
928
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
929
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
930
|
-
* @throws {@link errors.PolytomicError}
|
|
931
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
932
|
-
*
|
|
933
|
-
* @example
|
|
934
|
-
* await client.harbors.listActionSourceConnections("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
935
|
-
*/
|
|
936
|
-
listActionSourceConnections(harbor_id, requestOptions) {
|
|
937
|
-
return core.HttpResponsePromise.fromPromise(this.__listActionSourceConnections(harbor_id, requestOptions));
|
|
938
|
-
}
|
|
939
|
-
__listActionSourceConnections(harbor_id, requestOptions) {
|
|
940
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
941
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
942
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
943
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
944
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
945
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
946
|
-
const _response = yield core.fetcher({
|
|
947
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/action-configuration/connections`),
|
|
948
|
-
method: "GET",
|
|
949
|
-
headers: _headers,
|
|
950
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
951
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
952
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
953
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
954
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
955
|
-
logging: this._options.logging,
|
|
956
|
-
});
|
|
957
|
-
if (_response.ok) {
|
|
958
|
-
return {
|
|
959
|
-
data: _response.body,
|
|
960
|
-
rawResponse: _response.rawResponse,
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
if (_response.error.reason === "status-code") {
|
|
964
|
-
switch (_response.error.statusCode) {
|
|
965
|
-
case 403:
|
|
966
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
967
|
-
case 404:
|
|
968
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
969
|
-
case 409:
|
|
970
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
971
|
-
case 422:
|
|
972
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
973
|
-
case 500:
|
|
974
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
975
|
-
case 503:
|
|
976
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
977
|
-
default:
|
|
978
|
-
throw new errors.PolytomicError({
|
|
979
|
-
statusCode: _response.error.statusCode,
|
|
980
|
-
body: _response.error.body,
|
|
981
|
-
rawResponse: _response.rawResponse,
|
|
982
|
-
});
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/action-configuration/connections");
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
/**
|
|
989
|
-
* Creates or replaces action grants for an eligible Harbor source Connection.
|
|
990
|
-
*
|
|
991
|
-
* You must be an Organization administrator with permission to edit both the
|
|
992
|
-
* Harbor and the source Connection. Use a normal writable API credential, not a
|
|
993
|
-
* Harbor profile credential. Your Organization must have the Harbor Actions
|
|
994
|
-
* entitlement.
|
|
995
|
-
*
|
|
996
|
-
* The Connection must populate the Harbor through a non-deleted Bulk Sync or Model
|
|
997
|
-
* Sync targeting its backing Connection. This requirement applies to new grants
|
|
998
|
-
* and replacements, even when you only remove fields from an existing grant.
|
|
999
|
-
*
|
|
1000
|
-
* Submit the complete grant set for this Connection. Omit `expected_revision` to
|
|
1001
|
-
* create it, or supply the current revision to replace it. A missing, stale, or
|
|
1002
|
-
* unexpected revision returns `409 Conflict`; read configuration again before
|
|
1003
|
-
* retrying. Successful replacement creates a new revision.
|
|
1004
|
-
*
|
|
1005
|
-
* For mutating operations, `field_ids` selects input fields and
|
|
1006
|
-
* `lookup_field_ids` must be omitted. For read-only operations, `field_ids`
|
|
1007
|
-
* selects output fields and `lookup_field_ids` selects allowed lookup fields.
|
|
1008
|
-
* Duplicate operations or field IDs are invalid. An empty grant set is invalid;
|
|
1009
|
-
* remove the Connection's grants instead.
|
|
1010
|
-
*
|
|
1011
|
-
* This request changes permissions only. It does not execute provider actions.
|
|
1012
|
-
*
|
|
1013
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1014
|
-
* @param {string} connection_id - Source Connection whose action grants you want to manage
|
|
1015
|
-
* @param {Polytomic.SetHarborActionConfigurationRequest} request
|
|
1016
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1017
|
-
*
|
|
1018
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1019
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1020
|
-
* @throws {@link Polytomic.ConflictError}
|
|
1021
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1022
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1023
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
1024
|
-
* @throws {@link errors.PolytomicError}
|
|
1025
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1026
|
-
*
|
|
1027
|
-
* @example
|
|
1028
|
-
* await client.harbors.setActionConfiguration("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1029
|
-
*/
|
|
1030
|
-
setActionConfiguration(harbor_id, connection_id, request = {}, requestOptions) {
|
|
1031
|
-
return core.HttpResponsePromise.fromPromise(this.__setActionConfiguration(harbor_id, connection_id, request, requestOptions));
|
|
1032
|
-
}
|
|
1033
|
-
__setActionConfiguration(harbor_id_1, connection_id_1) {
|
|
1034
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, connection_id, request = {}, requestOptions) {
|
|
1035
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1036
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1037
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1038
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1039
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1040
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1041
|
-
const _response = yield core.fetcher({
|
|
1042
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/action-configuration/connections/${core.url.encodePathParam(connection_id)}`),
|
|
1043
|
-
method: "PUT",
|
|
1044
|
-
headers: _headers,
|
|
1045
|
-
contentType: "application/json",
|
|
1046
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1047
|
-
requestType: "json",
|
|
1048
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
1049
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1050
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1051
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1052
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1053
|
-
logging: this._options.logging,
|
|
1054
|
-
});
|
|
1055
|
-
if (_response.ok) {
|
|
1056
|
-
return {
|
|
1057
|
-
data: _response.body,
|
|
1058
|
-
rawResponse: _response.rawResponse,
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
if (_response.error.reason === "status-code") {
|
|
1062
|
-
switch (_response.error.statusCode) {
|
|
1063
|
-
case 403:
|
|
1064
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1065
|
-
case 404:
|
|
1066
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1067
|
-
case 409:
|
|
1068
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
1069
|
-
case 422:
|
|
1070
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1071
|
-
case 500:
|
|
1072
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1073
|
-
case 503:
|
|
1074
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1075
|
-
default:
|
|
1076
|
-
throw new errors.PolytomicError({
|
|
1077
|
-
statusCode: _response.error.statusCode,
|
|
1078
|
-
body: _response.error.body,
|
|
1079
|
-
rawResponse: _response.rawResponse,
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/action-configuration/connections/{connection_id}");
|
|
1084
|
-
});
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* Removes a Connection's action grants from a Harbor.
|
|
1088
|
-
*
|
|
1089
|
-
* You must be an Organization administrator with permission to edit the Harbor.
|
|
1090
|
-
* Use a normal writable API credential, not a Harbor profile credential. Your
|
|
1091
|
-
* Organization must have the Harbor Actions entitlement.
|
|
1092
|
-
*
|
|
1093
|
-
* Supply the current `expected_revision` as a query parameter. A stale revision
|
|
1094
|
-
* returns `409 Conflict`; read configuration again before retrying.
|
|
1095
|
-
*
|
|
1096
|
-
* You can remove grants after the Connection stops populating the Harbor, or after
|
|
1097
|
-
* the Connection is deleted. The response contains the remaining configured action
|
|
1098
|
-
* Connections. This request does not delete the Connection or provider records.
|
|
1099
|
-
*
|
|
1100
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1101
|
-
* @param {string} connection_id - Source Connection whose action grants you want to manage
|
|
1102
|
-
* @param {Polytomic.HarborsRemoveActionConfigurationRequest} request
|
|
1103
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1104
|
-
*
|
|
1105
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1106
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1107
|
-
* @throws {@link Polytomic.ConflictError}
|
|
1108
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1109
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1110
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
1111
|
-
* @throws {@link errors.PolytomicError}
|
|
1112
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1113
|
-
*
|
|
1114
|
-
* @example
|
|
1115
|
-
* await client.harbors.removeActionConfiguration("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1116
|
-
* expected_revision: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
1117
|
-
* })
|
|
1118
|
-
*/
|
|
1119
|
-
removeActionConfiguration(harbor_id, connection_id, request, requestOptions) {
|
|
1120
|
-
return core.HttpResponsePromise.fromPromise(this.__removeActionConfiguration(harbor_id, connection_id, request, requestOptions));
|
|
1121
|
-
}
|
|
1122
|
-
__removeActionConfiguration(harbor_id, connection_id, request, requestOptions) {
|
|
1123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1124
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1125
|
-
const { expected_revision: expectedRevision } = request;
|
|
1126
|
-
const _queryParams = {
|
|
1127
|
-
expected_revision: expectedRevision,
|
|
1128
|
-
};
|
|
1129
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1130
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1131
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1132
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1133
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1134
|
-
const _response = yield core.fetcher({
|
|
1135
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/action-configuration/connections/${core.url.encodePathParam(connection_id)}`),
|
|
1136
|
-
method: "DELETE",
|
|
1137
|
-
headers: _headers,
|
|
1138
|
-
queryString: core.url
|
|
1139
|
-
.queryBuilder()
|
|
1140
|
-
.addMany(_queryParams)
|
|
1141
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
1142
|
-
.build(),
|
|
1143
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1144
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1145
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1146
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1147
|
-
logging: this._options.logging,
|
|
1148
|
-
});
|
|
1149
|
-
if (_response.ok) {
|
|
1150
|
-
return {
|
|
1151
|
-
data: _response.body,
|
|
1152
|
-
rawResponse: _response.rawResponse,
|
|
1153
|
-
};
|
|
1154
|
-
}
|
|
1155
|
-
if (_response.error.reason === "status-code") {
|
|
1156
|
-
switch (_response.error.statusCode) {
|
|
1157
|
-
case 403:
|
|
1158
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1159
|
-
case 404:
|
|
1160
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1161
|
-
case 409:
|
|
1162
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
1163
|
-
case 422:
|
|
1164
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1165
|
-
case 500:
|
|
1166
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1167
|
-
case 503:
|
|
1168
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1169
|
-
default:
|
|
1170
|
-
throw new errors.PolytomicError({
|
|
1171
|
-
statusCode: _response.error.statusCode,
|
|
1172
|
-
body: _response.error.body,
|
|
1173
|
-
rawResponse: _response.rawResponse,
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/action-configuration/connections/{connection_id}");
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
/**
|
|
1181
|
-
* Lists available action schemas for an eligible Harbor source Connection.
|
|
1182
|
-
*
|
|
1183
|
-
* You must be an Organization administrator with permission to edit the Harbor
|
|
1184
|
-
* and query the source Connection. Use a writable API credential, not a Harbor
|
|
1185
|
-
* profile credential. Read-only keys are denied because this endpoint requires
|
|
1186
|
-
* Harbor edit permission. Discovery does not require the Harbor Actions entitlement.
|
|
1187
|
-
*
|
|
1188
|
-
* The Connection must populate the Harbor through a non-deleted Bulk Sync or Model
|
|
1189
|
-
* Sync targeting its backing Connection. The response lists action schemas, not
|
|
1190
|
-
* records. Use the next page token with the same search filter to continue.
|
|
1191
|
-
*
|
|
1192
|
-
* Operation IDs in the catalog are hints. Operation discovery returns the current
|
|
1193
|
-
* configurable fields for a schema.
|
|
1194
|
-
*
|
|
1195
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1196
|
-
* @param {string} connection_id - Source Connection whose action grants you want to manage
|
|
1197
|
-
* @param {Polytomic.HarborsListActionConfigurationSchemasRequest} request
|
|
1198
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1199
|
-
*
|
|
1200
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1201
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1202
|
-
* @throws {@link Polytomic.ConflictError}
|
|
1203
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1204
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1205
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
1206
|
-
* @throws {@link errors.PolytomicError}
|
|
1207
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1208
|
-
*
|
|
1209
|
-
* @example
|
|
1210
|
-
* await client.harbors.listActionConfigurationSchemas("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1211
|
-
* search: "search",
|
|
1212
|
-
* limit: 1,
|
|
1213
|
-
* page_token: "page_token"
|
|
1214
|
-
* })
|
|
1215
|
-
*/
|
|
1216
|
-
listActionConfigurationSchemas(harbor_id, connection_id, request = {}, requestOptions) {
|
|
1217
|
-
return core.HttpResponsePromise.fromPromise(this.__listActionConfigurationSchemas(harbor_id, connection_id, request, requestOptions));
|
|
1218
|
-
}
|
|
1219
|
-
__listActionConfigurationSchemas(harbor_id_1, connection_id_1) {
|
|
1220
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, connection_id, request = {}, requestOptions) {
|
|
1221
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1222
|
-
const { search, limit, page_token: pageToken } = request;
|
|
1223
|
-
const _queryParams = {
|
|
1224
|
-
search,
|
|
1225
|
-
limit,
|
|
1226
|
-
page_token: pageToken,
|
|
1227
|
-
};
|
|
1228
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1229
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1230
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1231
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1232
|
-
const _response = yield core.fetcher({
|
|
1233
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/action-configuration/connections/${core.url.encodePathParam(connection_id)}/schemas`),
|
|
1234
|
-
method: "GET",
|
|
1235
|
-
headers: _headers,
|
|
1236
|
-
queryString: core.url
|
|
1237
|
-
.queryBuilder()
|
|
1238
|
-
.addMany(_queryParams)
|
|
1239
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
1240
|
-
.build(),
|
|
1241
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1242
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1243
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1244
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1245
|
-
logging: this._options.logging,
|
|
1246
|
-
});
|
|
1247
|
-
if (_response.ok) {
|
|
1248
|
-
return {
|
|
1249
|
-
data: _response.body,
|
|
1250
|
-
rawResponse: _response.rawResponse,
|
|
1251
|
-
};
|
|
1252
|
-
}
|
|
1253
|
-
if (_response.error.reason === "status-code") {
|
|
1254
|
-
switch (_response.error.statusCode) {
|
|
1255
|
-
case 403:
|
|
1256
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1257
|
-
case 404:
|
|
1258
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1259
|
-
case 409:
|
|
1260
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
1261
|
-
case 422:
|
|
1262
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1263
|
-
case 500:
|
|
1264
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1265
|
-
case 503:
|
|
1266
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1267
|
-
default:
|
|
1268
|
-
throw new errors.PolytomicError({
|
|
1269
|
-
statusCode: _response.error.statusCode,
|
|
1270
|
-
body: _response.error.body,
|
|
1271
|
-
rawResponse: _response.rawResponse,
|
|
1272
|
-
});
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/action-configuration/connections/{connection_id}/schemas");
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
/**
|
|
1279
|
-
* Lists operations and configurable fields for an eligible Harbor action schema.
|
|
1280
|
-
*
|
|
1281
|
-
* You must be an Organization administrator with permission to edit the Harbor
|
|
1282
|
-
* and query the source Connection. Use a writable API credential, not a Harbor
|
|
1283
|
-
* profile credential. Read-only keys are denied because this endpoint requires
|
|
1284
|
-
* Harbor edit permission. Discovery does not require the Harbor Actions entitlement.
|
|
1285
|
-
*
|
|
1286
|
-
* The Connection must populate the Harbor through a non-deleted Bulk Sync or Model
|
|
1287
|
-
* Sync targeting its backing Connection. This request returns operation metadata,
|
|
1288
|
-
* not provider records, and does not execute an action.
|
|
1289
|
-
*
|
|
1290
|
-
* For a mutating operation, choose input field IDs. For a read-only operation,
|
|
1291
|
-
* choose output field IDs and at least one lookup field ID. Required input fields
|
|
1292
|
-
* must be included in the grant.
|
|
1293
|
-
*
|
|
1294
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1295
|
-
* @param {string} connection_id - Source Connection whose action grants you want to manage
|
|
1296
|
-
* @param {string} schema_id - Exact action schema ID returned by schema discovery
|
|
1297
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1298
|
-
*
|
|
1299
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1300
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1301
|
-
* @throws {@link Polytomic.ConflictError}
|
|
1302
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1303
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1304
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
1305
|
-
* @throws {@link errors.PolytomicError}
|
|
1306
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1307
|
-
*
|
|
1308
|
-
* @example
|
|
1309
|
-
* await client.harbors.listActionConfigurationOperations("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "schema_id")
|
|
1310
|
-
*/
|
|
1311
|
-
listActionConfigurationOperations(harbor_id, connection_id, schema_id, requestOptions) {
|
|
1312
|
-
return core.HttpResponsePromise.fromPromise(this.__listActionConfigurationOperations(harbor_id, connection_id, schema_id, requestOptions));
|
|
1313
|
-
}
|
|
1314
|
-
__listActionConfigurationOperations(harbor_id, connection_id, schema_id, requestOptions) {
|
|
1315
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1316
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1317
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1318
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1319
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1320
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1321
|
-
const _response = yield core.fetcher({
|
|
1322
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/action-configuration/connections/${core.url.encodePathParam(connection_id)}/schemas/${core.url.encodePathParam(schema_id)}/operations`),
|
|
1323
|
-
method: "GET",
|
|
1324
|
-
headers: _headers,
|
|
1325
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1326
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1327
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1328
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1329
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1330
|
-
logging: this._options.logging,
|
|
1331
|
-
});
|
|
1332
|
-
if (_response.ok) {
|
|
1333
|
-
return {
|
|
1334
|
-
data: _response.body,
|
|
1335
|
-
rawResponse: _response.rawResponse,
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
if (_response.error.reason === "status-code") {
|
|
1339
|
-
switch (_response.error.statusCode) {
|
|
1340
|
-
case 403:
|
|
1341
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1342
|
-
case 404:
|
|
1343
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1344
|
-
case 409:
|
|
1345
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
1346
|
-
case 422:
|
|
1347
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1348
|
-
case 500:
|
|
1349
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1350
|
-
case 503:
|
|
1351
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1352
|
-
default:
|
|
1353
|
-
throw new errors.PolytomicError({
|
|
1354
|
-
statusCode: _response.error.statusCode,
|
|
1355
|
-
body: _response.error.body,
|
|
1356
|
-
rawResponse: _response.rawResponse,
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/action-configuration/connections/{connection_id}/schemas/{schema_id}/operations");
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
|
-
/**
|
|
1364
|
-
* Lists context document metadata for a Harbor without returning document content.
|
|
1365
|
-
*
|
|
1366
|
-
* Collection items include the current published `version` number and omit
|
|
1367
|
-
* `content`. Use the context item endpoint to retrieve a complete document.
|
|
1368
|
-
*
|
|
1369
|
-
* A Harbor profile credential can read context only when `harbor_id` identifies
|
|
1370
|
-
* its own Harbor.
|
|
1371
|
-
*
|
|
1372
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1373
|
-
* @param {Polytomic.HarborsListContextsRequest} request
|
|
1374
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1375
|
-
*
|
|
1376
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1377
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1378
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1379
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1380
|
-
* @throws {@link errors.PolytomicError}
|
|
1381
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1382
|
-
*
|
|
1383
|
-
* @example
|
|
1384
|
-
* await client.harbors.listContexts("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1385
|
-
* limit: 50,
|
|
1386
|
-
* page_token: "page_token"
|
|
1387
|
-
* })
|
|
1388
|
-
*/
|
|
1389
|
-
listContexts(harbor_id, request = {}, requestOptions) {
|
|
1390
|
-
return core.HttpResponsePromise.fromPromise(this.__listContexts(harbor_id, request, requestOptions));
|
|
1391
|
-
}
|
|
1392
|
-
__listContexts(harbor_id_1) {
|
|
1393
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
1394
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1395
|
-
const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
1396
|
-
const _queryParams = {
|
|
1397
|
-
limit,
|
|
1398
|
-
page_token: pageToken,
|
|
1399
|
-
};
|
|
1400
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1401
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1402
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
1403
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
1404
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1405
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1406
|
-
const _response = yield core.fetcher({
|
|
1407
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts`),
|
|
1408
|
-
method: "GET",
|
|
1409
|
-
headers: _headers,
|
|
1410
|
-
queryString: core.url
|
|
1411
|
-
.queryBuilder()
|
|
1412
|
-
.addMany(_queryParams)
|
|
1413
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
1414
|
-
.build(),
|
|
1415
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1416
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1417
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1418
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1419
|
-
logging: this._options.logging,
|
|
1420
|
-
});
|
|
1421
|
-
if (_response.ok) {
|
|
1422
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1423
|
-
}
|
|
1424
|
-
if (_response.error.reason === "status-code") {
|
|
1425
|
-
switch (_response.error.statusCode) {
|
|
1426
|
-
case 403:
|
|
1427
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1428
|
-
case 404:
|
|
1429
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1430
|
-
case 422:
|
|
1431
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1432
|
-
case 500:
|
|
1433
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1434
|
-
default:
|
|
1435
|
-
throw new errors.PolytomicError({
|
|
1436
|
-
statusCode: _response.error.statusCode,
|
|
1437
|
-
body: _response.error.body,
|
|
1438
|
-
rawResponse: _response.rawResponse,
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts");
|
|
1443
|
-
});
|
|
1444
|
-
}
|
|
1445
|
-
/**
|
|
1446
|
-
* Creates and attaches a context document to a Harbor.
|
|
1447
|
-
*
|
|
1448
|
-
* The new document belongs only to this Harbor. Context documents cannot be attached to multiple Harbors.
|
|
1449
|
-
*
|
|
1450
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1451
|
-
* @param {Polytomic.CreateHarborContextRequest} request
|
|
1452
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1453
|
-
*
|
|
1454
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1455
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1456
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1457
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1458
|
-
* @throws {@link errors.PolytomicError}
|
|
1459
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1460
|
-
*
|
|
1461
|
-
* @example
|
|
1462
|
-
* await client.harbors.createContext("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1463
|
-
* content: "Bookings use the contract signed date...",
|
|
1464
|
-
* title: "Revenue definitions"
|
|
1465
|
-
* })
|
|
1466
|
-
*/
|
|
1467
|
-
createContext(harbor_id, request, requestOptions) {
|
|
1468
|
-
return core.HttpResponsePromise.fromPromise(this.__createContext(harbor_id, request, requestOptions));
|
|
1469
|
-
}
|
|
1470
|
-
__createContext(harbor_id, request, requestOptions) {
|
|
1471
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1472
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1473
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1474
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1475
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1476
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1477
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1478
|
-
const _response = yield core.fetcher({
|
|
1479
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts`),
|
|
1480
|
-
method: "POST",
|
|
1481
|
-
headers: _headers,
|
|
1482
|
-
contentType: "application/json",
|
|
1483
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1484
|
-
requestType: "json",
|
|
1485
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
1486
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1487
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1488
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1489
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1490
|
-
logging: this._options.logging,
|
|
1491
|
-
});
|
|
1492
|
-
if (_response.ok) {
|
|
1493
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1494
|
-
}
|
|
1495
|
-
if (_response.error.reason === "status-code") {
|
|
1496
|
-
switch (_response.error.statusCode) {
|
|
1497
|
-
case 403:
|
|
1498
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1499
|
-
case 404:
|
|
1500
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1501
|
-
case 422:
|
|
1502
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1503
|
-
case 500:
|
|
1504
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1505
|
-
default:
|
|
1506
|
-
throw new errors.PolytomicError({
|
|
1507
|
-
statusCode: _response.error.statusCode,
|
|
1508
|
-
body: _response.error.body,
|
|
1509
|
-
rawResponse: _response.rawResponse,
|
|
1510
|
-
});
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts");
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
/**
|
|
1517
|
-
* Lists mutable Harbor context drafts without returning document content.
|
|
1518
|
-
*
|
|
1519
|
-
* The collection includes drafts for published context documents and initial drafts
|
|
1520
|
-
* that have not yet been published. Use `context_id` with the draft detail,
|
|
1521
|
-
* replacement, promotion, and discard endpoints.
|
|
1522
|
-
*
|
|
1523
|
-
* Draft metadata does not include `content`. Fetch a selected draft through its
|
|
1524
|
-
* detail endpoint to read the complete candidate. Normal context list and detail
|
|
1525
|
-
* operations continue to return published content only.
|
|
1526
|
-
*
|
|
1527
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1528
|
-
* @param {Polytomic.HarborsListContextDraftsRequest} request
|
|
1529
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1530
|
-
*
|
|
1531
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1532
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1533
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1534
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1535
|
-
* @throws {@link errors.PolytomicError}
|
|
1536
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1537
|
-
*
|
|
1538
|
-
* @example
|
|
1539
|
-
* await client.harbors.listContextDrafts("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1540
|
-
* limit: 50,
|
|
1541
|
-
* page_token: "page_token"
|
|
1542
|
-
* })
|
|
1543
|
-
*/
|
|
1544
|
-
listContextDrafts(harbor_id, request = {}, requestOptions) {
|
|
1545
|
-
return core.HttpResponsePromise.fromPromise(this.__listContextDrafts(harbor_id, request, requestOptions));
|
|
1546
|
-
}
|
|
1547
|
-
__listContextDrafts(harbor_id_1) {
|
|
1548
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
1549
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1550
|
-
const { limit, page_token: pageToken } = request;
|
|
1551
|
-
const _queryParams = {
|
|
1552
|
-
limit,
|
|
1553
|
-
page_token: pageToken,
|
|
1554
|
-
};
|
|
1555
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1556
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1557
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1558
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1559
|
-
const _response = yield core.fetcher({
|
|
1560
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/drafts`),
|
|
1561
|
-
method: "GET",
|
|
1562
|
-
headers: _headers,
|
|
1563
|
-
queryString: core.url
|
|
1564
|
-
.queryBuilder()
|
|
1565
|
-
.addMany(_queryParams)
|
|
1566
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
1567
|
-
.build(),
|
|
1568
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1569
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1570
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1571
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1572
|
-
logging: this._options.logging,
|
|
1573
|
-
});
|
|
1574
|
-
if (_response.ok) {
|
|
1575
|
-
return {
|
|
1576
|
-
data: _response.body,
|
|
1577
|
-
rawResponse: _response.rawResponse,
|
|
1578
|
-
};
|
|
1579
|
-
}
|
|
1580
|
-
if (_response.error.reason === "status-code") {
|
|
1581
|
-
switch (_response.error.statusCode) {
|
|
1582
|
-
case 403:
|
|
1583
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1584
|
-
case 404:
|
|
1585
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1586
|
-
case 422:
|
|
1587
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1588
|
-
case 500:
|
|
1589
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1590
|
-
default:
|
|
1591
|
-
throw new errors.PolytomicError({
|
|
1592
|
-
statusCode: _response.error.statusCode,
|
|
1593
|
-
body: _response.error.body,
|
|
1594
|
-
rawResponse: _response.rawResponse,
|
|
1595
|
-
});
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/drafts");
|
|
1599
|
-
});
|
|
1600
|
-
}
|
|
1601
|
-
/**
|
|
1602
|
-
* Creates an unpublished context document with its initial mutable draft.
|
|
1603
|
-
*
|
|
1604
|
-
* Creates a stable context identity and its initial mutable draft without publishing
|
|
1605
|
-
* content to the Harbor. The response includes `context_id`, which identifies the
|
|
1606
|
-
* draft replacement, promotion, and discard routes.
|
|
1607
|
-
*
|
|
1608
|
-
* The initial draft has a null `base_revision_id`. It remains absent from normal
|
|
1609
|
-
* context list/detail, GraphQL, entity lookup, and Harbor MCP reads until promoted.
|
|
1610
|
-
* Use the regular context creation endpoint instead when the initial payload should
|
|
1611
|
-
* be published immediately.
|
|
1612
|
-
*
|
|
1613
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1614
|
-
* @param {Polytomic.CreateHarborContextDraftRequest} request
|
|
1615
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1616
|
-
*
|
|
1617
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1618
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1619
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1620
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1621
|
-
* @throws {@link errors.PolytomicError}
|
|
1622
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1623
|
-
*
|
|
1624
|
-
* @example
|
|
1625
|
-
* await client.harbors.createContextDraft("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1626
|
-
* content: "Bookings use the contract signed date...",
|
|
1627
|
-
* title: "Revenue definitions"
|
|
1628
|
-
* })
|
|
1629
|
-
*/
|
|
1630
|
-
createContextDraft(harbor_id, request, requestOptions) {
|
|
1631
|
-
return core.HttpResponsePromise.fromPromise(this.__createContextDraft(harbor_id, request, requestOptions));
|
|
1632
|
-
}
|
|
1633
|
-
__createContextDraft(harbor_id, request, requestOptions) {
|
|
1634
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1635
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1636
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1637
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1638
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1639
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1640
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1641
|
-
const _response = yield core.fetcher({
|
|
1642
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/drafts`),
|
|
1643
|
-
method: "POST",
|
|
1644
|
-
headers: _headers,
|
|
1645
|
-
contentType: "application/json",
|
|
1646
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1647
|
-
requestType: "json",
|
|
1648
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
1649
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1650
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1651
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1652
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1653
|
-
logging: this._options.logging,
|
|
1654
|
-
});
|
|
1655
|
-
if (_response.ok) {
|
|
1656
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1657
|
-
}
|
|
1658
|
-
if (_response.error.reason === "status-code") {
|
|
1659
|
-
switch (_response.error.statusCode) {
|
|
1660
|
-
case 403:
|
|
1661
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1662
|
-
case 404:
|
|
1663
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1664
|
-
case 422:
|
|
1665
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1666
|
-
case 500:
|
|
1667
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1668
|
-
default:
|
|
1669
|
-
throw new errors.PolytomicError({
|
|
1670
|
-
statusCode: _response.error.statusCode,
|
|
1671
|
-
body: _response.error.body,
|
|
1672
|
-
rawResponse: _response.rawResponse,
|
|
1673
|
-
});
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts/drafts");
|
|
1677
|
-
});
|
|
1678
|
-
}
|
|
1679
|
-
/**
|
|
1680
|
-
* Returns one complete Harbor context document.
|
|
1681
|
-
*
|
|
1682
|
-
* The response includes the current published `version` number and complete
|
|
1683
|
-
* plain-text `content`.
|
|
1684
|
-
*
|
|
1685
|
-
* A Harbor profile credential can read context only when `harbor_id` identifies
|
|
1686
|
-
* its own Harbor.
|
|
1687
|
-
*
|
|
1688
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1689
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
1690
|
-
* @param {Polytomic.HarborsGetContextRequest} request
|
|
1691
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1692
|
-
*
|
|
1693
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1694
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1695
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1696
|
-
* @throws {@link errors.PolytomicError}
|
|
1697
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1698
|
-
*
|
|
1699
|
-
* @example
|
|
1700
|
-
* await client.harbors.getContext("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1701
|
-
*/
|
|
1702
|
-
getContext(harbor_id, context_id, request = {}, requestOptions) {
|
|
1703
|
-
return core.HttpResponsePromise.fromPromise(this.__getContext(harbor_id, context_id, request, requestOptions));
|
|
1704
|
-
}
|
|
1705
|
-
__getContext(harbor_id_1, context_id_1) {
|
|
1706
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
1707
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1708
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
1709
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1710
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1711
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
1712
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
1713
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1714
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1715
|
-
const _response = yield core.fetcher({
|
|
1716
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
|
|
1717
|
-
method: "GET",
|
|
1718
|
-
headers: _headers,
|
|
1719
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1720
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1721
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1722
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1723
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1724
|
-
logging: this._options.logging,
|
|
1725
|
-
});
|
|
1726
|
-
if (_response.ok) {
|
|
1727
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1728
|
-
}
|
|
1729
|
-
if (_response.error.reason === "status-code") {
|
|
1730
|
-
switch (_response.error.statusCode) {
|
|
1731
|
-
case 403:
|
|
1732
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1733
|
-
case 404:
|
|
1734
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1735
|
-
case 500:
|
|
1736
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1737
|
-
default:
|
|
1738
|
-
throw new errors.PolytomicError({
|
|
1739
|
-
statusCode: _response.error.statusCode,
|
|
1740
|
-
body: _response.error.body,
|
|
1741
|
-
rawResponse: _response.rawResponse,
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}");
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
/**
|
|
1749
|
-
* Replaces one Harbor context document.
|
|
1750
|
-
*
|
|
1751
|
-
* Each successful request publishes the next immutable version. You can omit
|
|
1752
|
-
* `change_note`.
|
|
1753
|
-
*
|
|
1754
|
-
* A direct publication leaves an existing draft unchanged.
|
|
1755
|
-
*
|
|
1756
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1757
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
1758
|
-
* @param {Polytomic.SaveHarborContextRequest} request
|
|
1759
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1760
|
-
*
|
|
1761
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1762
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1763
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1764
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1765
|
-
* @throws {@link errors.PolytomicError}
|
|
1766
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1767
|
-
*
|
|
1768
|
-
* @example
|
|
1769
|
-
* await client.harbors.updateContext("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1770
|
-
* content: "Bookings use the contract signed date...",
|
|
1771
|
-
* title: "Revenue definitions"
|
|
1772
|
-
* })
|
|
1773
|
-
*/
|
|
1774
|
-
updateContext(harbor_id, context_id, request, requestOptions) {
|
|
1775
|
-
return core.HttpResponsePromise.fromPromise(this.__updateContext(harbor_id, context_id, request, requestOptions));
|
|
1776
|
-
}
|
|
1777
|
-
__updateContext(harbor_id, context_id, request, requestOptions) {
|
|
1778
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1779
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1780
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
|
|
1781
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1782
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1783
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
1784
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
1785
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1786
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1787
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1788
|
-
const _response = yield core.fetcher({
|
|
1789
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
|
|
1790
|
-
method: "PUT",
|
|
1791
|
-
headers: _headers,
|
|
1792
|
-
contentType: "application/json",
|
|
1793
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1794
|
-
requestType: "json",
|
|
1795
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
1796
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1797
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1798
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1799
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1800
|
-
logging: this._options.logging,
|
|
1801
|
-
});
|
|
1802
|
-
if (_response.ok) {
|
|
1803
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1804
|
-
}
|
|
1805
|
-
if (_response.error.reason === "status-code") {
|
|
1806
|
-
switch (_response.error.statusCode) {
|
|
1807
|
-
case 403:
|
|
1808
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1809
|
-
case 404:
|
|
1810
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1811
|
-
case 422:
|
|
1812
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1813
|
-
case 500:
|
|
1814
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1815
|
-
default:
|
|
1816
|
-
throw new errors.PolytomicError({
|
|
1817
|
-
statusCode: _response.error.statusCode,
|
|
1818
|
-
body: _response.error.body,
|
|
1819
|
-
rawResponse: _response.rawResponse,
|
|
1820
|
-
});
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/contexts/{context_id}");
|
|
1824
|
-
});
|
|
1825
|
-
}
|
|
1826
|
-
/**
|
|
1827
|
-
* Deletes one context document from a Harbor.
|
|
1828
|
-
*
|
|
1829
|
-
* Deleting a context document does not affect the Harbor or its other context documents.
|
|
1830
|
-
*
|
|
1831
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1832
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
1833
|
-
* @param {Polytomic.HarborsDeleteContextRequest} request
|
|
1834
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1835
|
-
*
|
|
1836
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1837
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1838
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1839
|
-
* @throws {@link errors.PolytomicError}
|
|
1840
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1841
|
-
*
|
|
1842
|
-
* @example
|
|
1843
|
-
* await client.harbors.deleteContext("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1844
|
-
*/
|
|
1845
|
-
deleteContext(harbor_id, context_id, request = {}, requestOptions) {
|
|
1846
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteContext(harbor_id, context_id, request, requestOptions));
|
|
1847
|
-
}
|
|
1848
|
-
__deleteContext(harbor_id_1, context_id_1) {
|
|
1849
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
1850
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1851
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
1852
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1853
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1854
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
1855
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
1856
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
1857
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1858
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1859
|
-
const _response = yield core.fetcher({
|
|
1860
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}`),
|
|
1861
|
-
method: "DELETE",
|
|
1862
|
-
headers: _headers,
|
|
1863
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1864
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1865
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1866
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1867
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1868
|
-
logging: this._options.logging,
|
|
1869
|
-
});
|
|
1870
|
-
if (_response.ok) {
|
|
1871
|
-
return {
|
|
1872
|
-
data: _response.body,
|
|
1873
|
-
rawResponse: _response.rawResponse,
|
|
1874
|
-
};
|
|
1875
|
-
}
|
|
1876
|
-
if (_response.error.reason === "status-code") {
|
|
1877
|
-
switch (_response.error.statusCode) {
|
|
1878
|
-
case 403:
|
|
1879
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1880
|
-
case 404:
|
|
1881
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1882
|
-
case 500:
|
|
1883
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1884
|
-
default:
|
|
1885
|
-
throw new errors.PolytomicError({
|
|
1886
|
-
statusCode: _response.error.statusCode,
|
|
1887
|
-
body: _response.error.body,
|
|
1888
|
-
rawResponse: _response.rawResponse,
|
|
1889
|
-
});
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/contexts/{context_id}");
|
|
1893
|
-
});
|
|
1894
|
-
}
|
|
1895
|
-
/**
|
|
1896
|
-
* Returns the mutable draft for a Harbor context document.
|
|
1897
|
-
*
|
|
1898
|
-
* Drafts are available only through the draft endpoints. `base_revision_id`
|
|
1899
|
-
* identifies the published revision from which the candidate was created. Normal
|
|
1900
|
-
* context reads and Harbor MCP tools continue to return the current published
|
|
1901
|
-
* version. Creator and updater IDs are null when their actor type is `system`.
|
|
1902
|
-
*
|
|
1903
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1904
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
1905
|
-
* @param {Polytomic.HarborsGetContextDraftRequest} request
|
|
1906
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1907
|
-
*
|
|
1908
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1909
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1910
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1911
|
-
* @throws {@link errors.PolytomicError}
|
|
1912
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1913
|
-
*
|
|
1914
|
-
* @example
|
|
1915
|
-
* await client.harbors.getContextDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1916
|
-
*/
|
|
1917
|
-
getContextDraft(harbor_id, context_id, request = {}, requestOptions) {
|
|
1918
|
-
return core.HttpResponsePromise.fromPromise(this.__getContextDraft(harbor_id, context_id, request, requestOptions));
|
|
1919
|
-
}
|
|
1920
|
-
__getContextDraft(harbor_id_1, context_id_1) {
|
|
1921
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
1922
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1923
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
1924
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1925
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
1926
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
1927
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
1928
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
1929
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1930
|
-
const _response = yield core.fetcher({
|
|
1931
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
|
|
1932
|
-
method: "GET",
|
|
1933
|
-
headers: _headers,
|
|
1934
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
1935
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1936
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1937
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1938
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1939
|
-
logging: this._options.logging,
|
|
1940
|
-
});
|
|
1941
|
-
if (_response.ok) {
|
|
1942
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1943
|
-
}
|
|
1944
|
-
if (_response.error.reason === "status-code") {
|
|
1945
|
-
switch (_response.error.statusCode) {
|
|
1946
|
-
case 403:
|
|
1947
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1948
|
-
case 404:
|
|
1949
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1950
|
-
case 500:
|
|
1951
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1952
|
-
default:
|
|
1953
|
-
throw new errors.PolytomicError({
|
|
1954
|
-
statusCode: _response.error.statusCode,
|
|
1955
|
-
body: _response.error.body,
|
|
1956
|
-
rawResponse: _response.rawResponse,
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
|
|
1961
|
-
});
|
|
1962
|
-
}
|
|
1963
|
-
/**
|
|
1964
|
-
* Creates or completely replaces the mutable draft for a Harbor context document.
|
|
1965
|
-
*
|
|
1966
|
-
* The request supplies the complete draft payload. If a draft already exists,
|
|
1967
|
-
* this request replaces it while preserving the draft ID, creation metadata, and
|
|
1968
|
-
* `base_revision_id`.
|
|
1969
|
-
*
|
|
1970
|
-
* A new draft for a published document records the current revision as its base.
|
|
1971
|
-
* An unpublished document's initial draft keeps a null base when replaced. Saving
|
|
1972
|
-
* a draft does not change published content or its `updated_at`. Creator and
|
|
1973
|
-
* updater provenance comes from the request actor; system actors have a null actor
|
|
1974
|
-
* ID.
|
|
1975
|
-
*
|
|
1976
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
1977
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
1978
|
-
* @param {Polytomic.SaveHarborContextDraftRequest} request
|
|
1979
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
1980
|
-
*
|
|
1981
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
1982
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
1983
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1984
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
1985
|
-
* @throws {@link errors.PolytomicError}
|
|
1986
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
1987
|
-
*
|
|
1988
|
-
* @example
|
|
1989
|
-
* await client.harbors.saveContextDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
1990
|
-
* content: "Bookings use the contract signed date...",
|
|
1991
|
-
* title: "Revenue definitions"
|
|
1992
|
-
* })
|
|
1993
|
-
*/
|
|
1994
|
-
saveContextDraft(harbor_id, context_id, request, requestOptions) {
|
|
1995
|
-
return core.HttpResponsePromise.fromPromise(this.__saveContextDraft(harbor_id, context_id, request, requestOptions));
|
|
1996
|
-
}
|
|
1997
|
-
__saveContextDraft(harbor_id, context_id, request, requestOptions) {
|
|
1998
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1999
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2000
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
|
|
2001
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2002
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2003
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2004
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2005
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2006
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2007
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2008
|
-
const _response = yield core.fetcher({
|
|
2009
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
|
|
2010
|
-
method: "PUT",
|
|
2011
|
-
headers: _headers,
|
|
2012
|
-
contentType: "application/json",
|
|
2013
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2014
|
-
requestType: "json",
|
|
2015
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
2016
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2017
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2018
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2019
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2020
|
-
logging: this._options.logging,
|
|
2021
|
-
});
|
|
2022
|
-
if (_response.ok) {
|
|
2023
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2024
|
-
}
|
|
2025
|
-
if (_response.error.reason === "status-code") {
|
|
2026
|
-
switch (_response.error.statusCode) {
|
|
2027
|
-
case 403:
|
|
2028
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2029
|
-
case 404:
|
|
2030
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2031
|
-
case 422:
|
|
2032
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2033
|
-
case 500:
|
|
2034
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2035
|
-
default:
|
|
2036
|
-
throw new errors.PolytomicError({
|
|
2037
|
-
statusCode: _response.error.statusCode,
|
|
2038
|
-
body: _response.error.body,
|
|
2039
|
-
rawResponse: _response.rawResponse,
|
|
2040
|
-
});
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
|
|
2044
|
-
});
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Discards the mutable draft for a Harbor context document.
|
|
2048
|
-
*
|
|
2049
|
-
* Discarding a draft does not change the current published version or its
|
|
2050
|
-
* history. If the draft belongs to a context that has never been published,
|
|
2051
|
-
* discarding it also removes the otherwise empty context identity.
|
|
2052
|
-
*
|
|
2053
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2054
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
2055
|
-
* @param {Polytomic.HarborsDeleteContextDraftRequest} request
|
|
2056
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2057
|
-
*
|
|
2058
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2059
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2060
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2061
|
-
* @throws {@link errors.PolytomicError}
|
|
2062
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2063
|
-
*
|
|
2064
|
-
* @example
|
|
2065
|
-
* await client.harbors.deleteContextDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2066
|
-
*/
|
|
2067
|
-
deleteContextDraft(harbor_id, context_id, request = {}, requestOptions) {
|
|
2068
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteContextDraft(harbor_id, context_id, request, requestOptions));
|
|
2069
|
-
}
|
|
2070
|
-
__deleteContextDraft(harbor_id_1, context_id_1) {
|
|
2071
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
2072
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2073
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2074
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2075
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2076
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2077
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2078
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2079
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2080
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2081
|
-
const _response = yield core.fetcher({
|
|
2082
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft`),
|
|
2083
|
-
method: "DELETE",
|
|
2084
|
-
headers: _headers,
|
|
2085
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2086
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2087
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2088
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2089
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2090
|
-
logging: this._options.logging,
|
|
2091
|
-
});
|
|
2092
|
-
if (_response.ok) {
|
|
2093
|
-
return {
|
|
2094
|
-
data: _response.body,
|
|
2095
|
-
rawResponse: _response.rawResponse,
|
|
2096
|
-
};
|
|
2097
|
-
}
|
|
2098
|
-
if (_response.error.reason === "status-code") {
|
|
2099
|
-
switch (_response.error.statusCode) {
|
|
2100
|
-
case 403:
|
|
2101
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2102
|
-
case 404:
|
|
2103
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2104
|
-
case 500:
|
|
2105
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2106
|
-
default:
|
|
2107
|
-
throw new errors.PolytomicError({
|
|
2108
|
-
statusCode: _response.error.statusCode,
|
|
2109
|
-
body: _response.error.body,
|
|
2110
|
-
rawResponse: _response.rawResponse,
|
|
2111
|
-
});
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/contexts/{context_id}/draft");
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
/**
|
|
2118
|
-
* Promotes the draft to the next immutable published context version.
|
|
2119
|
-
*
|
|
2120
|
-
* Promotion publishes the draft's exact title, description, content, and optional
|
|
2121
|
-
* change note as the next version. An unpublished context's initial draft becomes
|
|
2122
|
-
* version 1. The draft is removed after publication.
|
|
2123
|
-
*
|
|
2124
|
-
* Promotion returns a conflict when the current published revision differs from
|
|
2125
|
-
* the draft's `base_revision_id`. The stale draft remains available so an author
|
|
2126
|
-
* can compare it with the current version before discarding and recreating it.
|
|
2127
|
-
*
|
|
2128
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2129
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
2130
|
-
* @param {Polytomic.HarborsPromoteContextDraftRequest} request
|
|
2131
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2132
|
-
*
|
|
2133
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2134
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2135
|
-
* @throws {@link Polytomic.ConflictError}
|
|
2136
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2137
|
-
* @throws {@link errors.PolytomicError}
|
|
2138
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2139
|
-
*
|
|
2140
|
-
* @example
|
|
2141
|
-
* await client.harbors.promoteContextDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2142
|
-
*/
|
|
2143
|
-
promoteContextDraft(harbor_id, context_id, request = {}, requestOptions) {
|
|
2144
|
-
return core.HttpResponsePromise.fromPromise(this.__promoteContextDraft(harbor_id, context_id, request, requestOptions));
|
|
2145
|
-
}
|
|
2146
|
-
__promoteContextDraft(harbor_id_1, context_id_1) {
|
|
2147
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
2148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2149
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2150
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2151
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2152
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2153
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2154
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2155
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2156
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2157
|
-
const _response = yield core.fetcher({
|
|
2158
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/draft/promote`),
|
|
2159
|
-
method: "POST",
|
|
2160
|
-
headers: _headers,
|
|
2161
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2162
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2163
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2164
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2165
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2166
|
-
logging: this._options.logging,
|
|
2167
|
-
});
|
|
2168
|
-
if (_response.ok) {
|
|
2169
|
-
return {
|
|
2170
|
-
data: _response.body,
|
|
2171
|
-
rawResponse: _response.rawResponse,
|
|
2172
|
-
};
|
|
2173
|
-
}
|
|
2174
|
-
if (_response.error.reason === "status-code") {
|
|
2175
|
-
switch (_response.error.statusCode) {
|
|
2176
|
-
case 403:
|
|
2177
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2178
|
-
case 404:
|
|
2179
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2180
|
-
case 409:
|
|
2181
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
2182
|
-
case 500:
|
|
2183
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2184
|
-
default:
|
|
2185
|
-
throw new errors.PolytomicError({
|
|
2186
|
-
statusCode: _response.error.statusCode,
|
|
2187
|
-
body: _response.error.body,
|
|
2188
|
-
rawResponse: _response.rawResponse,
|
|
2189
|
-
});
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/contexts/{context_id}/draft/promote");
|
|
2193
|
-
});
|
|
2194
|
-
}
|
|
2195
|
-
/**
|
|
2196
|
-
* Lists immutable published versions of a Harbor context document without returning content.
|
|
2197
|
-
*
|
|
2198
|
-
* Versions are ordered from newest to oldest. Collection items omit `content`,
|
|
2199
|
-
* and the draft is never included. Pagination tokens continue from the last
|
|
2200
|
-
* returned version, so publishing a newer version between requests does not shift
|
|
2201
|
-
* or duplicate older results.
|
|
2202
|
-
*
|
|
2203
|
-
* Published revision IDs are durable artifact identities intended for future
|
|
2204
|
-
* Harbor activity and audit records. Publisher IDs are paired with actor types.
|
|
2205
|
-
* System publications have `published_by_type: "system"` and a null
|
|
2206
|
-
* `published_by` because the system actor has no UUID.
|
|
2207
|
-
*
|
|
2208
|
-
* A Harbor profile credential can read versions only when `harbor_id` identifies
|
|
2209
|
-
* its own Harbor.
|
|
2210
|
-
*
|
|
2211
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2212
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
2213
|
-
* @param {Polytomic.HarborsListContextVersionsRequest} request
|
|
2214
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2215
|
-
*
|
|
2216
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2217
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2218
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2219
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2220
|
-
* @throws {@link errors.PolytomicError}
|
|
2221
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2222
|
-
*
|
|
2223
|
-
* @example
|
|
2224
|
-
* await client.harbors.listContextVersions("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2225
|
-
* limit: 50,
|
|
2226
|
-
* page_token: "page_token"
|
|
2227
|
-
* })
|
|
2228
|
-
*/
|
|
2229
|
-
listContextVersions(harbor_id, context_id, request = {}, requestOptions) {
|
|
2230
|
-
return core.HttpResponsePromise.fromPromise(this.__listContextVersions(harbor_id, context_id, request, requestOptions));
|
|
2231
|
-
}
|
|
2232
|
-
__listContextVersions(harbor_id_1, context_id_1) {
|
|
2233
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, request = {}, requestOptions) {
|
|
2234
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2235
|
-
const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2236
|
-
const _queryParams = {
|
|
2237
|
-
limit,
|
|
2238
|
-
page_token: pageToken,
|
|
2239
|
-
};
|
|
2240
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2241
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2242
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2243
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2244
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2245
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2246
|
-
const _response = yield core.fetcher({
|
|
2247
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/versions`),
|
|
2248
|
-
method: "GET",
|
|
2249
|
-
headers: _headers,
|
|
2250
|
-
queryString: core.url
|
|
2251
|
-
.queryBuilder()
|
|
2252
|
-
.addMany(_queryParams)
|
|
2253
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
2254
|
-
.build(),
|
|
2255
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2256
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2257
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2258
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2259
|
-
logging: this._options.logging,
|
|
2260
|
-
});
|
|
2261
|
-
if (_response.ok) {
|
|
2262
|
-
return {
|
|
2263
|
-
data: _response.body,
|
|
2264
|
-
rawResponse: _response.rawResponse,
|
|
2265
|
-
};
|
|
2266
|
-
}
|
|
2267
|
-
if (_response.error.reason === "status-code") {
|
|
2268
|
-
switch (_response.error.statusCode) {
|
|
2269
|
-
case 403:
|
|
2270
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2271
|
-
case 404:
|
|
2272
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2273
|
-
case 422:
|
|
2274
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2275
|
-
case 500:
|
|
2276
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2277
|
-
default:
|
|
2278
|
-
throw new errors.PolytomicError({
|
|
2279
|
-
statusCode: _response.error.statusCode,
|
|
2280
|
-
body: _response.error.body,
|
|
2281
|
-
rawResponse: _response.rawResponse,
|
|
2282
|
-
});
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/versions");
|
|
2286
|
-
});
|
|
2287
|
-
}
|
|
2288
|
-
/**
|
|
2289
|
-
* Returns one immutable published version of a Harbor context document.
|
|
2290
|
-
*
|
|
2291
|
-
* The response includes the complete title, description, and plain-text
|
|
2292
|
-
* `content` captured when the version was published.
|
|
2293
|
-
*
|
|
2294
|
-
* Published versions cannot be changed or deleted. System publications have
|
|
2295
|
-
* `published_by_type: "system"` and a null `published_by`.
|
|
2296
|
-
*
|
|
2297
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2298
|
-
* @param {string} context_id - Unique identifier of the context document
|
|
2299
|
-
* @param {string} version_id - Unique identifier of the published context version
|
|
2300
|
-
* @param {Polytomic.HarborsGetContextVersionRequest} request
|
|
2301
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2302
|
-
*
|
|
2303
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2304
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2305
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2306
|
-
* @throws {@link errors.PolytomicError}
|
|
2307
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2308
|
-
*
|
|
2309
|
-
* @example
|
|
2310
|
-
* await client.harbors.getContextVersion("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2311
|
-
*/
|
|
2312
|
-
getContextVersion(harbor_id, context_id, version_id, request = {}, requestOptions) {
|
|
2313
|
-
return core.HttpResponsePromise.fromPromise(this.__getContextVersion(harbor_id, context_id, version_id, request, requestOptions));
|
|
2314
|
-
}
|
|
2315
|
-
__getContextVersion(harbor_id_1, context_id_1, version_id_1) {
|
|
2316
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, context_id, version_id, request = {}, requestOptions) {
|
|
2317
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2318
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2319
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2320
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2321
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2322
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2323
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2324
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2325
|
-
const _response = yield core.fetcher({
|
|
2326
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/contexts/${core.url.encodePathParam(context_id)}/versions/${core.url.encodePathParam(version_id)}`),
|
|
2327
|
-
method: "GET",
|
|
2328
|
-
headers: _headers,
|
|
2329
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2330
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2331
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2332
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2333
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2334
|
-
logging: this._options.logging,
|
|
2335
|
-
});
|
|
2336
|
-
if (_response.ok) {
|
|
2337
|
-
return {
|
|
2338
|
-
data: _response.body,
|
|
2339
|
-
rawResponse: _response.rawResponse,
|
|
2340
|
-
};
|
|
2341
|
-
}
|
|
2342
|
-
if (_response.error.reason === "status-code") {
|
|
2343
|
-
switch (_response.error.statusCode) {
|
|
2344
|
-
case 403:
|
|
2345
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2346
|
-
case 404:
|
|
2347
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2348
|
-
case 500:
|
|
2349
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2350
|
-
default:
|
|
2351
|
-
throw new errors.PolytomicError({
|
|
2352
|
-
statusCode: _response.error.statusCode,
|
|
2353
|
-
body: _response.error.body,
|
|
2354
|
-
rawResponse: _response.rawResponse,
|
|
2355
|
-
});
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/contexts/{context_id}/versions/{version_id}");
|
|
2359
|
-
});
|
|
2360
|
-
}
|
|
2361
|
-
/**
|
|
2362
|
-
* Lists active masked credentials for a Harbor.
|
|
2363
|
-
*
|
|
2364
|
-
* Each item contains a masked `key_hint`. Polytomic never returns a credential plaintext after creation.
|
|
2365
|
-
*
|
|
2366
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2367
|
-
* @param {Polytomic.HarborsListKeysRequest} request
|
|
2368
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2369
|
-
*
|
|
2370
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2371
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2372
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2373
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2374
|
-
* @throws {@link errors.PolytomicError}
|
|
2375
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2376
|
-
*
|
|
2377
|
-
* @example
|
|
2378
|
-
* await client.harbors.listKeys("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2379
|
-
* limit: 50,
|
|
2380
|
-
* page_token: "page_token"
|
|
2381
|
-
* })
|
|
2382
|
-
*/
|
|
2383
|
-
listKeys(harbor_id, request = {}, requestOptions) {
|
|
2384
|
-
return core.HttpResponsePromise.fromPromise(this.__listKeys(harbor_id, request, requestOptions));
|
|
2385
|
-
}
|
|
2386
|
-
__listKeys(harbor_id_1) {
|
|
2387
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
2388
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2389
|
-
const { limit, page_token: pageToken } = request;
|
|
2390
|
-
const _queryParams = {
|
|
2391
|
-
limit,
|
|
2392
|
-
page_token: pageToken,
|
|
2393
|
-
};
|
|
2394
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2395
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2396
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2397
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2398
|
-
const _response = yield core.fetcher({
|
|
2399
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/keys`),
|
|
2400
|
-
method: "GET",
|
|
2401
|
-
headers: _headers,
|
|
2402
|
-
queryString: core.url
|
|
2403
|
-
.queryBuilder()
|
|
2404
|
-
.addMany(_queryParams)
|
|
2405
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
2406
|
-
.build(),
|
|
2407
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2408
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2409
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2410
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2411
|
-
logging: this._options.logging,
|
|
2412
|
-
});
|
|
2413
|
-
if (_response.ok) {
|
|
2414
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2415
|
-
}
|
|
2416
|
-
if (_response.error.reason === "status-code") {
|
|
2417
|
-
switch (_response.error.statusCode) {
|
|
2418
|
-
case 403:
|
|
2419
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2420
|
-
case 404:
|
|
2421
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2422
|
-
case 422:
|
|
2423
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2424
|
-
case 500:
|
|
2425
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2426
|
-
default:
|
|
2427
|
-
throw new errors.PolytomicError({
|
|
2428
|
-
statusCode: _response.error.statusCode,
|
|
2429
|
-
body: _response.error.body,
|
|
2430
|
-
rawResponse: _response.rawResponse,
|
|
2431
|
-
});
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/keys");
|
|
2435
|
-
});
|
|
2436
|
-
}
|
|
2437
|
-
/**
|
|
2438
|
-
* Generates a new Harbor credential and returns its plaintext value once.
|
|
2439
|
-
*
|
|
2440
|
-
* Store the returned `value` securely. Polytomic returns it only in this response.
|
|
2441
|
-
*
|
|
2442
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2443
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2444
|
-
*
|
|
2445
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2446
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2447
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2448
|
-
* @throws {@link errors.PolytomicError}
|
|
2449
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2450
|
-
*
|
|
2451
|
-
* @example
|
|
2452
|
-
* await client.harbors.createKey("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2453
|
-
*/
|
|
2454
|
-
createKey(harbor_id, requestOptions) {
|
|
2455
|
-
return core.HttpResponsePromise.fromPromise(this.__createKey(harbor_id, requestOptions));
|
|
2456
|
-
}
|
|
2457
|
-
__createKey(harbor_id, requestOptions) {
|
|
2458
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2459
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2460
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2461
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2462
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2463
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2464
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2465
|
-
const _response = yield core.fetcher({
|
|
2466
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/keys`),
|
|
2467
|
-
method: "POST",
|
|
2468
|
-
headers: _headers,
|
|
2469
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2470
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2471
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2472
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2473
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2474
|
-
logging: this._options.logging,
|
|
2475
|
-
});
|
|
2476
|
-
if (_response.ok) {
|
|
2477
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2478
|
-
}
|
|
2479
|
-
if (_response.error.reason === "status-code") {
|
|
2480
|
-
switch (_response.error.statusCode) {
|
|
2481
|
-
case 403:
|
|
2482
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2483
|
-
case 404:
|
|
2484
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2485
|
-
case 500:
|
|
2486
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2487
|
-
default:
|
|
2488
|
-
throw new errors.PolytomicError({
|
|
2489
|
-
statusCode: _response.error.statusCode,
|
|
2490
|
-
body: _response.error.body,
|
|
2491
|
-
rawResponse: _response.rawResponse,
|
|
2492
|
-
});
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/keys");
|
|
2496
|
-
});
|
|
2497
|
-
}
|
|
2498
|
-
/**
|
|
2499
|
-
* Revokes one Harbor credential by its credential ID.
|
|
2500
|
-
*
|
|
2501
|
-
* Revocation affects only the selected credential. Other active Harbor credentials remain valid.
|
|
2502
|
-
*
|
|
2503
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2504
|
-
* @param {string} key_id - Unique identifier of the Harbor credential
|
|
2505
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2506
|
-
*
|
|
2507
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2508
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2509
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2510
|
-
* @throws {@link errors.PolytomicError}
|
|
2511
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2512
|
-
*
|
|
2513
|
-
* @example
|
|
2514
|
-
* await client.harbors.deleteKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2515
|
-
*/
|
|
2516
|
-
deleteKey(harbor_id, key_id, requestOptions) {
|
|
2517
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteKey(harbor_id, key_id, requestOptions));
|
|
2518
|
-
}
|
|
2519
|
-
__deleteKey(harbor_id, key_id, requestOptions) {
|
|
2520
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2521
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2522
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2523
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2524
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2525
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2526
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2527
|
-
const _response = yield core.fetcher({
|
|
2528
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/keys/${core.url.encodePathParam(key_id)}`),
|
|
2529
|
-
method: "DELETE",
|
|
2530
|
-
headers: _headers,
|
|
2531
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2532
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2533
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2534
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2535
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2536
|
-
logging: this._options.logging,
|
|
2537
|
-
});
|
|
2538
|
-
if (_response.ok) {
|
|
2539
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2540
|
-
}
|
|
2541
|
-
if (_response.error.reason === "status-code") {
|
|
2542
|
-
switch (_response.error.statusCode) {
|
|
2543
|
-
case 403:
|
|
2544
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2545
|
-
case 404:
|
|
2546
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2547
|
-
case 500:
|
|
2548
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2549
|
-
default:
|
|
2550
|
-
throw new errors.PolytomicError({
|
|
2551
|
-
statusCode: _response.error.statusCode,
|
|
2552
|
-
body: _response.error.body,
|
|
2553
|
-
rawResponse: _response.rawResponse,
|
|
2554
|
-
});
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/keys/{key_id}");
|
|
2558
|
-
});
|
|
2559
|
-
}
|
|
2560
|
-
/**
|
|
2561
|
-
* Submits a query against the Harbor backing connection for asynchronous execution.
|
|
2562
|
-
*
|
|
2563
|
-
* Use a scoped credential bound to this Harbor. The query runs only against the
|
|
2564
|
-
* Harbor's backing connection; you cannot select another connection on this route.
|
|
2565
|
-
* Send a unique `X-Polytomic-Activity-Request-ID` UUID with each submission. The
|
|
2566
|
-
* `X-Polytomic-Harbor-Session` header is optional; if you send one, it must be
|
|
2567
|
-
* valid for this Harbor.
|
|
2568
|
-
*
|
|
2569
|
-
* The response contains a query ID and an initial `created` status. Poll
|
|
2570
|
-
* [`GET /api/queries/{id}`](../../../../api-reference/query-runner/get-query) with that ID
|
|
2571
|
-
* until the status is `done`, `failed`, or `unknown`. Follow the result endpoint's
|
|
2572
|
-
* pagination links for additional rows. Results are temporary; check `expires`
|
|
2573
|
-
* on the completed query.
|
|
2574
|
-
*
|
|
2575
|
-
* @param {string} harbor_id - Unique identifier of the Harbor whose backing connection runs the query
|
|
2576
|
-
* @param {Polytomic.RunHarborQueryRequest} request
|
|
2577
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2578
|
-
*
|
|
2579
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
2580
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2581
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2582
|
-
* @throws {@link Polytomic.ConflictError}
|
|
2583
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2584
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
2585
|
-
* @throws {@link errors.PolytomicError}
|
|
2586
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2587
|
-
*
|
|
2588
|
-
* @example
|
|
2589
|
-
* await client.harbors.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2590
|
-
* query: "SELECT 1 AS n"
|
|
2591
|
-
* })
|
|
2592
|
-
*/
|
|
2593
|
-
runQuery(harbor_id, request, requestOptions) {
|
|
2594
|
-
return core.HttpResponsePromise.fromPromise(this.__runQuery(harbor_id, request, requestOptions));
|
|
2595
|
-
}
|
|
2596
|
-
__runQuery(harbor_id, request, requestOptions) {
|
|
2597
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2598
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2599
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
|
|
2600
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2601
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2602
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2603
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2604
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2605
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2606
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2607
|
-
const _response = yield core.fetcher({
|
|
2608
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/query`),
|
|
2609
|
-
method: "POST",
|
|
2610
|
-
headers: _headers,
|
|
2611
|
-
contentType: "application/json",
|
|
2612
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2613
|
-
requestType: "json",
|
|
2614
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
2615
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2616
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2617
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2618
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2619
|
-
logging: this._options.logging,
|
|
2620
|
-
});
|
|
2621
|
-
if (_response.ok) {
|
|
2622
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2623
|
-
}
|
|
2624
|
-
if (_response.error.reason === "status-code") {
|
|
2625
|
-
switch (_response.error.statusCode) {
|
|
2626
|
-
case 400:
|
|
2627
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2628
|
-
case 403:
|
|
2629
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2630
|
-
case 404:
|
|
2631
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2632
|
-
case 409:
|
|
2633
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
2634
|
-
case 500:
|
|
2635
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2636
|
-
case 503:
|
|
2637
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
2638
|
-
default:
|
|
2639
|
-
throw new errors.PolytomicError({
|
|
2640
|
-
statusCode: _response.error.statusCode,
|
|
2641
|
-
body: _response.error.body,
|
|
2642
|
-
rawResponse: _response.rawResponse,
|
|
2643
|
-
});
|
|
2644
|
-
}
|
|
2645
|
-
}
|
|
2646
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/query");
|
|
2647
|
-
});
|
|
2648
|
-
}
|
|
2649
|
-
/**
|
|
2650
|
-
* Lists current published saved queries for a Harbor.
|
|
2651
|
-
*
|
|
2652
|
-
* Saved queries are supported only for Polytomic-managed Harbors whose backing
|
|
2653
|
-
* Connection type is `polytomic_harbor`.
|
|
2654
|
-
*
|
|
2655
|
-
* Collection items contain current published metadata and omit SQL, parameter
|
|
2656
|
-
* values, and unpublished drafts. A Harbor profile credential can list saved
|
|
2657
|
-
* queries only when `harbor_id` identifies its own Harbor.
|
|
2658
|
-
*
|
|
2659
|
-
* ## Harbor Activity
|
|
2660
|
-
*
|
|
2661
|
-
* When you use a Harbor profile credential, send a new nonzero UUID in
|
|
2662
|
-
* `X-Polytomic-Activity-Request-ID` for each request, including each page. A
|
|
2663
|
-
* missing or invalid ID returns `400 Bad Request`. Reusing a consumed ID returns
|
|
2664
|
-
* `409 Conflict`.
|
|
2665
|
-
*
|
|
2666
|
-
* If you supply `X-Polytomic-Harbor-Session`, the session must be active and bound
|
|
2667
|
-
* to your credential and Harbor. An invalid session returns `403 Forbidden`.
|
|
2668
|
-
* Direct scoped REST requests may omit the session header.
|
|
2669
|
-
*
|
|
2670
|
-
* Polytomic records `saved_query.listed` before returning data. The event describes
|
|
2671
|
-
* only the returned page, including saved-query IDs, immutable revision IDs,
|
|
2672
|
-
* version numbers, and bounded name snapshots. Activity excludes SQL, parameter
|
|
2673
|
-
* values, and expected column names. If Polytomic cannot record the event, the
|
|
2674
|
-
* request returns `503 Service Unavailable` without saved-query data.
|
|
2675
|
-
*
|
|
2676
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2677
|
-
* @param {Polytomic.HarborsListSavedQueriesRequest} request
|
|
2678
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2679
|
-
*
|
|
2680
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
2681
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2682
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2683
|
-
* @throws {@link Polytomic.ConflictError}
|
|
2684
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2685
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2686
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
2687
|
-
* @throws {@link errors.PolytomicError}
|
|
2688
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2689
|
-
*
|
|
2690
|
-
* @example
|
|
2691
|
-
* await client.harbors.listSavedQueries("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2692
|
-
* limit: 1,
|
|
2693
|
-
* page_token: "page_token"
|
|
2694
|
-
* })
|
|
2695
|
-
*/
|
|
2696
|
-
listSavedQueries(harbor_id, request = {}, requestOptions) {
|
|
2697
|
-
return core.HttpResponsePromise.fromPromise(this.__listSavedQueries(harbor_id, request, requestOptions));
|
|
2698
|
-
}
|
|
2699
|
-
__listSavedQueries(harbor_id_1) {
|
|
2700
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
2701
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2702
|
-
const { limit, page_token: pageToken, "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2703
|
-
const _queryParams = {
|
|
2704
|
-
limit,
|
|
2705
|
-
page_token: pageToken,
|
|
2706
|
-
};
|
|
2707
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2708
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2709
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2710
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2711
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2712
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2713
|
-
const _response = yield core.fetcher({
|
|
2714
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries`),
|
|
2715
|
-
method: "GET",
|
|
2716
|
-
headers: _headers,
|
|
2717
|
-
queryString: core.url
|
|
2718
|
-
.queryBuilder()
|
|
2719
|
-
.addMany(_queryParams)
|
|
2720
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
2721
|
-
.build(),
|
|
2722
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2723
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2724
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2725
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2726
|
-
logging: this._options.logging,
|
|
2727
|
-
});
|
|
2728
|
-
if (_response.ok) {
|
|
2729
|
-
return {
|
|
2730
|
-
data: _response.body,
|
|
2731
|
-
rawResponse: _response.rawResponse,
|
|
2732
|
-
};
|
|
2733
|
-
}
|
|
2734
|
-
if (_response.error.reason === "status-code") {
|
|
2735
|
-
switch (_response.error.statusCode) {
|
|
2736
|
-
case 400:
|
|
2737
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2738
|
-
case 403:
|
|
2739
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2740
|
-
case 404:
|
|
2741
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2742
|
-
case 409:
|
|
2743
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
2744
|
-
case 422:
|
|
2745
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2746
|
-
case 500:
|
|
2747
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2748
|
-
case 503:
|
|
2749
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
2750
|
-
default:
|
|
2751
|
-
throw new errors.PolytomicError({
|
|
2752
|
-
statusCode: _response.error.statusCode,
|
|
2753
|
-
body: _response.error.body,
|
|
2754
|
-
rawResponse: _response.rawResponse,
|
|
2755
|
-
});
|
|
2756
|
-
}
|
|
2757
|
-
}
|
|
2758
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/saved-queries");
|
|
2759
|
-
});
|
|
2760
|
-
}
|
|
2761
|
-
/**
|
|
2762
|
-
* Creates a stable Harbor saved query with its initial mutable draft.
|
|
2763
|
-
*
|
|
2764
|
-
* Saved queries are supported only for Polytomic-managed Harbors whose backing
|
|
2765
|
-
* Connection type is `polytomic_harbor`. Customer-managed Harbor backings return
|
|
2766
|
-
* an unsupported-backing error.
|
|
2767
|
-
*
|
|
2768
|
-
* The saved query receives a stable ID, but it remains absent from published
|
|
2769
|
-
* saved-query reads until an administrator publishes its initial draft.
|
|
2770
|
-
*
|
|
2771
|
-
* Use `{{parameter_name}}` references in `sql_template`. Each reference must have
|
|
2772
|
-
* one scalar declaration. Validation values and defaults must match the declared
|
|
2773
|
-
* `string`, `number`, `boolean`, `date`, `timestamp`, or `uuid` type.
|
|
2774
|
-
*
|
|
2775
|
-
* Unknown JSON fields, including fields inside parameter declarations, return
|
|
2776
|
-
* `400 Bad Request` before the draft is saved. Use `default_value`, not `default`,
|
|
2777
|
-
* for parameter defaults.
|
|
2778
|
-
*
|
|
2779
|
-
* When you omit a parameter during execution, Polytomic uses its published
|
|
2780
|
-
* `default_value`, never its draft validation value. An omitted optional parameter
|
|
2781
|
-
* without a default binds SQL `NULL`. A required parameter allows omission when a
|
|
2782
|
-
* default exists, but rejects explicit `null` even with a default.
|
|
2783
|
-
*
|
|
2784
|
-
* For a report window, use a required parameter with a default so omission selects
|
|
2785
|
-
* a useful window and explicit `null` is rejected:
|
|
2786
|
-
*
|
|
2787
|
-
* ```json
|
|
2788
|
-
* {"name": "days", "type": "number", "required": true, "default_value": 7}
|
|
2789
|
-
* ```
|
|
2790
|
-
*
|
|
2791
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2792
|
-
* @param {Polytomic.CreateHarborSavedQueryDraftRequest} request
|
|
2793
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
2794
|
-
*
|
|
2795
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
2796
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2797
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2798
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2799
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2800
|
-
* @throws {@link errors.PolytomicError}
|
|
2801
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2802
|
-
*
|
|
2803
|
-
* @example
|
|
2804
|
-
* await client.harbors.createSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2805
|
-
* name: "Monthly revenue",
|
|
2806
|
-
* sql_template: "SELECT account_id, sum(amount) AS revenue FROM orders WHERE created_at >= {{start_date}} GROUP BY account_id"
|
|
2807
|
-
* })
|
|
2808
|
-
*/
|
|
2809
|
-
createSavedQueryDraft(harbor_id, request, requestOptions) {
|
|
2810
|
-
return core.HttpResponsePromise.fromPromise(this.__createSavedQueryDraft(harbor_id, request, requestOptions));
|
|
2811
|
-
}
|
|
2812
|
-
__createSavedQueryDraft(harbor_id, request, requestOptions) {
|
|
2813
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2814
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2815
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2816
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2817
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
2818
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2819
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2820
|
-
const _response = yield core.fetcher({
|
|
2821
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries`),
|
|
2822
|
-
method: "POST",
|
|
2823
|
-
headers: _headers,
|
|
2824
|
-
contentType: "application/json",
|
|
2825
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
2826
|
-
requestType: "json",
|
|
2827
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
2828
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2829
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2830
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2831
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2832
|
-
logging: this._options.logging,
|
|
2833
|
-
});
|
|
2834
|
-
if (_response.ok) {
|
|
2835
|
-
return {
|
|
2836
|
-
data: _response.body,
|
|
2837
|
-
rawResponse: _response.rawResponse,
|
|
2838
|
-
};
|
|
2839
|
-
}
|
|
2840
|
-
if (_response.error.reason === "status-code") {
|
|
2841
|
-
switch (_response.error.statusCode) {
|
|
2842
|
-
case 400:
|
|
2843
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2844
|
-
case 403:
|
|
2845
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2846
|
-
case 404:
|
|
2847
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2848
|
-
case 422:
|
|
2849
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2850
|
-
case 500:
|
|
2851
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2852
|
-
default:
|
|
2853
|
-
throw new errors.PolytomicError({
|
|
2854
|
-
statusCode: _response.error.statusCode,
|
|
2855
|
-
body: _response.error.body,
|
|
2856
|
-
rawResponse: _response.rawResponse,
|
|
2857
|
-
});
|
|
2858
|
-
}
|
|
2859
|
-
}
|
|
2860
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/saved-queries");
|
|
2861
|
-
});
|
|
2862
|
-
}
|
|
2863
|
-
/**
|
|
2864
|
-
* Lists mutable Harbor saved-query drafts.
|
|
2865
|
-
*
|
|
2866
|
-
* Drafts are ordered from newest to oldest and include complete SQL, typed
|
|
2867
|
-
* parameter declarations, and author-supplied validation values. Harbor profile
|
|
2868
|
-
* credentials cannot access this endpoint.
|
|
2869
|
-
*
|
|
2870
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2871
|
-
* @param {Polytomic.HarborsListSavedQueryDraftsRequest} request
|
|
2872
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2873
|
-
*
|
|
2874
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2875
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2876
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2877
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2878
|
-
* @throws {@link errors.PolytomicError}
|
|
2879
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2880
|
-
*
|
|
2881
|
-
* @example
|
|
2882
|
-
* await client.harbors.listSavedQueryDrafts("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
2883
|
-
* limit: 1,
|
|
2884
|
-
* page_token: "page_token"
|
|
2885
|
-
* })
|
|
2886
|
-
*/
|
|
2887
|
-
listSavedQueryDrafts(harbor_id, request = {}, requestOptions) {
|
|
2888
|
-
return core.HttpResponsePromise.fromPromise(this.__listSavedQueryDrafts(harbor_id, request, requestOptions));
|
|
2889
|
-
}
|
|
2890
|
-
__listSavedQueryDrafts(harbor_id_1) {
|
|
2891
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
2892
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2893
|
-
const { limit, page_token: pageToken } = request;
|
|
2894
|
-
const _queryParams = {
|
|
2895
|
-
limit,
|
|
2896
|
-
page_token: pageToken,
|
|
2897
|
-
};
|
|
2898
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2899
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2900
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
2901
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2902
|
-
const _response = yield core.fetcher({
|
|
2903
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/drafts`),
|
|
2904
|
-
method: "GET",
|
|
2905
|
-
headers: _headers,
|
|
2906
|
-
queryString: core.url
|
|
2907
|
-
.queryBuilder()
|
|
2908
|
-
.addMany(_queryParams)
|
|
2909
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
2910
|
-
.build(),
|
|
2911
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
2912
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
2913
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2914
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
2915
|
-
logging: this._options.logging,
|
|
2916
|
-
});
|
|
2917
|
-
if (_response.ok) {
|
|
2918
|
-
return {
|
|
2919
|
-
data: _response.body,
|
|
2920
|
-
rawResponse: _response.rawResponse,
|
|
2921
|
-
};
|
|
2922
|
-
}
|
|
2923
|
-
if (_response.error.reason === "status-code") {
|
|
2924
|
-
switch (_response.error.statusCode) {
|
|
2925
|
-
case 403:
|
|
2926
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2927
|
-
case 404:
|
|
2928
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2929
|
-
case 422:
|
|
2930
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2931
|
-
case 500:
|
|
2932
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2933
|
-
default:
|
|
2934
|
-
throw new errors.PolytomicError({
|
|
2935
|
-
statusCode: _response.error.statusCode,
|
|
2936
|
-
body: _response.error.body,
|
|
2937
|
-
rawResponse: _response.rawResponse,
|
|
2938
|
-
});
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/saved-queries/drafts");
|
|
2942
|
-
});
|
|
2943
|
-
}
|
|
2944
|
-
/**
|
|
2945
|
-
* Returns the current published version of one Harbor saved query.
|
|
2946
|
-
*
|
|
2947
|
-
* The response contains the current immutable `revision_id`, SQL template,
|
|
2948
|
-
* parameter contract, expected columns, and publication provenance. Validation
|
|
2949
|
-
* inputs are draft-only and are never part of a published response.
|
|
2950
|
-
*
|
|
2951
|
-
* A Harbor profile credential can retrieve a saved query only from its own Harbor.
|
|
2952
|
-
*
|
|
2953
|
-
* ## Harbor Activity
|
|
2954
|
-
*
|
|
2955
|
-
* When you use a Harbor profile credential, send a new nonzero UUID in
|
|
2956
|
-
* `X-Polytomic-Activity-Request-ID` for each request. A missing or invalid ID
|
|
2957
|
-
* returns `400 Bad Request`. Reusing a consumed ID returns `409 Conflict`.
|
|
2958
|
-
*
|
|
2959
|
-
* If you supply `X-Polytomic-Harbor-Session`, the session must be active and bound
|
|
2960
|
-
* to your credential and Harbor. An invalid session returns `403 Forbidden`.
|
|
2961
|
-
* Direct scoped REST requests may omit the session header.
|
|
2962
|
-
*
|
|
2963
|
-
* Polytomic records `saved_query.fetched` before returning the definition. The
|
|
2964
|
-
* event identifies the saved query, exact immutable revision, published version,
|
|
2965
|
-
* and bounded name snapshot. It does not indicate query execution. Activity
|
|
2966
|
-
* excludes SQL, parameter defaults and validation values, expected column names,
|
|
2967
|
-
* and result rows. If Polytomic cannot record the event, the request returns
|
|
2968
|
-
* `503 Service Unavailable` without saved-query data.
|
|
2969
|
-
*
|
|
2970
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
2971
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
2972
|
-
* @param {Polytomic.HarborsGetSavedQueryRequest} request
|
|
2973
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2974
|
-
*
|
|
2975
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
2976
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
2977
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
2978
|
-
* @throws {@link Polytomic.ConflictError}
|
|
2979
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
2980
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
2981
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
2982
|
-
* @throws {@link errors.PolytomicError}
|
|
2983
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
2984
|
-
*
|
|
2985
|
-
* @example
|
|
2986
|
-
* await client.harbors.getSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
2987
|
-
*/
|
|
2988
|
-
getSavedQuery(harbor_id, saved_query_id, request = {}, requestOptions) {
|
|
2989
|
-
return core.HttpResponsePromise.fromPromise(this.__getSavedQuery(harbor_id, saved_query_id, request, requestOptions));
|
|
2990
|
-
}
|
|
2991
|
-
__getSavedQuery(harbor_id_1, saved_query_id_1) {
|
|
2992
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, saved_query_id, request = {}, requestOptions) {
|
|
2993
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2994
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId, } = request;
|
|
2995
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
2996
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
2997
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
2998
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
2999
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3000
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3001
|
-
const _response = yield core.fetcher({
|
|
3002
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}`),
|
|
3003
|
-
method: "GET",
|
|
3004
|
-
headers: _headers,
|
|
3005
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3006
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3007
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3008
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3009
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3010
|
-
logging: this._options.logging,
|
|
3011
|
-
});
|
|
3012
|
-
if (_response.ok) {
|
|
3013
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3014
|
-
}
|
|
3015
|
-
if (_response.error.reason === "status-code") {
|
|
3016
|
-
switch (_response.error.statusCode) {
|
|
3017
|
-
case 400:
|
|
3018
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3019
|
-
case 403:
|
|
3020
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3021
|
-
case 404:
|
|
3022
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3023
|
-
case 409:
|
|
3024
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
3025
|
-
case 422:
|
|
3026
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3027
|
-
case 500:
|
|
3028
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3029
|
-
case 503:
|
|
3030
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
3031
|
-
default:
|
|
3032
|
-
throw new errors.PolytomicError({
|
|
3033
|
-
statusCode: _response.error.statusCode,
|
|
3034
|
-
body: _response.error.body,
|
|
3035
|
-
rawResponse: _response.rawResponse,
|
|
3036
|
-
});
|
|
3037
|
-
}
|
|
3038
|
-
}
|
|
3039
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}");
|
|
3040
|
-
});
|
|
3041
|
-
}
|
|
3042
|
-
/**
|
|
3043
|
-
* Archives one Harbor saved query and removes it from active reads.
|
|
3044
|
-
*
|
|
3045
|
-
* Archiving removes the saved query and any draft from active reads while
|
|
3046
|
-
* retaining its immutable revisions for provenance. The operation does not run
|
|
3047
|
-
* the saved SQL or modify the Harbor backing Connection. Archiving does not cancel
|
|
3048
|
-
* in-flight execution requests or queued executions.
|
|
3049
|
-
*
|
|
3050
|
-
* This REST operation archives the saved query; it does not merely unpublish it.
|
|
3051
|
-
* Unpublish is available only through the GraphQL `unpublishHarborSavedQuery`
|
|
3052
|
-
* mutation. There is no REST unpublish endpoint.
|
|
3053
|
-
*
|
|
3054
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3055
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3056
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3057
|
-
*
|
|
3058
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3059
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3060
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3061
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3062
|
-
* @throws {@link errors.PolytomicError}
|
|
3063
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3064
|
-
*
|
|
3065
|
-
* @example
|
|
3066
|
-
* await client.harbors.deleteSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3067
|
-
*/
|
|
3068
|
-
deleteSavedQuery(harbor_id, saved_query_id, requestOptions) {
|
|
3069
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteSavedQuery(harbor_id, saved_query_id, requestOptions));
|
|
3070
|
-
}
|
|
3071
|
-
__deleteSavedQuery(harbor_id, saved_query_id, requestOptions) {
|
|
3072
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3073
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3074
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3075
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3076
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3077
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3078
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3079
|
-
const _response = yield core.fetcher({
|
|
3080
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}`),
|
|
3081
|
-
method: "DELETE",
|
|
3082
|
-
headers: _headers,
|
|
3083
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3084
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3085
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3086
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3087
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3088
|
-
logging: this._options.logging,
|
|
3089
|
-
});
|
|
3090
|
-
if (_response.ok) {
|
|
3091
|
-
return {
|
|
3092
|
-
data: _response.body,
|
|
3093
|
-
rawResponse: _response.rawResponse,
|
|
3094
|
-
};
|
|
3095
|
-
}
|
|
3096
|
-
if (_response.error.reason === "status-code") {
|
|
3097
|
-
switch (_response.error.statusCode) {
|
|
3098
|
-
case 403:
|
|
3099
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3100
|
-
case 404:
|
|
3101
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3102
|
-
case 422:
|
|
3103
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3104
|
-
case 500:
|
|
3105
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3106
|
-
default:
|
|
3107
|
-
throw new errors.PolytomicError({
|
|
3108
|
-
statusCode: _response.error.statusCode,
|
|
3109
|
-
body: _response.error.body,
|
|
3110
|
-
rawResponse: _response.rawResponse,
|
|
3111
|
-
});
|
|
3112
|
-
}
|
|
3113
|
-
}
|
|
3114
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}");
|
|
3115
|
-
});
|
|
3116
|
-
}
|
|
3117
|
-
/**
|
|
3118
|
-
* Creates or completely replaces the mutable draft for a Harbor saved query.
|
|
3119
|
-
*
|
|
3120
|
-
* Replacement is complete rather than partial. The next validation or publication
|
|
3121
|
-
* uses the replacement SQL, parameter declarations, and validation values.
|
|
3122
|
-
*
|
|
3123
|
-
* Unknown JSON fields, including fields inside parameter declarations, return
|
|
3124
|
-
* `400 Bad Request` before the draft is saved. Use `default_value`, not `default`,
|
|
3125
|
-
* for parameter defaults.
|
|
3126
|
-
*
|
|
3127
|
-
* When you omit a parameter during execution, Polytomic uses its published
|
|
3128
|
-
* `default_value`, never its draft validation value. An omitted optional parameter
|
|
3129
|
-
* without a default binds SQL `NULL`. A required parameter allows omission when a
|
|
3130
|
-
* default exists, but rejects explicit `null` even with a default.
|
|
3131
|
-
*
|
|
3132
|
-
* For a report window, use a required parameter with a default so omission selects
|
|
3133
|
-
* a useful window and explicit `null` is rejected:
|
|
3134
|
-
*
|
|
3135
|
-
* ```json
|
|
3136
|
-
* {"name": "days", "type": "number", "required": true, "default_value": 7}
|
|
3137
|
-
* ```
|
|
3138
|
-
*
|
|
3139
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3140
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3141
|
-
* @param {Polytomic.SaveHarborSavedQueryDraftRequest} request
|
|
3142
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3143
|
-
*
|
|
3144
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
3145
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3146
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3147
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3148
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3149
|
-
* @throws {@link errors.PolytomicError}
|
|
3150
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3151
|
-
*
|
|
3152
|
-
* @example
|
|
3153
|
-
* await client.harbors.saveSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
3154
|
-
* name: "Monthly revenue",
|
|
3155
|
-
* sql_template: "SELECT account_id, sum(amount) AS revenue FROM orders WHERE created_at >= {{start_date}} GROUP BY account_id"
|
|
3156
|
-
* })
|
|
3157
|
-
*/
|
|
3158
|
-
saveSavedQueryDraft(harbor_id, saved_query_id, request, requestOptions) {
|
|
3159
|
-
return core.HttpResponsePromise.fromPromise(this.__saveSavedQueryDraft(harbor_id, saved_query_id, request, requestOptions));
|
|
3160
|
-
}
|
|
3161
|
-
__saveSavedQueryDraft(harbor_id, saved_query_id, request, requestOptions) {
|
|
3162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3163
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3164
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3165
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3166
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3167
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3168
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3169
|
-
const _response = yield core.fetcher({
|
|
3170
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}/draft`),
|
|
3171
|
-
method: "PUT",
|
|
3172
|
-
headers: _headers,
|
|
3173
|
-
contentType: "application/json",
|
|
3174
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3175
|
-
requestType: "json",
|
|
3176
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
3177
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3178
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3179
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3180
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3181
|
-
logging: this._options.logging,
|
|
3182
|
-
});
|
|
3183
|
-
if (_response.ok) {
|
|
3184
|
-
return {
|
|
3185
|
-
data: _response.body,
|
|
3186
|
-
rawResponse: _response.rawResponse,
|
|
3187
|
-
};
|
|
3188
|
-
}
|
|
3189
|
-
if (_response.error.reason === "status-code") {
|
|
3190
|
-
switch (_response.error.statusCode) {
|
|
3191
|
-
case 400:
|
|
3192
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3193
|
-
case 403:
|
|
3194
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3195
|
-
case 404:
|
|
3196
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3197
|
-
case 422:
|
|
3198
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3199
|
-
case 500:
|
|
3200
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3201
|
-
default:
|
|
3202
|
-
throw new errors.PolytomicError({
|
|
3203
|
-
statusCode: _response.error.statusCode,
|
|
3204
|
-
body: _response.error.body,
|
|
3205
|
-
rawResponse: _response.rawResponse,
|
|
3206
|
-
});
|
|
3207
|
-
}
|
|
3208
|
-
}
|
|
3209
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}/draft");
|
|
3210
|
-
});
|
|
3211
|
-
}
|
|
3212
|
-
/**
|
|
3213
|
-
* Discards the mutable draft for one Harbor saved query.
|
|
3214
|
-
*
|
|
3215
|
-
* Discarding an initial unpublished draft also removes its otherwise empty stable
|
|
3216
|
-
* saved-query identity. Discarding a later draft preserves every immutable
|
|
3217
|
-
* published version.
|
|
3218
|
-
*
|
|
3219
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3220
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3221
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3222
|
-
*
|
|
3223
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3224
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3225
|
-
* @throws {@link Polytomic.ConflictError}
|
|
3226
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3227
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3228
|
-
* @throws {@link errors.PolytomicError}
|
|
3229
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3230
|
-
*
|
|
3231
|
-
* @example
|
|
3232
|
-
* await client.harbors.deleteSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3233
|
-
*/
|
|
3234
|
-
deleteSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3235
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteSavedQueryDraft(harbor_id, saved_query_id, requestOptions));
|
|
3236
|
-
}
|
|
3237
|
-
__deleteSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3238
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3239
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3240
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3241
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3242
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3243
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3244
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3245
|
-
const _response = yield core.fetcher({
|
|
3246
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}/draft`),
|
|
3247
|
-
method: "DELETE",
|
|
3248
|
-
headers: _headers,
|
|
3249
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3250
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3251
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3252
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3253
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3254
|
-
logging: this._options.logging,
|
|
3255
|
-
});
|
|
3256
|
-
if (_response.ok) {
|
|
3257
|
-
return {
|
|
3258
|
-
data: _response.body,
|
|
3259
|
-
rawResponse: _response.rawResponse,
|
|
3260
|
-
};
|
|
3261
|
-
}
|
|
3262
|
-
if (_response.error.reason === "status-code") {
|
|
3263
|
-
switch (_response.error.statusCode) {
|
|
3264
|
-
case 403:
|
|
3265
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3266
|
-
case 404:
|
|
3267
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3268
|
-
case 409:
|
|
3269
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
3270
|
-
case 422:
|
|
3271
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3272
|
-
case 500:
|
|
3273
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3274
|
-
default:
|
|
3275
|
-
throw new errors.PolytomicError({
|
|
3276
|
-
statusCode: _response.error.statusCode,
|
|
3277
|
-
body: _response.error.body,
|
|
3278
|
-
rawResponse: _response.rawResponse,
|
|
3279
|
-
});
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}/draft");
|
|
3283
|
-
});
|
|
3284
|
-
}
|
|
3285
|
-
/**
|
|
3286
|
-
* Validates and publishes the current draft as the next immutable saved-query version.
|
|
3287
|
-
*
|
|
3288
|
-
* Only organization administrators can publish. Publication executes and validates
|
|
3289
|
-
* the current draft with the Polytomic-managed Harbor's MotherDuck `read_scaling`
|
|
3290
|
-
* credential. It fails instead of using the Harbor writer credential when the
|
|
3291
|
-
* reader credential is missing or incomplete.
|
|
3292
|
-
*
|
|
3293
|
-
* After execution, publication verifies that the draft did not change. A
|
|
3294
|
-
* concurrent edit returns a conflict and remains a draft. Successful publication
|
|
3295
|
-
* creates the next immutable revision, records the observed ordered columns as its
|
|
3296
|
-
* output contract, removes validation inputs from the published definition, and
|
|
3297
|
-
* deletes the mutable draft. The response includes the immutable `revision_id`
|
|
3298
|
-
* that future executions use for exact provenance.
|
|
3299
|
-
*
|
|
3300
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3301
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3302
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3303
|
-
*
|
|
3304
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3305
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3306
|
-
* @throws {@link Polytomic.ConflictError}
|
|
3307
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3308
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3309
|
-
* @throws {@link errors.PolytomicError}
|
|
3310
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3311
|
-
*
|
|
3312
|
-
* @example
|
|
3313
|
-
* await client.harbors.publishSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3314
|
-
*/
|
|
3315
|
-
publishSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3316
|
-
return core.HttpResponsePromise.fromPromise(this.__publishSavedQueryDraft(harbor_id, saved_query_id, requestOptions));
|
|
3317
|
-
}
|
|
3318
|
-
__publishSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3319
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3320
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3321
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3322
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3323
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3324
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3325
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3326
|
-
const _response = yield core.fetcher({
|
|
3327
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}/draft/publish`),
|
|
3328
|
-
method: "POST",
|
|
3329
|
-
headers: _headers,
|
|
3330
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3331
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3332
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3333
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3334
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3335
|
-
logging: this._options.logging,
|
|
3336
|
-
});
|
|
3337
|
-
if (_response.ok) {
|
|
3338
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3339
|
-
}
|
|
3340
|
-
if (_response.error.reason === "status-code") {
|
|
3341
|
-
switch (_response.error.statusCode) {
|
|
3342
|
-
case 403:
|
|
3343
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3344
|
-
case 404:
|
|
3345
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3346
|
-
case 409:
|
|
3347
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
3348
|
-
case 422:
|
|
3349
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3350
|
-
case 500:
|
|
3351
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3352
|
-
default:
|
|
3353
|
-
throw new errors.PolytomicError({
|
|
3354
|
-
statusCode: _response.error.statusCode,
|
|
3355
|
-
body: _response.error.body,
|
|
3356
|
-
rawResponse: _response.rawResponse,
|
|
3357
|
-
});
|
|
3358
|
-
}
|
|
3359
|
-
}
|
|
3360
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}/draft/publish");
|
|
3361
|
-
});
|
|
3362
|
-
}
|
|
3363
|
-
/**
|
|
3364
|
-
* Validates the exact current saved-query draft and returns a bounded ephemeral preview.
|
|
3365
|
-
*
|
|
3366
|
-
* Only organization administrators can validate drafts. Named template references
|
|
3367
|
-
* compile to DuckDB placeholders, and typed values are passed separately rather
|
|
3368
|
-
* than interpolated into SQL.
|
|
3369
|
-
*
|
|
3370
|
-
* The query runs with the Polytomic-managed Harbor's MotherDuck `read_scaling`
|
|
3371
|
-
* credential. Validation fails when that credential is missing or incomplete and
|
|
3372
|
-
* never falls back to the Harbor writer credential. Preview rows and serialized
|
|
3373
|
-
* response size are bounded. The preview and validation attempt are not persisted.
|
|
3374
|
-
*
|
|
3375
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3376
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3377
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3378
|
-
*
|
|
3379
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3380
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3381
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3382
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3383
|
-
* @throws {@link errors.PolytomicError}
|
|
3384
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3385
|
-
*
|
|
3386
|
-
* @example
|
|
3387
|
-
* await client.harbors.validateSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3388
|
-
*/
|
|
3389
|
-
validateSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3390
|
-
return core.HttpResponsePromise.fromPromise(this.__validateSavedQueryDraft(harbor_id, saved_query_id, requestOptions));
|
|
3391
|
-
}
|
|
3392
|
-
__validateSavedQueryDraft(harbor_id, saved_query_id, requestOptions) {
|
|
3393
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3394
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3395
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3396
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3397
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3398
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3399
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3400
|
-
const _response = yield core.fetcher({
|
|
3401
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}/draft/validate`),
|
|
3402
|
-
method: "POST",
|
|
3403
|
-
headers: _headers,
|
|
3404
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3405
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3406
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3407
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3408
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3409
|
-
logging: this._options.logging,
|
|
3410
|
-
});
|
|
3411
|
-
if (_response.ok) {
|
|
3412
|
-
return {
|
|
3413
|
-
data: _response.body,
|
|
3414
|
-
rawResponse: _response.rawResponse,
|
|
3415
|
-
};
|
|
3416
|
-
}
|
|
3417
|
-
if (_response.error.reason === "status-code") {
|
|
3418
|
-
switch (_response.error.statusCode) {
|
|
3419
|
-
case 403:
|
|
3420
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3421
|
-
case 404:
|
|
3422
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3423
|
-
case 422:
|
|
3424
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3425
|
-
case 500:
|
|
3426
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3427
|
-
default:
|
|
3428
|
-
throw new errors.PolytomicError({
|
|
3429
|
-
statusCode: _response.error.statusCode,
|
|
3430
|
-
body: _response.error.body,
|
|
3431
|
-
rawResponse: _response.rawResponse,
|
|
3432
|
-
});
|
|
3433
|
-
}
|
|
3434
|
-
}
|
|
3435
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}/draft/validate");
|
|
3436
|
-
});
|
|
3437
|
-
}
|
|
3438
|
-
/**
|
|
3439
|
-
* Submits the current published Harbor saved query for asynchronous reader-only execution.
|
|
3440
|
-
*
|
|
3441
|
-
* Use a Harbor-bound scoped credential with query access to the Harbor's backing
|
|
3442
|
-
* Connection. Administrator credentials cannot submit executions here. Saved
|
|
3443
|
-
* queries require a Polytomic-managed Harbor.
|
|
3444
|
-
*
|
|
3445
|
-
* Polytomic selects the current published revision while processing your request.
|
|
3446
|
-
* The response identifies that exact immutable revision. Selection happens before
|
|
3447
|
-
* Polytomic accepts the execution. Drafts, unpublished queries, and archived
|
|
3448
|
-
* queries are unavailable for selection. You cannot select a historical revision
|
|
3449
|
-
* or supply SQL through this endpoint.
|
|
3450
|
-
*
|
|
3451
|
-
* > ⚠️ Concurrent publication changes
|
|
3452
|
-
* >
|
|
3453
|
-
* > Publishing, unpublishing, or archiving a saved query after selection does not
|
|
3454
|
-
* > change the selected revision. An in-flight request may still be accepted and
|
|
3455
|
-
* > execute that revision. Unpublishing or archiving does not cancel in-flight
|
|
3456
|
-
* > requests or queued executions. Query access is checked again before execution
|
|
3457
|
-
* > and result retrieval.
|
|
3458
|
-
*
|
|
3459
|
-
* Parameter values are bound separately from SQL. Omitted parameters use the
|
|
3460
|
-
* published `default_value`, never draft validation values. An omitted optional
|
|
3461
|
-
* parameter without a default binds SQL `NULL`. Required parameters allow omission
|
|
3462
|
-
* when a default exists, but reject explicit `null` even with a default. Missing
|
|
3463
|
-
* required values without defaults, explicit `null` for required parameters,
|
|
3464
|
-
* unknown parameter names, and invalid scalar types return
|
|
3465
|
-
* `422 Unprocessable Entity` without accepting an execution. Execution requires
|
|
3466
|
-
* reader credentials and never falls back to writer credentials.
|
|
3467
|
-
*
|
|
3468
|
-
* For report windows, define parameters with `required: true` and a
|
|
3469
|
-
* `default_value`, such as `7` for a `days` parameter. This allows omission while
|
|
3470
|
-
* preventing explicit `null` from turning a time filter into a SQL `NULL`
|
|
3471
|
-
* comparison.
|
|
3472
|
-
*
|
|
3473
|
-
* To archive a saved query through REST, use
|
|
3474
|
-
* [`DELETE /api/harbors/{harbor_id}/saved-queries/{saved_query_id}`](../../../../../../api-reference/harbors/delete-saved-query).
|
|
3475
|
-
* Unpublish is available only through the GraphQL `unpublishHarborSavedQuery`
|
|
3476
|
-
* mutation, not a REST endpoint.
|
|
3477
|
-
*
|
|
3478
|
-
* ## Results
|
|
3479
|
-
*
|
|
3480
|
-
* The response returns a task ID with status `created`, not result rows. Poll
|
|
3481
|
-
* [`GET /api/queries/{id}`](../../../../../../api-reference/query-runner/get-query) using a credential
|
|
3482
|
-
* from the same Harbor profile. Query access is checked again before execution and
|
|
3483
|
-
* result retrieval. Stop polling at `done`, `failed`, or `unknown`; `unknown` means
|
|
3484
|
-
* execution started but no durable terminal result is available.
|
|
3485
|
-
*
|
|
3486
|
-
* Results and detailed failure information expire after 24 hours. Use the
|
|
3487
|
-
* `expires` field and follow `links.next` to retrieve additional result pages.
|
|
3488
|
-
*
|
|
3489
|
-
* ## Harbor Activity
|
|
3490
|
-
*
|
|
3491
|
-
* Send a new nonzero UUID in `X-Polytomic-Activity-Request-ID`. Missing or invalid
|
|
3492
|
-
* IDs return `400 Bad Request`. Reusing a consumed ID returns `409 Conflict` and
|
|
3493
|
-
* does not create another execution.
|
|
3494
|
-
*
|
|
3495
|
-
* You may omit `X-Polytomic-Harbor-Session` for direct REST requests. If supplied,
|
|
3496
|
-
* the session must be active and bound to your credential and Harbor.
|
|
3497
|
-
*
|
|
3498
|
-
* Polytomic records `query.submitted` atomically with acceptance. The event
|
|
3499
|
-
* identifies the saved query, immutable revision, published version, and bounded
|
|
3500
|
-
* name snapshot. SQL, parameter values and defaults, column names, and result rows
|
|
3501
|
-
* remain outside Activity metadata. If Activity persistence is unavailable, the
|
|
3502
|
-
* request returns `503 Service Unavailable` without accepting an execution.
|
|
3503
|
-
*
|
|
3504
|
-
* `query.started` records provider invocation. `query.succeeded` means results are
|
|
3505
|
-
* available for authorized retrieval, not that you have consumed them.
|
|
3506
|
-
*
|
|
3507
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3508
|
-
* @param {string} saved_query_id - Unique stable identifier of the saved query
|
|
3509
|
-
* @param {Polytomic.ExecuteHarborSavedQueryRequest} request
|
|
3510
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3511
|
-
*
|
|
3512
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
3513
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3514
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3515
|
-
* @throws {@link Polytomic.ConflictError}
|
|
3516
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3517
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3518
|
-
* @throws {@link Polytomic.ServiceUnavailableError}
|
|
3519
|
-
* @throws {@link errors.PolytomicError}
|
|
3520
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3521
|
-
*
|
|
3522
|
-
* @example
|
|
3523
|
-
* await client.harbors.executeSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3524
|
-
*/
|
|
3525
|
-
executeSavedQuery(harbor_id, saved_query_id, request = {}, requestOptions) {
|
|
3526
|
-
return core.HttpResponsePromise.fromPromise(this.__executeSavedQuery(harbor_id, saved_query_id, request, requestOptions));
|
|
3527
|
-
}
|
|
3528
|
-
__executeSavedQuery(harbor_id_1, saved_query_id_1) {
|
|
3529
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, saved_query_id, request = {}, requestOptions) {
|
|
3530
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3531
|
-
const { "X-Polytomic-Harbor-Session": polytomicHarborSession, "X-Polytomic-Activity-Request-ID": polytomicActivityRequestId } = request, _body = __rest(request, ["X-Polytomic-Harbor-Session", "X-Polytomic-Activity-Request-ID"]);
|
|
3532
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3533
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3534
|
-
"X-Polytomic-Harbor-Session": polytomicHarborSession,
|
|
3535
|
-
"X-Polytomic-Activity-Request-ID": polytomicActivityRequestId,
|
|
3536
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3537
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3538
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3539
|
-
const _response = yield core.fetcher({
|
|
3540
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/saved-queries/${core.url.encodePathParam(saved_query_id)}/execute`),
|
|
3541
|
-
method: "POST",
|
|
3542
|
-
headers: _headers,
|
|
3543
|
-
contentType: "application/json",
|
|
3544
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3545
|
-
requestType: "json",
|
|
3546
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(_body, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
3547
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3548
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3549
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3550
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3551
|
-
logging: this._options.logging,
|
|
3552
|
-
});
|
|
3553
|
-
if (_response.ok) {
|
|
3554
|
-
return {
|
|
3555
|
-
data: _response.body,
|
|
3556
|
-
rawResponse: _response.rawResponse,
|
|
3557
|
-
};
|
|
3558
|
-
}
|
|
3559
|
-
if (_response.error.reason === "status-code") {
|
|
3560
|
-
switch (_response.error.statusCode) {
|
|
3561
|
-
case 400:
|
|
3562
|
-
throw new Polytomic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3563
|
-
case 403:
|
|
3564
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3565
|
-
case 404:
|
|
3566
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3567
|
-
case 409:
|
|
3568
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
3569
|
-
case 422:
|
|
3570
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3571
|
-
case 500:
|
|
3572
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3573
|
-
case 503:
|
|
3574
|
-
throw new Polytomic.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
3575
|
-
default:
|
|
3576
|
-
throw new errors.PolytomicError({
|
|
3577
|
-
statusCode: _response.error.statusCode,
|
|
3578
|
-
body: _response.error.body,
|
|
3579
|
-
rawResponse: _response.rawResponse,
|
|
3580
|
-
});
|
|
3581
|
-
}
|
|
3582
|
-
}
|
|
3583
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/saved-queries/{saved_query_id}/execute");
|
|
3584
|
-
});
|
|
3585
|
-
}
|
|
3586
|
-
/**
|
|
3587
|
-
* Resolves documented source table and field identities to the names a Harbor's backing Connection accepts.
|
|
3588
|
-
*
|
|
3589
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3590
|
-
* @param {Polytomic.ResolveHarborSourceMappingsRequest} request
|
|
3591
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3592
|
-
*
|
|
3593
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3594
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3595
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3596
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3597
|
-
* @throws {@link errors.PolytomicError}
|
|
3598
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3599
|
-
*
|
|
3600
|
-
* @example
|
|
3601
|
-
* await client.harbors.resolveSourceMappings("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3602
|
-
*/
|
|
3603
|
-
resolveSourceMappings(harbor_id, request = {}, requestOptions) {
|
|
3604
|
-
return core.HttpResponsePromise.fromPromise(this.__resolveSourceMappings(harbor_id, request, requestOptions));
|
|
3605
|
-
}
|
|
3606
|
-
__resolveSourceMappings(harbor_id_1) {
|
|
3607
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
3608
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3609
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3610
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3611
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3612
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3613
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3614
|
-
const _response = yield core.fetcher({
|
|
3615
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/source-mappings/resolve`),
|
|
3616
|
-
method: "POST",
|
|
3617
|
-
headers: _headers,
|
|
3618
|
-
contentType: "application/json",
|
|
3619
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3620
|
-
requestType: "json",
|
|
3621
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
3622
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3623
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3624
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3625
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3626
|
-
logging: this._options.logging,
|
|
3627
|
-
});
|
|
3628
|
-
if (_response.ok) {
|
|
3629
|
-
return {
|
|
3630
|
-
data: _response.body,
|
|
3631
|
-
rawResponse: _response.rawResponse,
|
|
3632
|
-
};
|
|
3633
|
-
}
|
|
3634
|
-
if (_response.error.reason === "status-code") {
|
|
3635
|
-
switch (_response.error.statusCode) {
|
|
3636
|
-
case 403:
|
|
3637
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3638
|
-
case 404:
|
|
3639
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3640
|
-
case 422:
|
|
3641
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3642
|
-
case 500:
|
|
3643
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3644
|
-
default:
|
|
3645
|
-
throw new errors.PolytomicError({
|
|
3646
|
-
statusCode: _response.error.statusCode,
|
|
3647
|
-
body: _response.error.body,
|
|
3648
|
-
rawResponse: _response.rawResponse,
|
|
3649
|
-
});
|
|
3650
|
-
}
|
|
3651
|
-
}
|
|
3652
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/source-mappings/resolve");
|
|
3653
|
-
});
|
|
3654
|
-
}
|
|
3655
|
-
/**
|
|
3656
|
-
* Returns raw Polytomic refresh evidence for datasets written to a Harbor.
|
|
3657
|
-
*
|
|
3658
|
-
* Each pipeline corresponds to a bulk sync or model sync that writes at least one
|
|
3659
|
-
* dataset to the Harbor's backing Connection. Tables populated outside Polytomic
|
|
3660
|
-
* are not included, even when they are queryable through a customer-managed
|
|
3661
|
-
* backing Connection.
|
|
3662
|
-
*
|
|
3663
|
-
* The response groups shared pipeline evidence so schedules and configuration are
|
|
3664
|
-
* not repeated for every dataset:
|
|
3665
|
-
*
|
|
3666
|
-
* - Each entry in `pipelines` identifies the producer through `type` and `id`.
|
|
3667
|
-
* Separate pipelines targeting the same physical dataset remain separate
|
|
3668
|
-
* entries.
|
|
3669
|
-
* - `datasets` is keyed by the effective destination dataset name.
|
|
3670
|
-
* `last_success_at` is the start time of the most recent execution in which that
|
|
3671
|
-
* dataset completed successfully, including a successful dataset within a bulk
|
|
3672
|
-
* execution that completes with errors. The start time is a conservative upper
|
|
3673
|
-
* bound because source reads and destination writes happen afterward.
|
|
3674
|
-
* - `latest_status` preserves the latest Polytomic execution status. Never-run
|
|
3675
|
-
* datasets omit this field.
|
|
3676
|
-
* - Pipeline-level `schedules` preserves schedule parameters and selectors. A
|
|
3677
|
-
* schedule can be manual, event-driven, advanced, selective, or limited to
|
|
3678
|
-
* named source schemas, so callers should not reduce the list to one inferred
|
|
3679
|
-
* cadence.
|
|
3680
|
-
* - Continuous schedules use the scheduler's persisted next firing. If scheduler
|
|
3681
|
-
* state is unavailable, `next_run_at` is omitted rather than recalculated with
|
|
3682
|
-
* new jitter.
|
|
3683
|
-
* - Paused pipelines remain present with `refresh_enabled` set to `false` and no
|
|
3684
|
-
* `next_run_at`.
|
|
3685
|
-
*
|
|
3686
|
-
* Use absolute timestamps and the raw statuses to apply the maximum acceptable
|
|
3687
|
-
* staleness for your task. The endpoint does not classify datasets or the Harbor
|
|
3688
|
-
* as healthy, stale, or unhealthy.
|
|
3689
|
-
*
|
|
3690
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3691
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3692
|
-
*
|
|
3693
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3694
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3695
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3696
|
-
* @throws {@link errors.PolytomicError}
|
|
3697
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3698
|
-
*
|
|
3699
|
-
* @example
|
|
3700
|
-
* await client.harbors.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3701
|
-
*/
|
|
3702
|
-
getStatus(harbor_id, requestOptions) {
|
|
3703
|
-
return core.HttpResponsePromise.fromPromise(this.__getStatus(harbor_id, requestOptions));
|
|
3704
|
-
}
|
|
3705
|
-
__getStatus(harbor_id, requestOptions) {
|
|
3706
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3707
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3708
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3709
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3710
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3711
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3712
|
-
const _response = yield core.fetcher({
|
|
3713
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/status`),
|
|
3714
|
-
method: "GET",
|
|
3715
|
-
headers: _headers,
|
|
3716
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3717
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3718
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3719
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3720
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3721
|
-
logging: this._options.logging,
|
|
3722
|
-
});
|
|
3723
|
-
if (_response.ok) {
|
|
3724
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
761
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3725
762
|
}
|
|
3726
763
|
if (_response.error.reason === "status-code") {
|
|
3727
764
|
switch (_response.error.statusCode) {
|
|
@@ -3742,287 +779,5 @@ class HarborsClient {
|
|
|
3742
779
|
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/status");
|
|
3743
780
|
});
|
|
3744
781
|
}
|
|
3745
|
-
/**
|
|
3746
|
-
* Lists Harbor-only users assigned to a Harbor.
|
|
3747
|
-
*
|
|
3748
|
-
* The response contains only Harbor-only users currently assigned to this Harbor.
|
|
3749
|
-
*
|
|
3750
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3751
|
-
* @param {Polytomic.HarborsListUsersRequest} request
|
|
3752
|
-
* @param {HarborsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3753
|
-
*
|
|
3754
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3755
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3756
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3757
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3758
|
-
* @throws {@link errors.PolytomicError}
|
|
3759
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3760
|
-
*
|
|
3761
|
-
* @example
|
|
3762
|
-
* await client.harbors.listUsers("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
3763
|
-
* limit: 50,
|
|
3764
|
-
* page_token: "page_token"
|
|
3765
|
-
* })
|
|
3766
|
-
*/
|
|
3767
|
-
listUsers(harbor_id, request = {}, requestOptions) {
|
|
3768
|
-
return core.HttpResponsePromise.fromPromise(this.__listUsers(harbor_id, request, requestOptions));
|
|
3769
|
-
}
|
|
3770
|
-
__listUsers(harbor_id_1) {
|
|
3771
|
-
return __awaiter(this, arguments, void 0, function* (harbor_id, request = {}, requestOptions) {
|
|
3772
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3773
|
-
const { limit, page_token: pageToken } = request;
|
|
3774
|
-
const _queryParams = {
|
|
3775
|
-
limit,
|
|
3776
|
-
page_token: pageToken,
|
|
3777
|
-
};
|
|
3778
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3779
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3780
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3781
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3782
|
-
const _response = yield core.fetcher({
|
|
3783
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/users`),
|
|
3784
|
-
method: "GET",
|
|
3785
|
-
headers: _headers,
|
|
3786
|
-
queryString: core.url
|
|
3787
|
-
.queryBuilder()
|
|
3788
|
-
.addMany(_queryParams)
|
|
3789
|
-
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
3790
|
-
.build(),
|
|
3791
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3792
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3793
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3794
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3795
|
-
logging: this._options.logging,
|
|
3796
|
-
});
|
|
3797
|
-
if (_response.ok) {
|
|
3798
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3799
|
-
}
|
|
3800
|
-
if (_response.error.reason === "status-code") {
|
|
3801
|
-
switch (_response.error.statusCode) {
|
|
3802
|
-
case 403:
|
|
3803
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3804
|
-
case 404:
|
|
3805
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3806
|
-
case 422:
|
|
3807
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3808
|
-
case 500:
|
|
3809
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3810
|
-
default:
|
|
3811
|
-
throw new errors.PolytomicError({
|
|
3812
|
-
statusCode: _response.error.statusCode,
|
|
3813
|
-
body: _response.error.body,
|
|
3814
|
-
rawResponse: _response.rawResponse,
|
|
3815
|
-
});
|
|
3816
|
-
}
|
|
3817
|
-
}
|
|
3818
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/harbors/{harbor_id}/users");
|
|
3819
|
-
});
|
|
3820
|
-
}
|
|
3821
|
-
/**
|
|
3822
|
-
* Invites and assigns a new Harbor-only user.
|
|
3823
|
-
*
|
|
3824
|
-
* The invited account is restricted to assigned Harbors and does not receive regular Polytomic application access.
|
|
3825
|
-
*
|
|
3826
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3827
|
-
* @param {Polytomic.InviteHarborUserRequest} request
|
|
3828
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3829
|
-
*
|
|
3830
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3831
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3832
|
-
* @throws {@link Polytomic.ConflictError}
|
|
3833
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3834
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3835
|
-
* @throws {@link errors.PolytomicError}
|
|
3836
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3837
|
-
*
|
|
3838
|
-
* @example
|
|
3839
|
-
* await client.harbors.inviteUser("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
3840
|
-
* email: "analyst@example.com"
|
|
3841
|
-
* })
|
|
3842
|
-
*/
|
|
3843
|
-
inviteUser(harbor_id, request, requestOptions) {
|
|
3844
|
-
return core.HttpResponsePromise.fromPromise(this.__inviteUser(harbor_id, request, requestOptions));
|
|
3845
|
-
}
|
|
3846
|
-
__inviteUser(harbor_id, request, requestOptions) {
|
|
3847
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3848
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3849
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3850
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3851
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3852
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3853
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3854
|
-
const _response = yield core.fetcher({
|
|
3855
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/users`),
|
|
3856
|
-
method: "POST",
|
|
3857
|
-
headers: _headers,
|
|
3858
|
-
contentType: "application/json",
|
|
3859
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3860
|
-
requestType: "json",
|
|
3861
|
-
body: (0, requestBody_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
3862
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3863
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3864
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3865
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3866
|
-
logging: this._options.logging,
|
|
3867
|
-
});
|
|
3868
|
-
if (_response.ok) {
|
|
3869
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3870
|
-
}
|
|
3871
|
-
if (_response.error.reason === "status-code") {
|
|
3872
|
-
switch (_response.error.statusCode) {
|
|
3873
|
-
case 403:
|
|
3874
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3875
|
-
case 404:
|
|
3876
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3877
|
-
case 409:
|
|
3878
|
-
throw new Polytomic.ConflictError(_response.error.body, _response.rawResponse);
|
|
3879
|
-
case 422:
|
|
3880
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3881
|
-
case 500:
|
|
3882
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3883
|
-
default:
|
|
3884
|
-
throw new errors.PolytomicError({
|
|
3885
|
-
statusCode: _response.error.statusCode,
|
|
3886
|
-
body: _response.error.body,
|
|
3887
|
-
rawResponse: _response.rawResponse,
|
|
3888
|
-
});
|
|
3889
|
-
}
|
|
3890
|
-
}
|
|
3891
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/api/harbors/{harbor_id}/users");
|
|
3892
|
-
});
|
|
3893
|
-
}
|
|
3894
|
-
/**
|
|
3895
|
-
* Assigns an existing Harbor-only user to a Harbor.
|
|
3896
|
-
*
|
|
3897
|
-
* The assignment is idempotent. Regular Polytomic users cannot be assigned because they already have application access to Harbors.
|
|
3898
|
-
*
|
|
3899
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3900
|
-
* @param {string} user_id - Unique identifier of the Harbor-only user
|
|
3901
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3902
|
-
*
|
|
3903
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3904
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3905
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3906
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3907
|
-
* @throws {@link errors.PolytomicError}
|
|
3908
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3909
|
-
*
|
|
3910
|
-
* @example
|
|
3911
|
-
* await client.harbors.assignUser("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3912
|
-
*/
|
|
3913
|
-
assignUser(harbor_id, user_id, requestOptions) {
|
|
3914
|
-
return core.HttpResponsePromise.fromPromise(this.__assignUser(harbor_id, user_id, requestOptions));
|
|
3915
|
-
}
|
|
3916
|
-
__assignUser(harbor_id, user_id, requestOptions) {
|
|
3917
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3918
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3919
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3920
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3921
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3922
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3923
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3924
|
-
const _response = yield core.fetcher({
|
|
3925
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/users/${core.url.encodePathParam(user_id)}`),
|
|
3926
|
-
method: "PUT",
|
|
3927
|
-
headers: _headers,
|
|
3928
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3929
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3930
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3931
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3932
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3933
|
-
logging: this._options.logging,
|
|
3934
|
-
});
|
|
3935
|
-
if (_response.ok) {
|
|
3936
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3937
|
-
}
|
|
3938
|
-
if (_response.error.reason === "status-code") {
|
|
3939
|
-
switch (_response.error.statusCode) {
|
|
3940
|
-
case 403:
|
|
3941
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3942
|
-
case 404:
|
|
3943
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3944
|
-
case 422:
|
|
3945
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3946
|
-
case 500:
|
|
3947
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3948
|
-
default:
|
|
3949
|
-
throw new errors.PolytomicError({
|
|
3950
|
-
statusCode: _response.error.statusCode,
|
|
3951
|
-
body: _response.error.body,
|
|
3952
|
-
rawResponse: _response.rawResponse,
|
|
3953
|
-
});
|
|
3954
|
-
}
|
|
3955
|
-
}
|
|
3956
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/api/harbors/{harbor_id}/users/{user_id}");
|
|
3957
|
-
});
|
|
3958
|
-
}
|
|
3959
|
-
/**
|
|
3960
|
-
* Removes a Harbor assignment without deleting the user.
|
|
3961
|
-
*
|
|
3962
|
-
* This removes only the Harbor assignment. The organization user remains available and may retain assignments to other Harbors.
|
|
3963
|
-
*
|
|
3964
|
-
* @param {string} harbor_id - Unique identifier of the Harbor
|
|
3965
|
-
* @param {string} user_id - Unique identifier of the Harbor-only user
|
|
3966
|
-
* @param {HarborsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
|
|
3967
|
-
*
|
|
3968
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
3969
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
3970
|
-
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
3971
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
3972
|
-
* @throws {@link errors.PolytomicError}
|
|
3973
|
-
* @throws {@link errors.PolytomicTimeoutError}
|
|
3974
|
-
*
|
|
3975
|
-
* @example
|
|
3976
|
-
* await client.harbors.unassignUser("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
3977
|
-
*/
|
|
3978
|
-
unassignUser(harbor_id, user_id, requestOptions) {
|
|
3979
|
-
return core.HttpResponsePromise.fromPromise(this.__unassignUser(harbor_id, user_id, requestOptions));
|
|
3980
|
-
}
|
|
3981
|
-
__unassignUser(harbor_id, user_id, requestOptions) {
|
|
3982
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3983
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3984
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3985
|
-
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
3986
|
-
"Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey,
|
|
3987
|
-
"X-Polytomic-Version": (_d = (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : "2025-09-18",
|
|
3988
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3989
|
-
const _response = yield core.fetcher({
|
|
3990
|
-
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.PolytomicEnvironment.Default, `api/harbors/${core.url.encodePathParam(harbor_id)}/users/${core.url.encodePathParam(user_id)}`),
|
|
3991
|
-
method: "DELETE",
|
|
3992
|
-
headers: _headers,
|
|
3993
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
3994
|
-
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
3995
|
-
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
3996
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3997
|
-
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
3998
|
-
logging: this._options.logging,
|
|
3999
|
-
});
|
|
4000
|
-
if (_response.ok) {
|
|
4001
|
-
return {
|
|
4002
|
-
data: _response.body,
|
|
4003
|
-
rawResponse: _response.rawResponse,
|
|
4004
|
-
};
|
|
4005
|
-
}
|
|
4006
|
-
if (_response.error.reason === "status-code") {
|
|
4007
|
-
switch (_response.error.statusCode) {
|
|
4008
|
-
case 403:
|
|
4009
|
-
throw new Polytomic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4010
|
-
case 404:
|
|
4011
|
-
throw new Polytomic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4012
|
-
case 422:
|
|
4013
|
-
throw new Polytomic.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
4014
|
-
case 500:
|
|
4015
|
-
throw new Polytomic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4016
|
-
default:
|
|
4017
|
-
throw new errors.PolytomicError({
|
|
4018
|
-
statusCode: _response.error.statusCode,
|
|
4019
|
-
body: _response.error.body,
|
|
4020
|
-
rawResponse: _response.rawResponse,
|
|
4021
|
-
});
|
|
4022
|
-
}
|
|
4023
|
-
}
|
|
4024
|
-
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/harbors/{harbor_id}/users/{user_id}");
|
|
4025
|
-
});
|
|
4026
|
-
}
|
|
4027
782
|
}
|
|
4028
783
|
exports.HarborsClient = HarborsClient;
|