polytomic 1.16.0 → 1.18.1
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/Client.d.ts +14 -19
- package/api/errors/BadRequestError.js +7 -17
- package/api/errors/ConflictError.js +7 -17
- package/api/errors/ForbiddenError.js +7 -17
- package/api/errors/InternalServerError.js +7 -17
- package/api/errors/NotFoundError.js +7 -17
- package/api/errors/UnauthorizedError.js +7 -17
- package/api/errors/UnprocessableEntityError.js +7 -17
- package/api/resources/bulkSync/client/Client.d.ts +173 -24
- package/api/resources/bulkSync/client/Client.js +339 -118
- package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +3 -0
- package/api/resources/bulkSync/client/requests/BulkSyncListRequest.d.ts +3 -0
- package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
- package/api/resources/bulkSync/client/requests/StartBulkSyncRequest.d.ts +4 -0
- package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
- package/api/resources/bulkSync/resources/executions/client/Client.d.ts +77 -12
- package/api/resources/bulkSync/resources/executions/client/Client.js +168 -66
- package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +12 -0
- package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListStatusRequest.d.ts +3 -3
- package/api/resources/bulkSync/resources/index.js +7 -17
- package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +44 -15
- package/api/resources/bulkSync/resources/schedules/client/Client.js +116 -57
- package/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +1 -1
- package/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +1 -1
- package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +71 -11
- package/api/resources/bulkSync/resources/schemas/client/Client.js +150 -61
- package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +1 -0
- package/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.d.ts +3 -0
- package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +7 -0
- package/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.d.ts +1 -1
- package/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.d.ts +1 -1
- package/api/resources/connections/client/Client.d.ts +160 -12
- package/api/resources/connections/client/Client.js +473 -86
- package/api/resources/connections/client/requests/ApiRequest.d.ts +13 -0
- package/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +15 -0
- package/api/resources/connections/client/requests/index.d.ts +2 -0
- package/api/resources/events/client/Client.d.ts +20 -7
- package/api/resources/events/client/Client.js +55 -33
- package/api/resources/events/client/requests/EventsListRequest.d.ts +17 -2
- package/api/resources/identity/client/Client.d.ts +11 -6
- package/api/resources/identity/client/Client.js +31 -24
- package/api/resources/index.js +7 -17
- package/api/resources/jobs/client/Client.d.ts +15 -8
- package/api/resources/jobs/client/Client.js +35 -26
- package/api/resources/modelSync/client/Client.d.ts +110 -19
- package/api/resources/modelSync/client/Client.js +287 -118
- package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -1
- package/api/resources/modelSync/client/requests/ModelSyncGetSourceFieldsRequest.d.ts +3 -0
- package/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.d.ts +3 -0
- package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -1
- package/api/resources/modelSync/resources/executions/client/Client.d.ts +41 -12
- package/api/resources/modelSync/resources/executions/client/Client.js +115 -56
- package/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +1 -1
- package/api/resources/modelSync/resources/index.js +7 -17
- package/api/resources/modelSync/resources/targets/client/Client.d.ts +28 -11
- package/api/resources/modelSync/resources/targets/client/Client.js +89 -49
- package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts +6 -0
- package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts +6 -0
- package/api/resources/models/client/Client.d.ts +79 -8
- package/api/resources/models/client/Client.js +214 -86
- package/api/resources/models/client/requests/ModelsGetEnrichmentSourceRequest.d.ts +3 -0
- package/api/resources/notifications/client/Client.d.ts +13 -5
- package/api/resources/notifications/client/Client.js +48 -31
- package/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +1 -0
- package/api/resources/organization/client/Client.d.ts +31 -13
- package/api/resources/organization/client/Client.js +109 -55
- package/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +6 -0
- package/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +6 -0
- package/api/resources/permissions/client/Client.d.ts +2 -7
- package/api/resources/permissions/resources/index.js +7 -17
- package/api/resources/permissions/resources/policies/client/Client.d.ts +33 -5
- package/api/resources/permissions/resources/policies/client/Client.js +105 -47
- package/api/resources/permissions/resources/roles/client/Client.d.ts +38 -5
- package/api/resources/permissions/resources/roles/client/Client.js +110 -47
- package/api/resources/queryRunner/client/Client.d.ts +26 -7
- package/api/resources/queryRunner/client/Client.js +63 -35
- package/api/resources/queryRunner/client/requests/QueryRunnerGetQueryRequest.d.ts +3 -0
- package/api/resources/schemas/client/Client.d.ts +118 -23
- package/api/resources/schemas/client/Client.js +232 -86
- package/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +1 -0
- package/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +1 -0
- package/api/resources/users/client/Client.d.ts +44 -16
- package/api/resources/users/client/Client.js +133 -66
- package/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +4 -0
- package/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +4 -0
- package/api/resources/users/client/requests/UsersCreateApiKeyRequest.d.ts +3 -0
- package/api/resources/webhooks/client/Client.d.ts +67 -21
- package/api/resources/webhooks/client/Client.js +165 -75
- package/api/types/ApiKeyResponse.d.ts +1 -0
- package/api/types/BulkBulkSyncSchedule.d.ts +1 -0
- package/api/types/BulkDiscover.d.ts +1 -1
- package/api/types/BulkExecutionStatus.d.ts +1 -1
- package/api/types/BulkFetchMode.d.ts +1 -1
- package/api/types/BulkNormalizeNames.d.ts +1 -1
- package/api/types/BulkOutputDisposition.d.ts +9 -0
- package/api/types/BulkOutputDisposition.js +11 -0
- package/api/types/BulkResyncMode.d.ts +9 -0
- package/api/types/BulkResyncMode.js +11 -0
- package/api/types/BulkScheduleSyncMode.d.ts +1 -1
- package/api/types/BulkSchema.d.ts +2 -0
- package/api/types/BulkSchemaExecutionStatus.d.ts +2 -1
- package/api/types/BulkSchemaExecutionStatus.js +1 -0
- package/api/types/BulkSelectiveMode.d.ts +1 -1
- package/api/types/BulkSyncDest.d.ts +2 -0
- package/api/types/BulkSyncExecution.d.ts +1 -0
- package/api/types/BulkSyncExecutionStatus.d.ts +3 -0
- package/api/types/BulkSyncIngestionStatus.d.ts +14 -0
- package/{dist/version.js → api/types/BulkSyncIngestionStatus.js} +3 -2
- package/api/types/BulkSyncMode.d.ts +1 -1
- package/api/types/BulkSyncResponse.d.ts +2 -2
- package/api/types/BulkSyncSchemaExecutionStatus.d.ts +7 -0
- package/api/types/BulkSyncSource.d.ts +1 -0
- package/api/types/BulkSyncStatusResponse.d.ts +1 -0
- package/api/types/ConnectCardResponse.d.ts +1 -0
- package/api/types/ConnectionResponseSchema.d.ts +4 -2
- package/api/types/CreateSharedConnectionResponseSchema.d.ts +6 -0
- package/{version.js → api/types/CreateSharedConnectionResponseSchema.js} +3 -2
- package/api/types/Event.d.ts +4 -0
- package/api/types/EventBody.d.ts +1 -1
- package/api/types/ExecutionStatus.d.ts +1 -1
- package/api/types/FilterFieldReferenceType.d.ts +1 -1
- package/api/types/FilterFunction.d.ts +1 -1
- package/api/types/GetIdentityResponseSchema.d.ts +2 -0
- package/api/types/IngestionStatusLevel.d.ts +12 -0
- package/api/types/IngestionStatusLevel.js +11 -0
- package/api/types/JobResponse.d.ts +3 -0
- package/api/types/JsonschemaDefinitions.d.ts +1 -1
- package/api/types/JsonschemaForm.d.ts +1 -1
- package/api/types/LabelLabel.d.ts +1 -1
- package/api/types/ModelField.d.ts +1 -1
- package/api/types/ModelResponse.d.ts +2 -2
- package/api/types/ModelSyncMode.d.ts +2 -1
- package/api/types/ModelSyncMode.js +1 -0
- package/api/types/ModelSyncResponse.d.ts +2 -2
- package/api/types/ModelSyncSourceMetaResponse.d.ts +3 -0
- package/api/types/Organization.d.ts +5 -0
- package/api/types/{CommonOutputActor.d.ts → OutputActor.d.ts} +1 -1
- package/api/types/OutputActor.js +5 -0
- package/api/types/ScheduleFrequency.d.ts +1 -1
- package/api/types/SchemaIdentityFunction.d.ts +1 -1
- package/api/types/SourceMeta.d.ts +3 -0
- package/api/types/TypesType.d.ts +1 -1
- package/api/types/User.d.ts +6 -0
- package/api/types/UtilFieldType.d.ts +1 -1
- package/api/types/V2CreateSharedConnectionResponseEnvelope.d.ts +7 -0
- package/api/types/V2CreateSharedConnectionResponseEnvelope.js +5 -0
- package/api/types/V2EnricherConfiguration.d.ts +1 -1
- package/api/types/V2EnricherMapping.d.ts +1 -1
- package/api/types/V2ExecutionLogType.d.ts +1 -1
- package/api/types/V2OrderedMapStringGithubComInvopopJsonschemaSchema.d.ts +1 -1
- package/api/types/V2SampleRecord.d.ts +1 -1
- package/api/types/V2SchemaConfigurationFieldsItem.d.ts +1 -1
- package/api/types/V3BulkSyncSourceCapabilities.d.ts +6 -0
- package/api/types/V3BulkSyncSourceCapabilities.js +5 -0
- package/api/types/V4BulkSyncExecutionLogs.d.ts +6 -1
- package/api/types/V4BulkSyncScheduleApi.d.ts +5 -0
- package/api/types/V4ExportSyncLogsResponse.d.ts +1 -0
- package/api/types/V4GlobalErrorSubscribersResponse.d.ts +1 -0
- package/api/types/V4RunQueryResult.d.ts +2 -1
- package/api/types/V4UserFieldRequest.d.ts +4 -0
- package/api/types/WorkTaskStatus.d.ts +1 -1
- package/api/types/index.d.ts +13 -6
- package/api/types/index.js +13 -6
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +3 -6
- package/core/fetcher/Fetcher.js +189 -20
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/getHeader.js +2 -1
- package/core/runtime/runtime.d.ts +1 -2
- package/core/runtime/runtime.js +41 -52
- package/dist/Client.d.ts +14 -19
- package/dist/api/errors/BadRequestError.js +7 -17
- package/dist/api/errors/ConflictError.js +7 -17
- package/dist/api/errors/ForbiddenError.js +7 -17
- package/dist/api/errors/InternalServerError.js +7 -17
- package/dist/api/errors/NotFoundError.js +7 -17
- package/dist/api/errors/UnauthorizedError.js +7 -17
- package/dist/api/errors/UnprocessableEntityError.js +7 -17
- package/dist/api/resources/bulkSync/client/Client.d.ts +173 -24
- package/dist/api/resources/bulkSync/client/Client.js +339 -118
- package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +3 -0
- package/dist/api/resources/bulkSync/client/requests/BulkSyncListRequest.d.ts +3 -0
- package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
- package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.d.ts +4 -0
- package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
- package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +77 -12
- package/dist/api/resources/bulkSync/resources/executions/client/Client.js +168 -66
- package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +12 -0
- package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListStatusRequest.d.ts +3 -3
- package/dist/api/resources/bulkSync/resources/index.js +7 -17
- package/dist/api/resources/bulkSync/resources/schedules/client/Client.d.ts +44 -15
- package/dist/api/resources/bulkSync/resources/schedules/client/Client.js +116 -57
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +1 -1
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +1 -1
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +71 -11
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +150 -61
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +1 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.d.ts +3 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +7 -0
- package/dist/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.d.ts +1 -1
- package/dist/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.d.ts +1 -1
- package/dist/api/resources/connections/client/Client.d.ts +160 -12
- package/dist/api/resources/connections/client/Client.js +473 -86
- package/dist/api/resources/connections/client/requests/ApiRequest.d.ts +13 -0
- package/dist/api/resources/connections/client/requests/ApiRequest.js +5 -0
- package/dist/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +15 -0
- package/dist/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.js +5 -0
- package/dist/api/resources/connections/client/requests/index.d.ts +2 -0
- package/dist/api/resources/events/client/Client.d.ts +20 -7
- package/dist/api/resources/events/client/Client.js +55 -33
- package/dist/api/resources/events/client/requests/EventsListRequest.d.ts +17 -2
- package/dist/api/resources/identity/client/Client.d.ts +11 -6
- package/dist/api/resources/identity/client/Client.js +31 -24
- package/dist/api/resources/index.js +7 -17
- package/dist/api/resources/jobs/client/Client.d.ts +15 -8
- package/dist/api/resources/jobs/client/Client.js +35 -26
- package/dist/api/resources/modelSync/client/Client.d.ts +110 -19
- package/dist/api/resources/modelSync/client/Client.js +287 -118
- package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -1
- package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceFieldsRequest.d.ts +3 -0
- package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.d.ts +3 -0
- package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -1
- package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +41 -12
- package/dist/api/resources/modelSync/resources/executions/client/Client.js +115 -56
- package/dist/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +1 -1
- package/dist/api/resources/modelSync/resources/index.js +7 -17
- package/dist/api/resources/modelSync/resources/targets/client/Client.d.ts +28 -11
- package/dist/api/resources/modelSync/resources/targets/client/Client.js +89 -49
- package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts +6 -0
- package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts +6 -0
- package/dist/api/resources/models/client/Client.d.ts +79 -8
- package/dist/api/resources/models/client/Client.js +214 -86
- package/dist/api/resources/models/client/requests/ModelsGetEnrichmentSourceRequest.d.ts +3 -0
- package/dist/api/resources/notifications/client/Client.d.ts +13 -5
- package/dist/api/resources/notifications/client/Client.js +48 -31
- package/dist/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +1 -0
- package/dist/api/resources/organization/client/Client.d.ts +31 -13
- package/dist/api/resources/organization/client/Client.js +109 -55
- package/dist/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +6 -0
- package/dist/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +6 -0
- package/dist/api/resources/permissions/client/Client.d.ts +2 -7
- package/dist/api/resources/permissions/resources/index.js +7 -17
- package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +33 -5
- package/dist/api/resources/permissions/resources/policies/client/Client.js +105 -47
- package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +38 -5
- package/dist/api/resources/permissions/resources/roles/client/Client.js +110 -47
- package/dist/api/resources/queryRunner/client/Client.d.ts +26 -7
- package/dist/api/resources/queryRunner/client/Client.js +63 -35
- package/dist/api/resources/queryRunner/client/requests/QueryRunnerGetQueryRequest.d.ts +3 -0
- package/dist/api/resources/schemas/client/Client.d.ts +118 -23
- package/dist/api/resources/schemas/client/Client.js +232 -86
- package/dist/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +1 -0
- package/dist/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +1 -0
- package/dist/api/resources/users/client/Client.d.ts +44 -16
- package/dist/api/resources/users/client/Client.js +133 -66
- package/dist/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +4 -0
- package/dist/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +4 -0
- package/dist/api/resources/users/client/requests/UsersCreateApiKeyRequest.d.ts +3 -0
- package/dist/api/resources/webhooks/client/Client.d.ts +67 -21
- package/dist/api/resources/webhooks/client/Client.js +165 -75
- package/dist/api/types/ApiKeyResponse.d.ts +1 -0
- package/dist/api/types/BulkBulkSyncSchedule.d.ts +1 -0
- package/dist/api/types/BulkDiscover.d.ts +1 -1
- package/dist/api/types/BulkExecutionStatus.d.ts +1 -1
- package/dist/api/types/BulkFetchMode.d.ts +1 -1
- package/dist/api/types/BulkNormalizeNames.d.ts +1 -1
- package/dist/api/types/BulkOutputDisposition.d.ts +9 -0
- package/dist/api/types/BulkOutputDisposition.js +11 -0
- package/dist/api/types/BulkResyncMode.d.ts +9 -0
- package/dist/api/types/BulkResyncMode.js +11 -0
- package/dist/api/types/BulkScheduleSyncMode.d.ts +1 -1
- package/dist/api/types/BulkSchema.d.ts +2 -0
- package/dist/api/types/BulkSchemaExecutionStatus.d.ts +2 -1
- package/dist/api/types/BulkSchemaExecutionStatus.js +1 -0
- package/dist/api/types/BulkSelectiveMode.d.ts +1 -1
- package/dist/api/types/BulkSyncDest.d.ts +2 -0
- package/dist/api/types/BulkSyncExecution.d.ts +1 -0
- package/dist/api/types/BulkSyncExecutionStatus.d.ts +3 -0
- package/dist/api/types/BulkSyncIngestionStatus.d.ts +14 -0
- package/dist/api/types/BulkSyncIngestionStatus.js +5 -0
- package/dist/api/types/BulkSyncMode.d.ts +1 -1
- package/dist/api/types/BulkSyncResponse.d.ts +2 -2
- package/dist/api/types/BulkSyncSchemaExecutionStatus.d.ts +7 -0
- package/dist/api/types/BulkSyncSource.d.ts +1 -0
- package/dist/api/types/BulkSyncStatusResponse.d.ts +1 -0
- package/dist/api/types/ConnectCardResponse.d.ts +1 -0
- package/dist/api/types/ConnectionResponseSchema.d.ts +4 -2
- package/dist/api/types/CreateSharedConnectionResponseSchema.d.ts +6 -0
- package/dist/api/types/CreateSharedConnectionResponseSchema.js +5 -0
- package/dist/api/types/Event.d.ts +4 -0
- package/dist/api/types/EventBody.d.ts +1 -1
- package/dist/api/types/ExecutionStatus.d.ts +1 -1
- package/dist/api/types/FilterFieldReferenceType.d.ts +1 -1
- package/dist/api/types/FilterFunction.d.ts +1 -1
- package/dist/api/types/GetIdentityResponseSchema.d.ts +2 -0
- package/dist/api/types/IngestionStatusLevel.d.ts +12 -0
- package/dist/api/types/IngestionStatusLevel.js +11 -0
- package/dist/api/types/JobResponse.d.ts +3 -0
- package/dist/api/types/JsonschemaDefinitions.d.ts +1 -1
- package/dist/api/types/JsonschemaForm.d.ts +1 -1
- package/dist/api/types/LabelLabel.d.ts +1 -1
- package/dist/api/types/ModelField.d.ts +1 -1
- package/dist/api/types/ModelResponse.d.ts +2 -2
- package/dist/api/types/ModelSyncMode.d.ts +2 -1
- package/dist/api/types/ModelSyncMode.js +1 -0
- package/dist/api/types/ModelSyncResponse.d.ts +2 -2
- package/dist/api/types/ModelSyncSourceMetaResponse.d.ts +3 -0
- package/dist/api/types/Organization.d.ts +5 -0
- package/dist/api/types/{CommonOutputActor.d.ts → OutputActor.d.ts} +1 -1
- package/dist/api/types/OutputActor.js +5 -0
- package/dist/api/types/ScheduleFrequency.d.ts +1 -1
- package/dist/api/types/SchemaIdentityFunction.d.ts +1 -1
- package/dist/api/types/SourceMeta.d.ts +3 -0
- package/dist/api/types/TypesType.d.ts +1 -1
- package/dist/api/types/User.d.ts +6 -0
- package/dist/api/types/UtilFieldType.d.ts +1 -1
- package/dist/api/types/V2CreateSharedConnectionResponseEnvelope.d.ts +7 -0
- package/dist/api/types/V2CreateSharedConnectionResponseEnvelope.js +5 -0
- package/dist/api/types/V2EnricherConfiguration.d.ts +1 -1
- package/dist/api/types/V2EnricherMapping.d.ts +1 -1
- package/dist/api/types/V2ExecutionLogType.d.ts +1 -1
- package/dist/api/types/V2OrderedMapStringGithubComInvopopJsonschemaSchema.d.ts +1 -1
- package/dist/api/types/V2SampleRecord.d.ts +1 -1
- package/dist/api/types/V2SchemaConfigurationFieldsItem.d.ts +1 -1
- package/dist/api/types/V3BulkSyncSourceCapabilities.d.ts +6 -0
- package/dist/api/types/V3BulkSyncSourceCapabilities.js +5 -0
- package/dist/api/types/V4BulkSyncExecutionLogs.d.ts +6 -1
- package/dist/api/types/V4BulkSyncScheduleApi.d.ts +5 -0
- package/dist/api/types/V4ExportSyncLogsResponse.d.ts +1 -0
- package/dist/api/types/V4GlobalErrorSubscribersResponse.d.ts +1 -0
- package/dist/api/types/V4RunQueryResult.d.ts +2 -1
- package/dist/api/types/V4UserFieldRequest.d.ts +4 -0
- package/dist/api/types/WorkTaskStatus.d.ts +1 -1
- package/dist/api/types/index.d.ts +13 -6
- package/dist/api/types/index.js +13 -6
- package/dist/core/auth/BearerToken.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +3 -6
- package/dist/core/fetcher/Fetcher.js +189 -20
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/getHeader.js +2 -1
- package/dist/core/runtime/runtime.d.ts +1 -2
- package/dist/core/runtime/runtime.js +41 -52
- package/dist/environments.d.ts +1 -1
- package/dist/errors/PolytomicError.js +1 -2
- package/dist/errors/PolytomicTimeoutError.d.ts +1 -1
- package/dist/errors/PolytomicTimeoutError.js +2 -2
- package/dist/index.js +7 -17
- package/environments.d.ts +1 -1
- package/errors/PolytomicError.js +1 -2
- package/errors/PolytomicTimeoutError.d.ts +1 -1
- package/errors/PolytomicTimeoutError.js +2 -2
- package/index.js +7 -17
- package/{jest.config.mjs → jest.config.js} +1 -4
- package/package.json +17 -18
- package/core/fetcher/createRequestUrl.d.ts +0 -1
- package/core/fetcher/createRequestUrl.js +0 -12
- package/core/fetcher/getFetchFn.d.ts +0 -4
- package/core/fetcher/getFetchFn.js +0 -68
- package/core/fetcher/getRequestBody.d.ts +0 -7
- package/core/fetcher/getRequestBody.js +0 -23
- package/core/fetcher/getResponseBody.d.ts +0 -1
- package/core/fetcher/getResponseBody.js +0 -54
- package/core/fetcher/makeRequest.d.ts +0 -1
- package/core/fetcher/makeRequest.js +0 -42
- package/core/fetcher/requestWithRetries.d.ts +0 -1
- package/core/fetcher/requestWithRetries.js +0 -40
- package/core/fetcher/signals.d.ts +0 -11
- package/core/fetcher/signals.js +0 -36
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/core/json.d.ts +0 -15
- package/core/json.js +0 -24
- package/dist/core/fetcher/createRequestUrl.d.ts +0 -1
- package/dist/core/fetcher/createRequestUrl.js +0 -12
- package/dist/core/fetcher/getFetchFn.d.ts +0 -4
- package/dist/core/fetcher/getFetchFn.js +0 -68
- package/dist/core/fetcher/getRequestBody.d.ts +0 -7
- package/dist/core/fetcher/getRequestBody.js +0 -23
- package/dist/core/fetcher/getResponseBody.d.ts +0 -1
- package/dist/core/fetcher/getResponseBody.js +0 -54
- package/dist/core/fetcher/makeRequest.d.ts +0 -1
- package/dist/core/fetcher/makeRequest.js +0 -42
- package/dist/core/fetcher/requestWithRetries.d.ts +0 -1
- package/dist/core/fetcher/requestWithRetries.js +0 -40
- package/dist/core/fetcher/signals.d.ts +0 -11
- package/dist/core/fetcher/signals.js +0 -36
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/dist/core/json.d.ts +0 -15
- package/dist/core/json.js +0 -24
- package/dist/version.d.ts +0 -1
- package/reference.md +0 -6547
- package/scripts/rename-to-esm-files.js +0 -115
- package/version.d.ts +0 -1
- /package/api/{types/CommonOutputActor.js → resources/connections/client/requests/ApiRequest.js} +0 -0
- /package/{dist/api/types/CommonOutputActor.js → api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.js} +0 -0
|
@@ -18,23 +18,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) ||
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
38
28
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
29
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
30
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -59,6 +49,15 @@ class Connections {
|
|
|
59
49
|
this._options = _options;
|
|
60
50
|
}
|
|
61
51
|
/**
|
|
52
|
+
* Lists all connection types supported by this deployment.
|
|
53
|
+
*
|
|
54
|
+
* Each entry includes per-type metadata:
|
|
55
|
+
*
|
|
56
|
+
* - The available operations the connection type supports.
|
|
57
|
+
* - Its category.
|
|
58
|
+
* - Whether the connection type is enabled for the caller's organization.
|
|
59
|
+
* - Which modes (source, destination, enrichment) it can act as.
|
|
60
|
+
*
|
|
62
61
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
62
|
*
|
|
64
63
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
@@ -68,16 +67,23 @@ class Connections {
|
|
|
68
67
|
* await client.connections.getTypes()
|
|
69
68
|
*/
|
|
70
69
|
getTypes(requestOptions) {
|
|
70
|
+
var _a;
|
|
71
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
var _a, _b;
|
|
73
72
|
const _response = yield core.fetcher({
|
|
74
|
-
url: (0, url_join_1.default)((
|
|
73
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connection_types"),
|
|
75
74
|
method: "GET",
|
|
76
|
-
headers:
|
|
75
|
+
headers: {
|
|
76
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
77
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
77
78
|
? yield core.Supplier.get(this._options.version)
|
|
78
|
-
: undefined,
|
|
79
|
+
: undefined,
|
|
80
|
+
"X-Fern-Language": "JavaScript",
|
|
81
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
82
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
83
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
84
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
85
|
+
},
|
|
79
86
|
contentType: "application/json",
|
|
80
|
-
requestType: "json",
|
|
81
87
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
88
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
89
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -105,7 +111,7 @@ class Connections {
|
|
|
105
111
|
body: _response.error.rawBody,
|
|
106
112
|
});
|
|
107
113
|
case "timeout":
|
|
108
|
-
throw new errors.PolytomicTimeoutError(
|
|
114
|
+
throw new errors.PolytomicTimeoutError();
|
|
109
115
|
case "unknown":
|
|
110
116
|
throw new errors.PolytomicError({
|
|
111
117
|
message: _response.error.errorMessage,
|
|
@@ -114,7 +120,16 @@ class Connections {
|
|
|
114
120
|
});
|
|
115
121
|
}
|
|
116
122
|
/**
|
|
117
|
-
*
|
|
123
|
+
* Returns the JSON schema for a connection type.
|
|
124
|
+
*
|
|
125
|
+
* This schema is intended for building forms or validating configuration payloads
|
|
126
|
+
* client-side. It describes the structure Polytomic expects when you create or
|
|
127
|
+
* update a connection of the given type.
|
|
128
|
+
*
|
|
129
|
+
* The response is metadata about the shape of the configuration, not a live
|
|
130
|
+
* connection instance and not a set of current credential values.
|
|
131
|
+
*
|
|
132
|
+
* @param {string} id - Connection type identifier (e.g. postgresql, salesforce, hubspot).
|
|
118
133
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
134
|
*
|
|
120
135
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
@@ -125,16 +140,23 @@ class Connections {
|
|
|
125
140
|
* await client.connections.getConnectionTypeSchema("postgresql")
|
|
126
141
|
*/
|
|
127
142
|
getConnectionTypeSchema(id, requestOptions) {
|
|
143
|
+
var _a;
|
|
128
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
var _a, _b;
|
|
130
145
|
const _response = yield core.fetcher({
|
|
131
|
-
url: (0, url_join_1.default)((
|
|
146
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connection_types/${encodeURIComponent(id)}`),
|
|
132
147
|
method: "GET",
|
|
133
|
-
headers:
|
|
148
|
+
headers: {
|
|
149
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
150
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
134
151
|
? yield core.Supplier.get(this._options.version)
|
|
135
|
-
: undefined,
|
|
152
|
+
: undefined,
|
|
153
|
+
"X-Fern-Language": "JavaScript",
|
|
154
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
155
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
156
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
157
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
158
|
+
},
|
|
136
159
|
contentType: "application/json",
|
|
137
|
-
requestType: "json",
|
|
138
160
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
139
161
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
140
162
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -164,7 +186,7 @@ class Connections {
|
|
|
164
186
|
body: _response.error.rawBody,
|
|
165
187
|
});
|
|
166
188
|
case "timeout":
|
|
167
|
-
throw new errors.PolytomicTimeoutError(
|
|
189
|
+
throw new errors.PolytomicTimeoutError();
|
|
168
190
|
case "unknown":
|
|
169
191
|
throw new errors.PolytomicError({
|
|
170
192
|
message: _response.error.errorMessage,
|
|
@@ -173,6 +195,100 @@ class Connections {
|
|
|
173
195
|
});
|
|
174
196
|
}
|
|
175
197
|
/**
|
|
198
|
+
* Returns completion values for parameter fields on a connection type.
|
|
199
|
+
*
|
|
200
|
+
* This endpoint is useful during connection setup, before a connection exists or
|
|
201
|
+
* before you want to persist it. The supplied `parameters` are applied to a
|
|
202
|
+
* temporary in-memory connection shape and used to resolve dependent options.
|
|
203
|
+
*
|
|
204
|
+
* When an endpoint requires upstream authorization before it can return values,
|
|
205
|
+
* Polytomic returns an error instead of guessing. In that case, complete the
|
|
206
|
+
* authorization flow first and call the endpoint again.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} type
|
|
209
|
+
* @param {Polytomic.GetConnectionTypeParameterValuesRequestSchema} request
|
|
210
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
211
|
+
*
|
|
212
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
213
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
214
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
215
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* await client.connections.getTypeParameterValues("type", {
|
|
219
|
+
* field: "field"
|
|
220
|
+
* })
|
|
221
|
+
*/
|
|
222
|
+
getTypeParameterValues(type, request, requestOptions) {
|
|
223
|
+
var _a;
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
const _response = yield core.fetcher({
|
|
226
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connection_types/${encodeURIComponent(type)}/parameter_values`),
|
|
227
|
+
method: "POST",
|
|
228
|
+
headers: {
|
|
229
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
230
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
231
|
+
? yield core.Supplier.get(this._options.version)
|
|
232
|
+
: undefined,
|
|
233
|
+
"X-Fern-Language": "JavaScript",
|
|
234
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
235
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
236
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
237
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
238
|
+
},
|
|
239
|
+
contentType: "application/json",
|
|
240
|
+
body: request,
|
|
241
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
242
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
243
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
244
|
+
});
|
|
245
|
+
if (_response.ok) {
|
|
246
|
+
return _response.body;
|
|
247
|
+
}
|
|
248
|
+
if (_response.error.reason === "status-code") {
|
|
249
|
+
switch (_response.error.statusCode) {
|
|
250
|
+
case 400:
|
|
251
|
+
throw new Polytomic.BadRequestError(_response.error.body);
|
|
252
|
+
case 401:
|
|
253
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
254
|
+
case 404:
|
|
255
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
256
|
+
case 500:
|
|
257
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
258
|
+
default:
|
|
259
|
+
throw new errors.PolytomicError({
|
|
260
|
+
statusCode: _response.error.statusCode,
|
|
261
|
+
body: _response.error.body,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
switch (_response.error.reason) {
|
|
266
|
+
case "non-json":
|
|
267
|
+
throw new errors.PolytomicError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.rawBody,
|
|
270
|
+
});
|
|
271
|
+
case "timeout":
|
|
272
|
+
throw new errors.PolytomicTimeoutError();
|
|
273
|
+
case "unknown":
|
|
274
|
+
throw new errors.PolytomicError({
|
|
275
|
+
message: _response.error.errorMessage,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Lists every connection in the caller's organization, with sensitive fields redacted.
|
|
282
|
+
*
|
|
283
|
+
* Sensitive configuration values — passwords, API tokens, private keys — are
|
|
284
|
+
* redacted from all responses. To understand which fields a connection type
|
|
285
|
+
* exposes, consult the parameter schema returned by
|
|
286
|
+
* [`GET /api/connection_types`](../../api-reference/connections/get-types).
|
|
287
|
+
*
|
|
288
|
+
* To inspect the data objects available on a specific connection, use
|
|
289
|
+
* [`POST /api/connections/{id}/schemas/refresh`](../../api-reference/schemas/refresh)
|
|
290
|
+
* followed by [`GET /api/connections/{id}/schemas/status`](../../api-reference/schemas/get-status).
|
|
291
|
+
*
|
|
176
292
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
293
|
*
|
|
178
294
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
@@ -182,16 +298,23 @@ class Connections {
|
|
|
182
298
|
* await client.connections.list()
|
|
183
299
|
*/
|
|
184
300
|
list(requestOptions) {
|
|
301
|
+
var _a;
|
|
185
302
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
-
var _a, _b;
|
|
187
303
|
const _response = yield core.fetcher({
|
|
188
|
-
url: (0, url_join_1.default)((
|
|
304
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections"),
|
|
189
305
|
method: "GET",
|
|
190
|
-
headers:
|
|
306
|
+
headers: {
|
|
307
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
308
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
191
309
|
? yield core.Supplier.get(this._options.version)
|
|
192
|
-
: undefined,
|
|
310
|
+
: undefined,
|
|
311
|
+
"X-Fern-Language": "JavaScript",
|
|
312
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
313
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
314
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
315
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
316
|
+
},
|
|
193
317
|
contentType: "application/json",
|
|
194
|
-
requestType: "json",
|
|
195
318
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
196
319
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
197
320
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -219,7 +342,7 @@ class Connections {
|
|
|
219
342
|
body: _response.error.rawBody,
|
|
220
343
|
});
|
|
221
344
|
case "timeout":
|
|
222
|
-
throw new errors.PolytomicTimeoutError(
|
|
345
|
+
throw new errors.PolytomicTimeoutError();
|
|
223
346
|
case "unknown":
|
|
224
347
|
throw new errors.PolytomicError({
|
|
225
348
|
message: _response.error.errorMessage,
|
|
@@ -228,6 +351,18 @@ class Connections {
|
|
|
228
351
|
});
|
|
229
352
|
}
|
|
230
353
|
/**
|
|
354
|
+
* Creates a new connection of the specified type.
|
|
355
|
+
*
|
|
356
|
+
* Use [`GET /api/connection_types`](../../api-reference/connections/get-types) to retrieve the
|
|
357
|
+
* list of available types and their parameter schemas. The `configuration`
|
|
358
|
+
* object is type-specific; consult the [integration
|
|
359
|
+
* guides](../../guides/configuring-your-connections/overview)
|
|
360
|
+
* for the required and optional fields for each type.
|
|
361
|
+
*
|
|
362
|
+
* > 📘 Polytomic validates the connection against the upstream service
|
|
363
|
+
* > immediately on creation. The request will fail if the credentials or
|
|
364
|
+
* > endpoint cannot be reached.
|
|
365
|
+
*
|
|
231
366
|
* @param {Polytomic.CreateConnectionRequestSchema} request
|
|
232
367
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
233
368
|
*
|
|
@@ -251,16 +386,23 @@ class Connections {
|
|
|
251
386
|
* })
|
|
252
387
|
*/
|
|
253
388
|
create(request, requestOptions) {
|
|
389
|
+
var _a;
|
|
254
390
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
var _a, _b;
|
|
256
391
|
const _response = yield core.fetcher({
|
|
257
|
-
url: (0, url_join_1.default)((
|
|
392
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections"),
|
|
258
393
|
method: "POST",
|
|
259
|
-
headers:
|
|
394
|
+
headers: {
|
|
395
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
396
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
260
397
|
? yield core.Supplier.get(this._options.version)
|
|
261
|
-
: undefined,
|
|
398
|
+
: undefined,
|
|
399
|
+
"X-Fern-Language": "JavaScript",
|
|
400
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
401
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
402
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
403
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
404
|
+
},
|
|
262
405
|
contentType: "application/json",
|
|
263
|
-
requestType: "json",
|
|
264
406
|
body: request,
|
|
265
407
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
266
408
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -295,7 +437,7 @@ class Connections {
|
|
|
295
437
|
body: _response.error.rawBody,
|
|
296
438
|
});
|
|
297
439
|
case "timeout":
|
|
298
|
-
throw new errors.PolytomicTimeoutError(
|
|
440
|
+
throw new errors.PolytomicTimeoutError();
|
|
299
441
|
case "unknown":
|
|
300
442
|
throw new errors.PolytomicError({
|
|
301
443
|
message: _response.error.errorMessage,
|
|
@@ -304,15 +446,11 @@ class Connections {
|
|
|
304
446
|
});
|
|
305
447
|
}
|
|
306
448
|
/**
|
|
307
|
-
* Creates a
|
|
308
|
-
*
|
|
309
|
-
* This endpoint configures a Polytomic Connect request and returns the URL to
|
|
310
|
-
* redirect users to. This allows embedding Polytomic connection authorization in
|
|
311
|
-
* other applications.
|
|
449
|
+
* Creates a Polytomic Connect session and returns a redirect URL that embeds the Connect modal.
|
|
312
450
|
*
|
|
313
451
|
* See also:
|
|
314
452
|
*
|
|
315
|
-
* - [Embedding authentication](
|
|
453
|
+
* - [Embedding authentication](../../../guides/embedding-authentication), a guide to using Polytomic Connect.
|
|
316
454
|
*
|
|
317
455
|
* @param {Polytomic.ConnectCardRequest} request
|
|
318
456
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -329,16 +467,23 @@ class Connections {
|
|
|
329
467
|
* })
|
|
330
468
|
*/
|
|
331
469
|
connect(request, requestOptions) {
|
|
470
|
+
var _a;
|
|
332
471
|
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
-
var _a, _b;
|
|
334
472
|
const _response = yield core.fetcher({
|
|
335
|
-
url: (0, url_join_1.default)((
|
|
473
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections/connect/"),
|
|
336
474
|
method: "POST",
|
|
337
|
-
headers:
|
|
475
|
+
headers: {
|
|
476
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
477
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
338
478
|
? yield core.Supplier.get(this._options.version)
|
|
339
|
-
: undefined,
|
|
479
|
+
: undefined,
|
|
480
|
+
"X-Fern-Language": "JavaScript",
|
|
481
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
482
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
483
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
484
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
485
|
+
},
|
|
340
486
|
contentType: "application/json",
|
|
341
|
-
requestType: "json",
|
|
342
487
|
body: request,
|
|
343
488
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
489
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -371,7 +516,7 @@ class Connections {
|
|
|
371
516
|
body: _response.error.rawBody,
|
|
372
517
|
});
|
|
373
518
|
case "timeout":
|
|
374
|
-
throw new errors.PolytomicTimeoutError(
|
|
519
|
+
throw new errors.PolytomicTimeoutError();
|
|
375
520
|
case "unknown":
|
|
376
521
|
throw new errors.PolytomicError({
|
|
377
522
|
message: _response.error.errorMessage,
|
|
@@ -382,6 +527,17 @@ class Connections {
|
|
|
382
527
|
/**
|
|
383
528
|
* Tests a connection configuration.
|
|
384
529
|
*
|
|
530
|
+
* This endpoint is useful for setup flows that want to verify credentials before
|
|
531
|
+
* persisting them.
|
|
532
|
+
*
|
|
533
|
+
* If you provide `connection_id`, Polytomic starts from the saved configuration
|
|
534
|
+
* for that connection and then applies the request's `configuration` values on
|
|
535
|
+
* top. This lets callers test a partial change without resending every existing
|
|
536
|
+
* field.
|
|
537
|
+
*
|
|
538
|
+
* The request does not persist any configuration changes even when validation
|
|
539
|
+
* succeeds.
|
|
540
|
+
*
|
|
385
541
|
* @param {Polytomic.TestConnectionRequest} request
|
|
386
542
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
387
543
|
*
|
|
@@ -403,16 +559,23 @@ class Connections {
|
|
|
403
559
|
* })
|
|
404
560
|
*/
|
|
405
561
|
testConnection(request, requestOptions) {
|
|
562
|
+
var _a;
|
|
406
563
|
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
var _a, _b;
|
|
408
564
|
const _response = yield core.fetcher({
|
|
409
|
-
url: (0, url_join_1.default)((
|
|
565
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections/test"),
|
|
410
566
|
method: "POST",
|
|
411
|
-
headers:
|
|
567
|
+
headers: {
|
|
568
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
569
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
412
570
|
? yield core.Supplier.get(this._options.version)
|
|
413
|
-
: undefined,
|
|
571
|
+
: undefined,
|
|
572
|
+
"X-Fern-Language": "JavaScript",
|
|
573
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
574
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
575
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
576
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
577
|
+
},
|
|
414
578
|
contentType: "application/json",
|
|
415
|
-
requestType: "json",
|
|
416
579
|
body: request,
|
|
417
580
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
418
581
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -445,7 +608,7 @@ class Connections {
|
|
|
445
608
|
body: _response.error.rawBody,
|
|
446
609
|
});
|
|
447
610
|
case "timeout":
|
|
448
|
-
throw new errors.PolytomicTimeoutError(
|
|
611
|
+
throw new errors.PolytomicTimeoutError();
|
|
449
612
|
case "unknown":
|
|
450
613
|
throw new errors.PolytomicError({
|
|
451
614
|
message: _response.error.errorMessage,
|
|
@@ -454,6 +617,13 @@ class Connections {
|
|
|
454
617
|
});
|
|
455
618
|
}
|
|
456
619
|
/**
|
|
620
|
+
* Returns a single connection by ID, with sensitive fields redacted.
|
|
621
|
+
*
|
|
622
|
+
* To inspect the schemas available on this connection, trigger a refresh with
|
|
623
|
+
* [`POST /api/connections/{id}/schemas/refresh`](../../../api-reference/schemas/refresh) and
|
|
624
|
+
* track progress via
|
|
625
|
+
* [`GET /api/connections/{id}/schemas/status`](../../../api-reference/schemas/get-status).
|
|
626
|
+
*
|
|
457
627
|
* @param {string} id
|
|
458
628
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
459
629
|
*
|
|
@@ -465,16 +635,23 @@ class Connections {
|
|
|
465
635
|
* await client.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
466
636
|
*/
|
|
467
637
|
get(id, requestOptions) {
|
|
638
|
+
var _a;
|
|
468
639
|
return __awaiter(this, void 0, void 0, function* () {
|
|
469
|
-
var _a, _b;
|
|
470
640
|
const _response = yield core.fetcher({
|
|
471
|
-
url: (0, url_join_1.default)((
|
|
641
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}`),
|
|
472
642
|
method: "GET",
|
|
473
|
-
headers:
|
|
643
|
+
headers: {
|
|
644
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
645
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
474
646
|
? yield core.Supplier.get(this._options.version)
|
|
475
|
-
: undefined,
|
|
647
|
+
: undefined,
|
|
648
|
+
"X-Fern-Language": "JavaScript",
|
|
649
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
650
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
651
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
652
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
653
|
+
},
|
|
476
654
|
contentType: "application/json",
|
|
477
|
-
requestType: "json",
|
|
478
655
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
479
656
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
480
657
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -504,7 +681,7 @@ class Connections {
|
|
|
504
681
|
body: _response.error.rawBody,
|
|
505
682
|
});
|
|
506
683
|
case "timeout":
|
|
507
|
-
throw new errors.PolytomicTimeoutError(
|
|
684
|
+
throw new errors.PolytomicTimeoutError();
|
|
508
685
|
case "unknown":
|
|
509
686
|
throw new errors.PolytomicError({
|
|
510
687
|
message: _response.error.errorMessage,
|
|
@@ -513,6 +690,21 @@ class Connections {
|
|
|
513
690
|
});
|
|
514
691
|
}
|
|
515
692
|
/**
|
|
693
|
+
* Updates a connection's configuration.
|
|
694
|
+
*
|
|
695
|
+
* Updating a connection is a **full replacement** of its configuration. Any
|
|
696
|
+
* `configuration` field you omit is cleared. To make a partial change, fetch
|
|
697
|
+
* the current connection with
|
|
698
|
+
* [`GET /api/connections/{id}`](../../../api-reference/connections/get), apply your edits, and send the
|
|
699
|
+
* complete object back.
|
|
700
|
+
*
|
|
701
|
+
* > 📘 The connection is re-validated against the upstream service after every
|
|
702
|
+
* > update. The request will fail if the new credentials or endpoint cannot be
|
|
703
|
+
* > reached.
|
|
704
|
+
*
|
|
705
|
+
* Syncs that are already running when the update is submitted are not
|
|
706
|
+
* interrupted; the updated configuration takes effect on their next execution.
|
|
707
|
+
*
|
|
516
708
|
* @param {string} id
|
|
517
709
|
* @param {Polytomic.UpdateConnectionRequestSchema} request
|
|
518
710
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -537,16 +729,23 @@ class Connections {
|
|
|
537
729
|
* })
|
|
538
730
|
*/
|
|
539
731
|
update(id, request, requestOptions) {
|
|
732
|
+
var _a;
|
|
540
733
|
return __awaiter(this, void 0, void 0, function* () {
|
|
541
|
-
var _a, _b;
|
|
542
734
|
const _response = yield core.fetcher({
|
|
543
|
-
url: (0, url_join_1.default)((
|
|
735
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}`),
|
|
544
736
|
method: "PUT",
|
|
545
|
-
headers:
|
|
737
|
+
headers: {
|
|
738
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
739
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
546
740
|
? yield core.Supplier.get(this._options.version)
|
|
547
|
-
: undefined,
|
|
741
|
+
: undefined,
|
|
742
|
+
"X-Fern-Language": "JavaScript",
|
|
743
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
744
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
745
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
746
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
747
|
+
},
|
|
548
748
|
contentType: "application/json",
|
|
549
|
-
requestType: "json",
|
|
550
749
|
body: request,
|
|
551
750
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
552
751
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -583,7 +782,7 @@ class Connections {
|
|
|
583
782
|
body: _response.error.rawBody,
|
|
584
783
|
});
|
|
585
784
|
case "timeout":
|
|
586
|
-
throw new errors.PolytomicTimeoutError(
|
|
785
|
+
throw new errors.PolytomicTimeoutError();
|
|
587
786
|
case "unknown":
|
|
588
787
|
throw new errors.PolytomicError({
|
|
589
788
|
message: _response.error.errorMessage,
|
|
@@ -592,6 +791,13 @@ class Connections {
|
|
|
592
791
|
});
|
|
593
792
|
}
|
|
594
793
|
/**
|
|
794
|
+
* Deletes a connection.
|
|
795
|
+
*
|
|
796
|
+
* > 🚧 Deleting a connection that is referenced by fieldsets, syncs, bulk
|
|
797
|
+
* > syncs, or schedules returns `422 connection in use` unless you pass
|
|
798
|
+
* > `force=true`. With `force=true`, the API deletes those dependent
|
|
799
|
+
* > resources before removing the connection.
|
|
800
|
+
*
|
|
595
801
|
* @param {string} id
|
|
596
802
|
* @param {Polytomic.ConnectionsRemoveRequest} request
|
|
597
803
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -607,23 +813,30 @@ class Connections {
|
|
|
607
813
|
* force: true
|
|
608
814
|
* })
|
|
609
815
|
*/
|
|
610
|
-
remove(
|
|
611
|
-
|
|
612
|
-
|
|
816
|
+
remove(id, request = {}, requestOptions) {
|
|
817
|
+
var _a;
|
|
818
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
613
819
|
const { force } = request;
|
|
614
820
|
const _queryParams = {};
|
|
615
821
|
if (force != null) {
|
|
616
822
|
_queryParams["force"] = force.toString();
|
|
617
823
|
}
|
|
618
824
|
const _response = yield core.fetcher({
|
|
619
|
-
url: (0, url_join_1.default)((
|
|
825
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}`),
|
|
620
826
|
method: "DELETE",
|
|
621
|
-
headers:
|
|
827
|
+
headers: {
|
|
828
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
829
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
622
830
|
? yield core.Supplier.get(this._options.version)
|
|
623
|
-
: undefined,
|
|
831
|
+
: undefined,
|
|
832
|
+
"X-Fern-Language": "JavaScript",
|
|
833
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
834
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
835
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
836
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
837
|
+
},
|
|
624
838
|
contentType: "application/json",
|
|
625
839
|
queryParameters: _queryParams,
|
|
626
|
-
requestType: "json",
|
|
627
840
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
628
841
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
629
842
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -657,7 +870,7 @@ class Connections {
|
|
|
657
870
|
body: _response.error.rawBody,
|
|
658
871
|
});
|
|
659
872
|
case "timeout":
|
|
660
|
-
throw new errors.PolytomicTimeoutError(
|
|
873
|
+
throw new errors.PolytomicTimeoutError();
|
|
661
874
|
case "unknown":
|
|
662
875
|
throw new errors.PolytomicError({
|
|
663
876
|
message: _response.error.errorMessage,
|
|
@@ -666,6 +879,17 @@ class Connections {
|
|
|
666
879
|
});
|
|
667
880
|
}
|
|
668
881
|
/**
|
|
882
|
+
* Returns completion values for parameter fields on a persisted connection.
|
|
883
|
+
*
|
|
884
|
+
* Use this endpoint when the available options for one parameter depend on the
|
|
885
|
+
* connection's saved credentials or previously selected settings. For example,
|
|
886
|
+
* after a connection is authorized, the upstream service may be able to return
|
|
887
|
+
* lists of databases, schemas, or similar selectable values.
|
|
888
|
+
*
|
|
889
|
+
* For new setup flows, prefer
|
|
890
|
+
* [`POST /api/connection_types/{type}/parameter_values`](../../../../api-reference/connections/get-type-parameter-values),
|
|
891
|
+
* which lets you resolve completions before the connection has been created.
|
|
892
|
+
*
|
|
669
893
|
* @param {string} id
|
|
670
894
|
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
671
895
|
*
|
|
@@ -677,16 +901,23 @@ class Connections {
|
|
|
677
901
|
* await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
678
902
|
*/
|
|
679
903
|
getParameterValues(id, requestOptions) {
|
|
904
|
+
var _a;
|
|
680
905
|
return __awaiter(this, void 0, void 0, function* () {
|
|
681
|
-
var _a, _b;
|
|
682
906
|
const _response = yield core.fetcher({
|
|
683
|
-
url: (0, url_join_1.default)((
|
|
907
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/parameter_values`),
|
|
684
908
|
method: "GET",
|
|
685
|
-
headers:
|
|
909
|
+
headers: {
|
|
910
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
911
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
686
912
|
? yield core.Supplier.get(this._options.version)
|
|
687
|
-
: undefined,
|
|
913
|
+
: undefined,
|
|
914
|
+
"X-Fern-Language": "JavaScript",
|
|
915
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
916
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
917
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
918
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
919
|
+
},
|
|
688
920
|
contentType: "application/json",
|
|
689
|
-
requestType: "json",
|
|
690
921
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
691
922
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
692
923
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -716,7 +947,163 @@ class Connections {
|
|
|
716
947
|
body: _response.error.rawBody,
|
|
717
948
|
});
|
|
718
949
|
case "timeout":
|
|
719
|
-
throw new errors.PolytomicTimeoutError(
|
|
950
|
+
throw new errors.PolytomicTimeoutError();
|
|
951
|
+
case "unknown":
|
|
952
|
+
throw new errors.PolytomicError({
|
|
953
|
+
message: _response.error.errorMessage,
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Shares a connection with another organization in the caller's partner account.
|
|
960
|
+
*
|
|
961
|
+
* > 🚧 Requires partner key
|
|
962
|
+
* >
|
|
963
|
+
* > Shared connections can only be created by using [partner keys](../../../../guides/obtaining-api-keys#partner-keys).
|
|
964
|
+
*
|
|
965
|
+
* @param {string} parentConnectionId
|
|
966
|
+
* @param {Polytomic.ApiRequest} request
|
|
967
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
968
|
+
*
|
|
969
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
970
|
+
* @throws {@link Polytomic.ForbiddenError}
|
|
971
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
972
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
973
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
974
|
+
*
|
|
975
|
+
* @example
|
|
976
|
+
* await client.connections.createSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
977
|
+
* child_organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
978
|
+
* })
|
|
979
|
+
*/
|
|
980
|
+
createSharedConnection(parentConnectionId, request, requestOptions) {
|
|
981
|
+
var _a;
|
|
982
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
983
|
+
const _response = yield core.fetcher({
|
|
984
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(parentConnectionId)}/share`),
|
|
985
|
+
method: "POST",
|
|
986
|
+
headers: {
|
|
987
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
988
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
989
|
+
? yield core.Supplier.get(this._options.version)
|
|
990
|
+
: undefined,
|
|
991
|
+
"X-Fern-Language": "JavaScript",
|
|
992
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
993
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
994
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
995
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
996
|
+
},
|
|
997
|
+
contentType: "application/json",
|
|
998
|
+
body: request,
|
|
999
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1000
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1001
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1002
|
+
});
|
|
1003
|
+
if (_response.ok) {
|
|
1004
|
+
return _response.body;
|
|
1005
|
+
}
|
|
1006
|
+
if (_response.error.reason === "status-code") {
|
|
1007
|
+
switch (_response.error.statusCode) {
|
|
1008
|
+
case 401:
|
|
1009
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
1010
|
+
case 403:
|
|
1011
|
+
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
1012
|
+
case 404:
|
|
1013
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
1014
|
+
case 422:
|
|
1015
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
1016
|
+
case 500:
|
|
1017
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
1018
|
+
default:
|
|
1019
|
+
throw new errors.PolytomicError({
|
|
1020
|
+
statusCode: _response.error.statusCode,
|
|
1021
|
+
body: _response.error.body,
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
switch (_response.error.reason) {
|
|
1026
|
+
case "non-json":
|
|
1027
|
+
throw new errors.PolytomicError({
|
|
1028
|
+
statusCode: _response.error.statusCode,
|
|
1029
|
+
body: _response.error.rawBody,
|
|
1030
|
+
});
|
|
1031
|
+
case "timeout":
|
|
1032
|
+
throw new errors.PolytomicTimeoutError();
|
|
1033
|
+
case "unknown":
|
|
1034
|
+
throw new errors.PolytomicError({
|
|
1035
|
+
message: _response.error.errorMessage,
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Lists shared copies of a connection.
|
|
1042
|
+
*
|
|
1043
|
+
* @param {string} parentConnectionId
|
|
1044
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
1045
|
+
*
|
|
1046
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
1047
|
+
* @throws {@link Polytomic.ForbiddenError}
|
|
1048
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
1049
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
1050
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
1051
|
+
*
|
|
1052
|
+
* @example
|
|
1053
|
+
* await client.connections.listSharedConnections("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1054
|
+
*/
|
|
1055
|
+
listSharedConnections(parentConnectionId, requestOptions) {
|
|
1056
|
+
var _a;
|
|
1057
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1058
|
+
const _response = yield core.fetcher({
|
|
1059
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(parentConnectionId)}/shared`),
|
|
1060
|
+
method: "GET",
|
|
1061
|
+
headers: {
|
|
1062
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
1063
|
+
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
1064
|
+
? yield core.Supplier.get(this._options.version)
|
|
1065
|
+
: undefined,
|
|
1066
|
+
"X-Fern-Language": "JavaScript",
|
|
1067
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
1068
|
+
"X-Fern-SDK-Version": "1.18.1",
|
|
1069
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
1070
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
1071
|
+
},
|
|
1072
|
+
contentType: "application/json",
|
|
1073
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1074
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1075
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1076
|
+
});
|
|
1077
|
+
if (_response.ok) {
|
|
1078
|
+
return _response.body;
|
|
1079
|
+
}
|
|
1080
|
+
if (_response.error.reason === "status-code") {
|
|
1081
|
+
switch (_response.error.statusCode) {
|
|
1082
|
+
case 401:
|
|
1083
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
1084
|
+
case 403:
|
|
1085
|
+
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
1086
|
+
case 404:
|
|
1087
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
1088
|
+
case 422:
|
|
1089
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
1090
|
+
case 500:
|
|
1091
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
1092
|
+
default:
|
|
1093
|
+
throw new errors.PolytomicError({
|
|
1094
|
+
statusCode: _response.error.statusCode,
|
|
1095
|
+
body: _response.error.body,
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
switch (_response.error.reason) {
|
|
1100
|
+
case "non-json":
|
|
1101
|
+
throw new errors.PolytomicError({
|
|
1102
|
+
statusCode: _response.error.statusCode,
|
|
1103
|
+
body: _response.error.rawBody,
|
|
1104
|
+
});
|
|
1105
|
+
case "timeout":
|
|
1106
|
+
throw new errors.PolytomicTimeoutError();
|
|
720
1107
|
case "unknown":
|
|
721
1108
|
throw new errors.PolytomicError({
|
|
722
1109
|
message: _response.error.errorMessage,
|