polytomic 1.11.3 → 1.14.4
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 +20 -15
- package/Client.js +9 -9
- package/LICENSE +1 -1
- package/api/errors/BadRequestError.js +17 -7
- package/api/errors/ConflictError.js +17 -7
- package/api/errors/ForbiddenError.js +17 -7
- package/api/errors/InternalServerError.js +17 -7
- package/api/errors/NotFoundError.js +17 -7
- package/api/errors/UnauthorizedError.js +17 -7
- package/api/errors/UnprocessableEntityError.js +17 -7
- package/api/resources/bulkSync/client/Client.d.ts +47 -6
- package/api/resources/bulkSync/client/Client.js +135 -157
- package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +11 -3
- package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +11 -3
- package/api/resources/bulkSync/resources/executions/client/Client.d.ts +13 -2
- package/api/resources/bulkSync/resources/executions/client/Client.js +75 -79
- package/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +18 -0
- package/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +1 -0
- package/api/resources/bulkSync/resources/index.d.ts +2 -0
- package/api/resources/bulkSync/resources/index.js +20 -8
- package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +113 -0
- package/api/resources/bulkSync/resources/schedules/client/Client.js +398 -0
- package/api/resources/bulkSync/resources/schedules/client/index.d.ts +1 -0
- package/api/resources/bulkSync/resources/schedules/client/index.js +17 -0
- package/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +15 -0
- package/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +15 -0
- package/api/resources/bulkSync/resources/schedules/client/requests/index.d.ts +2 -0
- package/api/resources/bulkSync/resources/schedules/client/requests/index.js +2 -0
- package/api/resources/bulkSync/resources/schedules/index.d.ts +1 -0
- package/api/resources/bulkSync/resources/schedules/index.js +17 -0
- package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +5 -0
- package/api/resources/bulkSync/resources/schemas/client/Client.js +49 -66
- package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +3 -1
- 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 +41 -2
- package/api/resources/connections/client/Client.js +159 -128
- package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +7 -0
- package/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +3 -1
- package/api/resources/connections/client/requests/TestConnectionRequest.d.ts +24 -0
- package/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +3 -1
- package/api/resources/connections/client/requests/index.d.ts +1 -0
- package/api/resources/events/client/Client.d.ts +7 -2
- package/api/resources/events/client/Client.js +33 -37
- package/api/resources/events/client/requests/EventsListRequest.d.ts +2 -2
- package/api/resources/identity/client/Client.d.ts +7 -0
- package/api/resources/identity/client/Client.js +25 -20
- package/api/resources/index.d.ts +2 -1
- package/api/resources/index.js +20 -9
- package/api/resources/jobs/client/Client.d.ts +7 -2
- package/api/resources/jobs/client/Client.js +25 -22
- package/api/resources/modelSync/client/Client.d.ts +83 -52
- package/api/resources/modelSync/client/Client.js +228 -403
- package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +14 -5
- package/api/resources/modelSync/client/requests/ModelSyncListRequest.d.ts +1 -1
- package/api/resources/modelSync/client/requests/StartModelSyncRequest.d.ts +1 -0
- package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +14 -5
- package/api/resources/modelSync/client/requests/index.d.ts +0 -2
- package/api/resources/modelSync/resources/executions/client/Client.d.ts +36 -8
- package/api/resources/modelSync/resources/executions/client/Client.js +137 -68
- package/api/resources/modelSync/resources/executions/client/index.d.ts +1 -1
- package/api/resources/modelSync/resources/executions/client/index.js +15 -0
- package/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +16 -0
- package/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.js +5 -0
- package/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +13 -0
- package/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.js +5 -0
- package/api/resources/modelSync/resources/executions/client/requests/index.d.ts +2 -0
- package/api/resources/modelSync/resources/executions/client/requests/index.js +2 -0
- package/api/resources/modelSync/resources/index.d.ts +3 -0
- package/api/resources/modelSync/resources/index.js +23 -7
- package/api/resources/modelSync/resources/targets/client/Client.d.ts +143 -0
- package/api/resources/modelSync/resources/targets/client/Client.js +395 -0
- package/api/resources/modelSync/resources/targets/client/index.d.ts +1 -0
- package/api/resources/modelSync/resources/targets/client/index.js +17 -0
- package/api/resources/modelSync/{client/requests/ModelSyncGetTargetFieldsRequest.d.ts → resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts} +1 -1
- package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.js +5 -0
- package/{dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts → api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts} +1 -1
- package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.js +5 -0
- package/api/resources/modelSync/resources/targets/client/requests/index.d.ts +2 -0
- package/api/resources/modelSync/resources/targets/client/requests/index.js +2 -0
- package/api/resources/modelSync/resources/targets/index.d.ts +1 -0
- package/api/resources/modelSync/resources/targets/index.js +17 -0
- package/api/resources/models/client/Client.d.ts +5 -0
- package/api/resources/models/client/Client.js +83 -135
- package/api/resources/organization/client/Client.d.ts +7 -0
- package/api/resources/organization/client/Client.js +53 -72
- package/api/resources/permissions/client/Client.d.ts +7 -2
- package/api/resources/permissions/resources/index.js +17 -7
- package/api/resources/permissions/resources/policies/client/Client.d.ts +5 -0
- package/api/resources/permissions/resources/policies/client/Client.js +47 -72
- package/api/resources/permissions/resources/roles/client/Client.d.ts +5 -0
- package/api/resources/permissions/resources/roles/client/Client.js +47 -72
- package/api/resources/queryRunner/client/Client.d.ts +5 -0
- package/api/resources/queryRunner/client/Client.js +33 -37
- package/api/resources/schemas/client/Client.d.ts +68 -0
- package/api/resources/schemas/client/Client.js +302 -59
- package/api/resources/schemas/client/index.d.ts +1 -1
- package/api/resources/schemas/client/index.js +15 -0
- package/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +11 -0
- package/api/resources/schemas/client/requests/SetPrimaryKeysRequest.js +5 -0
- package/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +11 -0
- package/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.js +5 -0
- package/api/resources/schemas/client/requests/index.d.ts +2 -0
- package/api/resources/schemas/client/requests/index.js +2 -0
- package/api/resources/users/client/Client.d.ts +5 -0
- package/api/resources/users/client/Client.js +55 -87
- package/api/resources/webhooks/client/Client.d.ts +33 -4
- package/api/resources/webhooks/client/Client.js +169 -76
- package/api/types/BackendConnectionCapabilities.d.ts +9 -0
- package/api/types/BackendConnectionCapabilities.js +5 -0
- package/api/types/BackendOAuthPrompt.d.ts +8 -0
- package/api/types/BackendOAuthPrompt.js +5 -0
- package/api/types/BulkBulkSyncSchedule.d.ts +20 -0
- package/api/types/BulkBulkSyncSchedule.js +5 -0
- package/api/types/BulkDiscover.d.ts +1 -1
- package/api/types/BulkExecutionStatus.d.ts +2 -1
- package/api/types/BulkExecutionStatus.js +1 -0
- package/api/types/BulkFetchMode.d.ts +1 -1
- package/api/types/BulkField.d.ts +2 -0
- package/api/types/BulkNormalizeNames.d.ts +9 -0
- package/api/types/BulkNormalizeNames.js +11 -0
- package/api/types/BulkSchema.d.ts +1 -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/BulkSyncExecution.d.ts +6 -0
- package/api/types/BulkSyncMode.d.ts +11 -0
- package/api/types/BulkSyncMode.js +10 -0
- package/api/types/BulkSyncResponse.d.ts +10 -1
- package/api/types/BulkSyncSchemaExecution.d.ts +3 -0
- package/api/types/CancelModelSyncResponse.d.ts +6 -0
- package/api/types/CancelModelSyncResponse.js +5 -0
- package/api/types/CancelModelSyncResponseEnvelope.d.ts +7 -0
- package/api/types/CancelModelSyncResponseEnvelope.js +5 -0
- package/api/types/ConnectCardResponse.d.ts +1 -0
- package/api/types/ConnectionResponseSchema.d.ts +5 -0
- package/api/types/ConnectionType.d.ts +6 -0
- package/api/types/ConnectionTypeSchema.d.ts +1 -0
- package/api/types/CreateConnectionResponseSchema.d.ts +3 -0
- package/api/types/EventBody.d.ts +1 -1
- package/api/types/ExecutionCounts.d.ts +2 -0
- package/api/types/ExecutionStatus.d.ts +1 -1
- package/api/types/FilterFieldReferenceType.d.ts +1 -1
- package/api/types/FilterFunction.d.ts +3 -1
- package/api/types/FilterFunction.js +2 -0
- package/api/types/GetIdentityResponseSchema.d.ts +7 -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/ListBulkSyncExecutionsEnvelope.d.ts +1 -0
- package/api/types/ListExecutionResponseEnvelope.d.ts +1 -0
- package/api/types/ModelField.d.ts +4 -0
- package/api/types/ModelSyncField.d.ts +2 -0
- package/api/types/{SyncMode.d.ts → ModelSyncMode.d.ts} +2 -4
- package/{dist/api/types/SyncMode.js → api/types/ModelSyncMode.js} +2 -4
- package/api/types/ModelSyncResponse.d.ts +6 -1
- package/api/types/PaginationDetails.d.ts +6 -0
- package/api/types/PaginationDetails.js +5 -0
- package/api/types/ScheduleEnvelope.d.ts +7 -0
- package/api/types/ScheduleEnvelope.js +5 -0
- package/api/types/ScheduleFrequency.d.ts +1 -1
- package/api/types/SchedulesEnvelope.d.ts +7 -0
- package/api/types/SchedulesEnvelope.js +5 -0
- package/api/types/SchemaField.d.ts +2 -0
- package/api/types/SchemaIdentityFunction.d.ts +3 -1
- package/api/types/SchemaIdentityFunction.js +2 -0
- package/api/types/SchemaPrimaryKeyOverrideInput.d.ts +7 -0
- package/api/types/SchemaPrimaryKeyOverrideInput.js +5 -0
- package/api/types/StartModelSyncResponseSchema.d.ts +1 -0
- package/api/types/SupportedBulkMode.d.ts +1 -1
- package/api/types/SupportedMode.d.ts +1 -1
- package/api/types/SyncDestinationProperties.d.ts +1 -0
- package/api/types/Target.d.ts +4 -1
- package/api/types/TargetCreateInput.d.ts +11 -0
- package/api/types/TargetCreateInput.js +5 -0
- package/api/types/TargetField.d.ts +1 -0
- package/api/types/TypesType.d.ts +1 -1
- package/api/types/UpdateBulkField.d.ts +9 -0
- package/api/types/UpdateBulkField.js +5 -0
- package/api/types/UtilEnumValue.d.ts +7 -0
- package/api/types/UtilEnumValue.js +5 -0
- package/api/types/UtilFieldType.d.ts +1 -1
- package/api/types/V2ConnectionForm.d.ts +7 -0
- package/api/types/V2ConnectionForm.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/V4BulkSyncExecutionLogs.d.ts +1 -1
- package/api/types/V4BulkSyncScheduleApi.d.ts +13 -0
- package/api/types/V4BulkSyncScheduleApi.js +5 -0
- package/api/types/V4TargetCreator.d.ts +10 -0
- package/api/types/V4TargetCreator.js +5 -0
- package/api/types/V4TargetObjectsResponseEnvelope.d.ts +1 -0
- package/api/types/V4TargetPropertyValues.d.ts +14 -0
- package/api/types/V4TargetPropertyValues.js +5 -0
- package/api/types/V4TargetPropertyValuesEnvelope.d.ts +7 -0
- package/api/types/V4TargetPropertyValuesEnvelope.js +5 -0
- package/api/types/V4UserFieldRequest.d.ts +10 -0
- package/api/types/V4UserFieldRequest.js +5 -0
- package/api/types/Webhook.d.ts +1 -0
- package/api/types/WorkTaskStatus.d.ts +1 -1
- package/api/types/index.d.ts +21 -1
- package/api/types/index.js +21 -1
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +6 -3
- package/core/fetcher/Fetcher.js +20 -189
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +52 -41
- package/dist/Client.d.ts +20 -15
- package/dist/Client.js +9 -9
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/ConflictError.js +17 -7
- package/dist/api/errors/ForbiddenError.js +17 -7
- package/dist/api/errors/InternalServerError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/errors/UnprocessableEntityError.js +17 -7
- package/dist/api/resources/bulkSync/client/Client.d.ts +47 -6
- package/dist/api/resources/bulkSync/client/Client.js +135 -157
- package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +11 -3
- package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +11 -3
- package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +13 -2
- package/dist/api/resources/bulkSync/resources/executions/client/Client.js +75 -79
- package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +18 -0
- package/dist/api/resources/bulkSync/resources/executions/client/requests/ExecutionsListRequest.js +5 -0
- package/dist/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +1 -0
- package/dist/api/resources/bulkSync/resources/index.d.ts +2 -0
- package/dist/api/resources/bulkSync/resources/index.js +20 -8
- package/dist/api/resources/bulkSync/resources/schedules/client/Client.d.ts +113 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/Client.js +398 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/index.d.ts +1 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/index.js +17 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.d.ts +15 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/CreateScheduleRequest.js +5 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.d.ts +15 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.js +5 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/index.d.ts +2 -0
- package/dist/api/resources/bulkSync/resources/schedules/client/requests/index.js +2 -0
- package/dist/api/resources/bulkSync/resources/schedules/index.d.ts +1 -0
- package/dist/api/resources/bulkSync/resources/schedules/index.js +17 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +5 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +49 -66
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +3 -1
- 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 +41 -2
- package/dist/api/resources/connections/client/Client.js +159 -128
- package/dist/api/resources/connections/client/requests/ConnectCardRequest.d.ts +7 -0
- package/dist/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +3 -1
- package/dist/api/resources/connections/client/requests/TestConnectionRequest.d.ts +24 -0
- package/dist/api/resources/connections/client/requests/TestConnectionRequest.js +5 -0
- package/dist/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +3 -1
- package/dist/api/resources/connections/client/requests/index.d.ts +1 -0
- package/dist/api/resources/events/client/Client.d.ts +7 -2
- package/dist/api/resources/events/client/Client.js +33 -37
- package/dist/api/resources/events/client/requests/EventsListRequest.d.ts +2 -2
- package/dist/api/resources/identity/client/Client.d.ts +7 -0
- package/dist/api/resources/identity/client/Client.js +25 -20
- package/dist/api/resources/index.d.ts +2 -1
- package/dist/api/resources/index.js +20 -9
- package/dist/api/resources/jobs/client/Client.d.ts +7 -2
- package/dist/api/resources/jobs/client/Client.js +25 -22
- package/dist/api/resources/modelSync/client/Client.d.ts +83 -52
- package/dist/api/resources/modelSync/client/Client.js +228 -403
- package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +14 -5
- package/dist/api/resources/modelSync/client/requests/ModelSyncListRequest.d.ts +1 -1
- package/dist/api/resources/modelSync/client/requests/StartModelSyncRequest.d.ts +1 -0
- package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +14 -5
- package/dist/api/resources/modelSync/client/requests/index.d.ts +0 -2
- package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +36 -8
- package/dist/api/resources/modelSync/resources/executions/client/Client.js +137 -68
- package/dist/api/resources/modelSync/resources/executions/client/index.d.ts +1 -1
- package/dist/api/resources/modelSync/resources/executions/client/index.js +15 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.d.ts +16 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/ExecutionsListRequest.js +5 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.d.ts +13 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/UpdateExecutionRequest.js +5 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/index.d.ts +2 -0
- package/dist/api/resources/modelSync/resources/executions/client/requests/index.js +2 -0
- package/dist/api/resources/modelSync/resources/index.d.ts +3 -0
- package/dist/api/resources/modelSync/resources/index.js +23 -7
- package/dist/api/resources/modelSync/resources/targets/client/Client.d.ts +143 -0
- package/dist/api/resources/modelSync/resources/targets/client/Client.js +395 -0
- package/dist/api/resources/modelSync/resources/targets/client/index.d.ts +1 -0
- package/dist/api/resources/modelSync/resources/targets/client/index.js +17 -0
- package/dist/api/resources/modelSync/{client/requests/ModelSyncGetTargetFieldsRequest.d.ts → resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts} +1 -1
- package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.js +5 -0
- package/{api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts → dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.d.ts} +1 -1
- package/dist/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetRequest.js +5 -0
- package/dist/api/resources/modelSync/resources/targets/client/requests/index.d.ts +2 -0
- package/dist/api/resources/modelSync/resources/targets/client/requests/index.js +2 -0
- package/dist/api/resources/modelSync/resources/targets/index.d.ts +1 -0
- package/dist/api/resources/modelSync/resources/targets/index.js +17 -0
- package/dist/api/resources/models/client/Client.d.ts +5 -0
- package/dist/api/resources/models/client/Client.js +83 -135
- package/dist/api/resources/organization/client/Client.d.ts +7 -0
- package/dist/api/resources/organization/client/Client.js +53 -72
- package/dist/api/resources/permissions/client/Client.d.ts +7 -2
- package/dist/api/resources/permissions/resources/index.js +17 -7
- package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +5 -0
- package/dist/api/resources/permissions/resources/policies/client/Client.js +47 -72
- package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +5 -0
- package/dist/api/resources/permissions/resources/roles/client/Client.js +47 -72
- package/dist/api/resources/queryRunner/client/Client.d.ts +5 -0
- package/dist/api/resources/queryRunner/client/Client.js +33 -37
- package/dist/api/resources/schemas/client/Client.d.ts +68 -0
- package/dist/api/resources/schemas/client/Client.js +302 -59
- package/dist/api/resources/schemas/client/index.d.ts +1 -1
- package/dist/api/resources/schemas/client/index.js +15 -0
- package/dist/api/resources/schemas/client/requests/SetPrimaryKeysRequest.d.ts +11 -0
- package/dist/api/resources/schemas/client/requests/SetPrimaryKeysRequest.js +5 -0
- package/dist/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.d.ts +11 -0
- package/dist/api/resources/schemas/client/requests/UpsertSchemaFieldRequest.js +5 -0
- package/dist/api/resources/schemas/client/requests/index.d.ts +2 -0
- package/dist/api/resources/schemas/client/requests/index.js +2 -0
- package/dist/api/resources/users/client/Client.d.ts +5 -0
- package/dist/api/resources/users/client/Client.js +55 -87
- package/dist/api/resources/webhooks/client/Client.d.ts +33 -4
- package/dist/api/resources/webhooks/client/Client.js +169 -76
- package/dist/api/types/BackendConnectionCapabilities.d.ts +9 -0
- package/dist/api/types/BackendConnectionCapabilities.js +5 -0
- package/dist/api/types/BackendOAuthPrompt.d.ts +8 -0
- package/dist/api/types/BackendOAuthPrompt.js +5 -0
- package/dist/api/types/BulkBulkSyncSchedule.d.ts +20 -0
- package/dist/api/types/BulkBulkSyncSchedule.js +5 -0
- package/dist/api/types/BulkDiscover.d.ts +1 -1
- package/dist/api/types/BulkExecutionStatus.d.ts +2 -1
- package/dist/api/types/BulkExecutionStatus.js +1 -0
- package/dist/api/types/BulkFetchMode.d.ts +1 -1
- package/dist/api/types/BulkField.d.ts +2 -0
- package/dist/api/types/BulkNormalizeNames.d.ts +9 -0
- package/dist/api/types/BulkNormalizeNames.js +11 -0
- package/dist/api/types/BulkSchema.d.ts +1 -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/BulkSyncExecution.d.ts +6 -0
- package/dist/api/types/BulkSyncMode.d.ts +11 -0
- package/dist/api/types/BulkSyncMode.js +10 -0
- package/dist/api/types/BulkSyncResponse.d.ts +10 -1
- package/dist/api/types/BulkSyncSchemaExecution.d.ts +3 -0
- package/dist/api/types/CancelModelSyncResponse.d.ts +6 -0
- package/dist/api/types/CancelModelSyncResponse.js +5 -0
- package/dist/api/types/CancelModelSyncResponseEnvelope.d.ts +7 -0
- package/dist/api/types/CancelModelSyncResponseEnvelope.js +5 -0
- package/dist/api/types/ConnectCardResponse.d.ts +1 -0
- package/dist/api/types/ConnectionResponseSchema.d.ts +5 -0
- package/dist/api/types/ConnectionType.d.ts +6 -0
- package/dist/api/types/ConnectionTypeSchema.d.ts +1 -0
- package/dist/api/types/CreateConnectionResponseSchema.d.ts +3 -0
- package/dist/api/types/EventBody.d.ts +1 -1
- package/dist/api/types/ExecutionCounts.d.ts +2 -0
- 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 +3 -1
- package/dist/api/types/FilterFunction.js +2 -0
- package/dist/api/types/GetIdentityResponseSchema.d.ts +7 -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/ListBulkSyncExecutionsEnvelope.d.ts +1 -0
- package/dist/api/types/ListExecutionResponseEnvelope.d.ts +1 -0
- package/dist/api/types/ModelField.d.ts +4 -0
- package/dist/api/types/ModelSyncField.d.ts +2 -0
- package/dist/api/types/{SyncMode.d.ts → ModelSyncMode.d.ts} +2 -4
- package/{api/types/SyncMode.js → dist/api/types/ModelSyncMode.js} +2 -4
- package/dist/api/types/ModelSyncResponse.d.ts +6 -1
- package/dist/api/types/PaginationDetails.d.ts +6 -0
- package/dist/api/types/PaginationDetails.js +5 -0
- package/dist/api/types/ScheduleEnvelope.d.ts +7 -0
- package/dist/api/types/ScheduleEnvelope.js +5 -0
- package/dist/api/types/ScheduleFrequency.d.ts +1 -1
- package/dist/api/types/SchedulesEnvelope.d.ts +7 -0
- package/dist/api/types/SchedulesEnvelope.js +5 -0
- package/dist/api/types/SchemaField.d.ts +2 -0
- package/dist/api/types/SchemaIdentityFunction.d.ts +3 -1
- package/dist/api/types/SchemaIdentityFunction.js +2 -0
- package/dist/api/types/SchemaPrimaryKeyOverrideInput.d.ts +7 -0
- package/dist/api/types/SchemaPrimaryKeyOverrideInput.js +5 -0
- package/dist/api/types/StartModelSyncResponseSchema.d.ts +1 -0
- package/dist/api/types/SupportedBulkMode.d.ts +1 -1
- package/dist/api/types/SupportedMode.d.ts +1 -1
- package/dist/api/types/SyncDestinationProperties.d.ts +1 -0
- package/dist/api/types/Target.d.ts +4 -1
- package/dist/api/types/TargetCreateInput.d.ts +11 -0
- package/dist/api/types/TargetCreateInput.js +5 -0
- package/dist/api/types/TargetField.d.ts +1 -0
- package/dist/api/types/TypesType.d.ts +1 -1
- package/dist/api/types/UpdateBulkField.d.ts +9 -0
- package/dist/api/types/UpdateBulkField.js +5 -0
- package/dist/api/types/UtilEnumValue.d.ts +7 -0
- package/dist/api/types/UtilEnumValue.js +5 -0
- package/dist/api/types/UtilFieldType.d.ts +1 -1
- package/dist/api/types/V2ConnectionForm.d.ts +7 -0
- package/dist/api/types/V2ConnectionForm.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/V4BulkSyncExecutionLogs.d.ts +1 -1
- package/dist/api/types/V4BulkSyncScheduleApi.d.ts +13 -0
- package/dist/api/types/V4BulkSyncScheduleApi.js +5 -0
- package/dist/api/types/V4TargetCreator.d.ts +10 -0
- package/dist/api/types/V4TargetCreator.js +5 -0
- package/dist/api/types/V4TargetObjectsResponseEnvelope.d.ts +1 -0
- package/dist/api/types/V4TargetPropertyValues.d.ts +14 -0
- package/dist/api/types/V4TargetPropertyValues.js +5 -0
- package/dist/api/types/V4TargetPropertyValuesEnvelope.d.ts +7 -0
- package/dist/api/types/V4TargetPropertyValuesEnvelope.js +5 -0
- package/dist/api/types/V4UserFieldRequest.d.ts +10 -0
- package/dist/api/types/V4UserFieldRequest.js +5 -0
- package/dist/api/types/Webhook.d.ts +1 -0
- package/dist/api/types/WorkTaskStatus.d.ts +1 -1
- package/dist/api/types/index.d.ts +21 -1
- package/dist/api/types/index.js +21 -1
- 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 +6 -3
- package/dist/core/fetcher/Fetcher.js +20 -189
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +52 -41
- package/dist/environments.d.ts +1 -1
- package/dist/errors/PolytomicError.js +2 -1
- package/dist/errors/PolytomicTimeoutError.d.ts +1 -1
- package/dist/errors/PolytomicTimeoutError.js +2 -2
- package/dist/index.js +17 -7
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +1 -1
- package/errors/PolytomicError.js +2 -1
- package/errors/PolytomicTimeoutError.d.ts +1 -1
- package/errors/PolytomicTimeoutError.js +2 -2
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +18 -14
- package/reference.md +6382 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
- /package/api/resources/{modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js → bulkSync/resources/executions/client/requests/ExecutionsListRequest.js} +0 -0
- /package/api/resources/{modelSync/client/requests/ModelSyncGetTargetRequest.js → bulkSync/resources/schedules/client/requests/CreateScheduleRequest.js} +0 -0
- /package/{dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js → api/resources/bulkSync/resources/schedules/client/requests/UpdateScheduleRequest.js} +0 -0
- /package/{dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js → api/resources/connections/client/requests/TestConnectionRequest.js} +0 -0
|
@@ -18,13 +18,23 @@ 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) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
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
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -42,13 +52,23 @@ exports.ModelSync = void 0;
|
|
|
42
52
|
const environments = __importStar(require("../../../../environments"));
|
|
43
53
|
const core = __importStar(require("../../../../core"));
|
|
44
54
|
const Polytomic = __importStar(require("../../../index"));
|
|
55
|
+
const json_1 = require("../../../../core/json");
|
|
45
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
57
|
const errors = __importStar(require("../../../../errors/index"));
|
|
47
|
-
const Client_1 = require("../resources/
|
|
58
|
+
const Client_1 = require("../resources/targets/client/Client");
|
|
59
|
+
const Client_2 = require("../resources/executions/client/Client");
|
|
48
60
|
class ModelSync {
|
|
49
61
|
constructor(_options) {
|
|
50
62
|
this._options = _options;
|
|
51
63
|
}
|
|
64
|
+
get targets() {
|
|
65
|
+
var _a;
|
|
66
|
+
return ((_a = this._targets) !== null && _a !== void 0 ? _a : (this._targets = new Client_1.Targets(this._options)));
|
|
67
|
+
}
|
|
68
|
+
get executions() {
|
|
69
|
+
var _a;
|
|
70
|
+
return ((_a = this._executions) !== null && _a !== void 0 ? _a : (this._executions = new Client_2.Executions(this._options)));
|
|
71
|
+
}
|
|
52
72
|
/**
|
|
53
73
|
* @param {string} id
|
|
54
74
|
* @param {Polytomic.ModelSyncGetSourceRequest} request
|
|
@@ -63,30 +83,23 @@ class ModelSync {
|
|
|
63
83
|
* @example
|
|
64
84
|
* await client.modelSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
65
85
|
*/
|
|
66
|
-
getSource(
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
getSource(id_1) {
|
|
87
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
88
|
+
var _a, _b;
|
|
69
89
|
const { params } = request;
|
|
70
90
|
const _queryParams = {};
|
|
71
91
|
if (params != null) {
|
|
72
|
-
_queryParams["params"] =
|
|
92
|
+
_queryParams["params"] = (0, json_1.toJson)(params);
|
|
73
93
|
}
|
|
74
94
|
const _response = yield core.fetcher({
|
|
75
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
95
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/modelsync/source`),
|
|
76
96
|
method: "GET",
|
|
77
|
-
headers: {
|
|
78
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
79
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
97
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
80
98
|
? yield core.Supplier.get(this._options.version)
|
|
81
|
-
: undefined,
|
|
82
|
-
"X-Fern-Language": "JavaScript",
|
|
83
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
84
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
85
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
86
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
87
|
-
},
|
|
99
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
100
|
contentType: "application/json",
|
|
89
101
|
queryParameters: _queryParams,
|
|
102
|
+
requestType: "json",
|
|
90
103
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
91
104
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
92
105
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -120,7 +133,7 @@ class ModelSync {
|
|
|
120
133
|
body: _response.error.rawBody,
|
|
121
134
|
});
|
|
122
135
|
case "timeout":
|
|
123
|
-
throw new errors.PolytomicTimeoutError();
|
|
136
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/connections/{id}/modelsync/source.");
|
|
124
137
|
case "unknown":
|
|
125
138
|
throw new errors.PolytomicError({
|
|
126
139
|
message: _response.error.errorMessage,
|
|
@@ -142,30 +155,23 @@ class ModelSync {
|
|
|
142
155
|
* @example
|
|
143
156
|
* await client.modelSync.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
144
157
|
*/
|
|
145
|
-
getSourceFields(
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
getSourceFields(id_1) {
|
|
159
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
160
|
+
var _a, _b;
|
|
148
161
|
const { params } = request;
|
|
149
162
|
const _queryParams = {};
|
|
150
163
|
if (params != null) {
|
|
151
|
-
_queryParams["params"] =
|
|
164
|
+
_queryParams["params"] = (0, json_1.toJson)(params);
|
|
152
165
|
}
|
|
153
166
|
const _response = yield core.fetcher({
|
|
154
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
167
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/modelsync/source/fields`),
|
|
155
168
|
method: "GET",
|
|
156
|
-
headers: {
|
|
157
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
158
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
169
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
159
170
|
? yield core.Supplier.get(this._options.version)
|
|
160
|
-
: undefined,
|
|
161
|
-
"X-Fern-Language": "JavaScript",
|
|
162
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
163
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
164
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
165
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
166
|
-
},
|
|
171
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
167
172
|
contentType: "application/json",
|
|
168
173
|
queryParameters: _queryParams,
|
|
174
|
+
requestType: "json",
|
|
169
175
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
170
176
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
171
177
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -199,241 +205,7 @@ class ModelSync {
|
|
|
199
205
|
body: _response.error.rawBody,
|
|
200
206
|
});
|
|
201
207
|
case "timeout":
|
|
202
|
-
throw new errors.PolytomicTimeoutError();
|
|
203
|
-
case "unknown":
|
|
204
|
-
throw new errors.PolytomicError({
|
|
205
|
-
message: _response.error.errorMessage,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* @param {string} id
|
|
212
|
-
* @param {Polytomic.ModelSyncGetTargetRequest} request
|
|
213
|
-
* @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration.
|
|
214
|
-
*
|
|
215
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
216
|
-
* @throws {@link Polytomic.UnauthorizedError}
|
|
217
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
218
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
219
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* await client.modelSync.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
223
|
-
*/
|
|
224
|
-
getTarget(id, request = {}, requestOptions) {
|
|
225
|
-
var _a;
|
|
226
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
const { type: type_, search } = request;
|
|
228
|
-
const _queryParams = {};
|
|
229
|
-
if (type_ != null) {
|
|
230
|
-
_queryParams["type"] = type_;
|
|
231
|
-
}
|
|
232
|
-
if (search != null) {
|
|
233
|
-
_queryParams["search"] = search;
|
|
234
|
-
}
|
|
235
|
-
const _response = yield core.fetcher({
|
|
236
|
-
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)}/modelsync/target`),
|
|
237
|
-
method: "GET",
|
|
238
|
-
headers: {
|
|
239
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
240
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
241
|
-
? yield core.Supplier.get(this._options.version)
|
|
242
|
-
: undefined,
|
|
243
|
-
"X-Fern-Language": "JavaScript",
|
|
244
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
245
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
246
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
247
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
248
|
-
},
|
|
249
|
-
contentType: "application/json",
|
|
250
|
-
queryParameters: _queryParams,
|
|
251
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
252
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
254
|
-
});
|
|
255
|
-
if (_response.ok) {
|
|
256
|
-
return _response.body;
|
|
257
|
-
}
|
|
258
|
-
if (_response.error.reason === "status-code") {
|
|
259
|
-
switch (_response.error.statusCode) {
|
|
260
|
-
case 400:
|
|
261
|
-
throw new Polytomic.BadRequestError(_response.error.body);
|
|
262
|
-
case 401:
|
|
263
|
-
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
264
|
-
case 403:
|
|
265
|
-
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
266
|
-
case 404:
|
|
267
|
-
throw new Polytomic.NotFoundError(_response.error.body);
|
|
268
|
-
case 500:
|
|
269
|
-
throw new Polytomic.InternalServerError(_response.error.body);
|
|
270
|
-
default:
|
|
271
|
-
throw new errors.PolytomicError({
|
|
272
|
-
statusCode: _response.error.statusCode,
|
|
273
|
-
body: _response.error.body,
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
switch (_response.error.reason) {
|
|
278
|
-
case "non-json":
|
|
279
|
-
throw new errors.PolytomicError({
|
|
280
|
-
statusCode: _response.error.statusCode,
|
|
281
|
-
body: _response.error.rawBody,
|
|
282
|
-
});
|
|
283
|
-
case "timeout":
|
|
284
|
-
throw new errors.PolytomicTimeoutError();
|
|
285
|
-
case "unknown":
|
|
286
|
-
throw new errors.PolytomicError({
|
|
287
|
-
message: _response.error.errorMessage,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* @param {string} id
|
|
294
|
-
* @param {Polytomic.ModelSyncGetTargetFieldsRequest} request
|
|
295
|
-
* @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration.
|
|
296
|
-
*
|
|
297
|
-
* @throws {@link Polytomic.UnauthorizedError}
|
|
298
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
299
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
300
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
301
|
-
*
|
|
302
|
-
* @example
|
|
303
|
-
* await client.modelSync.getTargetFields("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
304
|
-
* target: "database.table",
|
|
305
|
-
* refresh: false
|
|
306
|
-
* })
|
|
307
|
-
*/
|
|
308
|
-
getTargetFields(id, request, requestOptions) {
|
|
309
|
-
var _a;
|
|
310
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
-
const { target, refresh } = request;
|
|
312
|
-
const _queryParams = {};
|
|
313
|
-
_queryParams["target"] = target;
|
|
314
|
-
if (refresh != null) {
|
|
315
|
-
_queryParams["refresh"] = refresh.toString();
|
|
316
|
-
}
|
|
317
|
-
const _response = yield core.fetcher({
|
|
318
|
-
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)}/modelsync/target/fields`),
|
|
319
|
-
method: "GET",
|
|
320
|
-
headers: {
|
|
321
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
322
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
323
|
-
? yield core.Supplier.get(this._options.version)
|
|
324
|
-
: undefined,
|
|
325
|
-
"X-Fern-Language": "JavaScript",
|
|
326
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
327
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
328
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
329
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
330
|
-
},
|
|
331
|
-
contentType: "application/json",
|
|
332
|
-
queryParameters: _queryParams,
|
|
333
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
334
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
335
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
336
|
-
});
|
|
337
|
-
if (_response.ok) {
|
|
338
|
-
return _response.body;
|
|
339
|
-
}
|
|
340
|
-
if (_response.error.reason === "status-code") {
|
|
341
|
-
switch (_response.error.statusCode) {
|
|
342
|
-
case 401:
|
|
343
|
-
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
344
|
-
case 403:
|
|
345
|
-
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
346
|
-
case 404:
|
|
347
|
-
throw new Polytomic.NotFoundError(_response.error.body);
|
|
348
|
-
case 500:
|
|
349
|
-
throw new Polytomic.InternalServerError(_response.error.body);
|
|
350
|
-
default:
|
|
351
|
-
throw new errors.PolytomicError({
|
|
352
|
-
statusCode: _response.error.statusCode,
|
|
353
|
-
body: _response.error.body,
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
switch (_response.error.reason) {
|
|
358
|
-
case "non-json":
|
|
359
|
-
throw new errors.PolytomicError({
|
|
360
|
-
statusCode: _response.error.statusCode,
|
|
361
|
-
body: _response.error.rawBody,
|
|
362
|
-
});
|
|
363
|
-
case "timeout":
|
|
364
|
-
throw new errors.PolytomicTimeoutError();
|
|
365
|
-
case "unknown":
|
|
366
|
-
throw new errors.PolytomicError({
|
|
367
|
-
message: _response.error.errorMessage,
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* @param {string} id
|
|
374
|
-
* @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration.
|
|
375
|
-
*
|
|
376
|
-
* @throws {@link Polytomic.BadRequestError}
|
|
377
|
-
* @throws {@link Polytomic.UnauthorizedError}
|
|
378
|
-
* @throws {@link Polytomic.ForbiddenError}
|
|
379
|
-
* @throws {@link Polytomic.NotFoundError}
|
|
380
|
-
* @throws {@link Polytomic.InternalServerError}
|
|
381
|
-
*
|
|
382
|
-
* @example
|
|
383
|
-
* await client.modelSync.getTargetObjects("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
384
|
-
*/
|
|
385
|
-
getTargetObjects(id, requestOptions) {
|
|
386
|
-
var _a;
|
|
387
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
388
|
-
const _response = yield core.fetcher({
|
|
389
|
-
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)}/modelsync/targetobjects`),
|
|
390
|
-
method: "GET",
|
|
391
|
-
headers: {
|
|
392
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
393
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
394
|
-
? yield core.Supplier.get(this._options.version)
|
|
395
|
-
: undefined,
|
|
396
|
-
"X-Fern-Language": "JavaScript",
|
|
397
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
398
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
399
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
400
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
401
|
-
},
|
|
402
|
-
contentType: "application/json",
|
|
403
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
404
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
405
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
406
|
-
});
|
|
407
|
-
if (_response.ok) {
|
|
408
|
-
return _response.body;
|
|
409
|
-
}
|
|
410
|
-
if (_response.error.reason === "status-code") {
|
|
411
|
-
switch (_response.error.statusCode) {
|
|
412
|
-
case 400:
|
|
413
|
-
throw new Polytomic.BadRequestError(_response.error.body);
|
|
414
|
-
case 401:
|
|
415
|
-
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
416
|
-
case 403:
|
|
417
|
-
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
418
|
-
case 404:
|
|
419
|
-
throw new Polytomic.NotFoundError(_response.error.body);
|
|
420
|
-
case 500:
|
|
421
|
-
throw new Polytomic.InternalServerError(_response.error.body);
|
|
422
|
-
default:
|
|
423
|
-
throw new errors.PolytomicError({
|
|
424
|
-
statusCode: _response.error.statusCode,
|
|
425
|
-
body: _response.error.body,
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
switch (_response.error.reason) {
|
|
430
|
-
case "non-json":
|
|
431
|
-
throw new errors.PolytomicError({
|
|
432
|
-
statusCode: _response.error.statusCode,
|
|
433
|
-
body: _response.error.rawBody,
|
|
434
|
-
});
|
|
435
|
-
case "timeout":
|
|
436
|
-
throw new errors.PolytomicTimeoutError();
|
|
208
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/connections/{id}/modelsync/source/fields.");
|
|
437
209
|
case "unknown":
|
|
438
210
|
throw new errors.PolytomicError({
|
|
439
211
|
message: _response.error.errorMessage,
|
|
@@ -456,9 +228,9 @@ class ModelSync {
|
|
|
456
228
|
* target_connection_id: "0b155265-c537-44c9-9359-a3ceb468a4da"
|
|
457
229
|
* })
|
|
458
230
|
*/
|
|
459
|
-
list(
|
|
460
|
-
|
|
461
|
-
|
|
231
|
+
list() {
|
|
232
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
233
|
+
var _a, _b;
|
|
462
234
|
const { active, mode, target_connection_id: targetConnectionId } = request;
|
|
463
235
|
const _queryParams = {};
|
|
464
236
|
if (active != null) {
|
|
@@ -471,21 +243,14 @@ class ModelSync {
|
|
|
471
243
|
_queryParams["target_connection_id"] = targetConnectionId;
|
|
472
244
|
}
|
|
473
245
|
const _response = yield core.fetcher({
|
|
474
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
246
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, "api/syncs"),
|
|
475
247
|
method: "GET",
|
|
476
|
-
headers: {
|
|
477
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
478
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
248
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
479
249
|
? yield core.Supplier.get(this._options.version)
|
|
480
|
-
: undefined,
|
|
481
|
-
"X-Fern-Language": "JavaScript",
|
|
482
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
483
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
484
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
485
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
486
|
-
},
|
|
250
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
487
251
|
contentType: "application/json",
|
|
488
252
|
queryParameters: _queryParams,
|
|
253
|
+
requestType: "json",
|
|
489
254
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
490
255
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
491
256
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -517,7 +282,7 @@ class ModelSync {
|
|
|
517
282
|
body: _response.error.rawBody,
|
|
518
283
|
});
|
|
519
284
|
case "timeout":
|
|
520
|
-
throw new errors.PolytomicTimeoutError();
|
|
285
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/syncs.");
|
|
521
286
|
case "unknown":
|
|
522
287
|
throw new errors.PolytomicError({
|
|
523
288
|
message: _response.error.errorMessage,
|
|
@@ -526,6 +291,63 @@ class ModelSync {
|
|
|
526
291
|
});
|
|
527
292
|
}
|
|
528
293
|
/**
|
|
294
|
+
* Create a new sync from one or more models to a destination.
|
|
295
|
+
*
|
|
296
|
+
* All of the functionality described in [the product
|
|
297
|
+
* documentation](https://docs.polytomic.com/docs/sync-destinations) is
|
|
298
|
+
* configurable via the API.
|
|
299
|
+
*
|
|
300
|
+
* Guides:
|
|
301
|
+
*
|
|
302
|
+
* - [Model sync (Reverse ETL) from Snowflake query to Salesforce](https://apidocs.polytomic.com/2024-02-08/guides/code-examples/model-sync-reverse-etl-from-snowflake-query-to-salesforce)
|
|
303
|
+
* - [Joined model sync from Postgres, Airtable, and Stripe to Hubspot](https://apidocs.polytomic.com/2024-02-08/guides/code-examples/joined-model-sync-from-postgres-airtable-and-stripe-to-hubspot)
|
|
304
|
+
*
|
|
305
|
+
* ## Targets (Destinations)
|
|
306
|
+
*
|
|
307
|
+
* Polytomic refers to a model sync's destination as the "target object", or
|
|
308
|
+
* target. Target objects are identified by a connection ID and an object ID. You
|
|
309
|
+
* can retrieve a list of all target objects for a connection using the [Get Target
|
|
310
|
+
* Objects](./targets/list) endpoint.
|
|
311
|
+
*
|
|
312
|
+
* The `target` object in the request specifies information about the sync destination.
|
|
313
|
+
*
|
|
314
|
+
* ```json
|
|
315
|
+
* "target": {
|
|
316
|
+
* "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
317
|
+
* "object": "Users",
|
|
318
|
+
* },
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* Some connections support additional configuration for targets. For example,
|
|
322
|
+
* [Salesforce
|
|
323
|
+
* connections](https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/connections/salesforce#target)
|
|
324
|
+
* support optionally specifying the ingestion API to use. The target specific
|
|
325
|
+
* options are passed as `configuration`; consult the [integration
|
|
326
|
+
* guides](https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/overview)
|
|
327
|
+
* for details about specific connection configurations.
|
|
328
|
+
*
|
|
329
|
+
* ### Creating a new target
|
|
330
|
+
*
|
|
331
|
+
* Some integrations support creating a new target when creating a model sync. For
|
|
332
|
+
* example, an ad audience or database table.
|
|
333
|
+
*
|
|
334
|
+
* When creating a new target, `object` is omitted and `create` is specified
|
|
335
|
+
* instead. The `create` property is an object containing integration specific
|
|
336
|
+
* configuration for the new target.
|
|
337
|
+
*
|
|
338
|
+
* ```json
|
|
339
|
+
* "target": {
|
|
340
|
+
* "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
341
|
+
* "create": {
|
|
342
|
+
* "name": "New audience",
|
|
343
|
+
* "type": "user_audience"
|
|
344
|
+
* }
|
|
345
|
+
* },
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* The [Get Target List](./targets/list) endpoint returns information about whether
|
|
349
|
+
* a connection supports target creation.
|
|
350
|
+
*
|
|
529
351
|
* @param {Polytomic.CreateModelSyncRequest} request
|
|
530
352
|
* @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration.
|
|
531
353
|
*
|
|
@@ -544,29 +366,21 @@ class ModelSync {
|
|
|
544
366
|
* name: "Users Sync",
|
|
545
367
|
* schedule: {},
|
|
546
368
|
* target: {
|
|
547
|
-
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
548
|
-
* object: "Users"
|
|
369
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
549
370
|
* }
|
|
550
371
|
* })
|
|
551
372
|
*/
|
|
552
373
|
create(request, requestOptions) {
|
|
553
|
-
var _a;
|
|
554
374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
375
|
+
var _a, _b;
|
|
555
376
|
const _response = yield core.fetcher({
|
|
556
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
377
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, "api/syncs"),
|
|
557
378
|
method: "POST",
|
|
558
|
-
headers: {
|
|
559
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
560
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
379
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
561
380
|
? yield core.Supplier.get(this._options.version)
|
|
562
|
-
: undefined,
|
|
563
|
-
"X-Fern-Language": "JavaScript",
|
|
564
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
565
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
566
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
567
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
568
|
-
},
|
|
381
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
569
382
|
contentType: "application/json",
|
|
383
|
+
requestType: "json",
|
|
570
384
|
body: request,
|
|
571
385
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
572
386
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -601,7 +415,7 @@ class ModelSync {
|
|
|
601
415
|
body: _response.error.rawBody,
|
|
602
416
|
});
|
|
603
417
|
case "timeout":
|
|
604
|
-
throw new errors.PolytomicTimeoutError();
|
|
418
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/syncs.");
|
|
605
419
|
case "unknown":
|
|
606
420
|
throw new errors.PolytomicError({
|
|
607
421
|
message: _response.error.errorMessage,
|
|
@@ -619,23 +433,16 @@ class ModelSync {
|
|
|
619
433
|
* await client.modelSync.getScheduleOptions()
|
|
620
434
|
*/
|
|
621
435
|
getScheduleOptions(requestOptions) {
|
|
622
|
-
var _a;
|
|
623
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
+
var _a, _b;
|
|
624
438
|
const _response = yield core.fetcher({
|
|
625
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
439
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, "api/syncs/schedules"),
|
|
626
440
|
method: "GET",
|
|
627
|
-
headers: {
|
|
628
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
629
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
441
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
630
442
|
? yield core.Supplier.get(this._options.version)
|
|
631
|
-
: undefined,
|
|
632
|
-
"X-Fern-Language": "JavaScript",
|
|
633
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
634
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
635
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
636
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
637
|
-
},
|
|
443
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
638
444
|
contentType: "application/json",
|
|
445
|
+
requestType: "json",
|
|
639
446
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
640
447
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
641
448
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -663,7 +470,7 @@ class ModelSync {
|
|
|
663
470
|
body: _response.error.rawBody,
|
|
664
471
|
});
|
|
665
472
|
case "timeout":
|
|
666
|
-
throw new errors.PolytomicTimeoutError();
|
|
473
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/syncs/schedules.");
|
|
667
474
|
case "unknown":
|
|
668
475
|
throw new errors.PolytomicError({
|
|
669
476
|
message: _response.error.errorMessage,
|
|
@@ -683,23 +490,16 @@ class ModelSync {
|
|
|
683
490
|
* await client.modelSync.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
684
491
|
*/
|
|
685
492
|
get(id, requestOptions) {
|
|
686
|
-
var _a;
|
|
687
493
|
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
+
var _a, _b;
|
|
688
495
|
const _response = yield core.fetcher({
|
|
689
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
496
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}`),
|
|
690
497
|
method: "GET",
|
|
691
|
-
headers: {
|
|
692
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
693
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
498
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
694
499
|
? yield core.Supplier.get(this._options.version)
|
|
695
|
-
: undefined,
|
|
696
|
-
"X-Fern-Language": "JavaScript",
|
|
697
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
698
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
699
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
700
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
701
|
-
},
|
|
500
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
702
501
|
contentType: "application/json",
|
|
502
|
+
requestType: "json",
|
|
703
503
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
704
504
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
705
505
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -729,7 +529,7 @@ class ModelSync {
|
|
|
729
529
|
body: _response.error.rawBody,
|
|
730
530
|
});
|
|
731
531
|
case "timeout":
|
|
732
|
-
throw new errors.PolytomicTimeoutError();
|
|
532
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/syncs/{id}.");
|
|
733
533
|
case "unknown":
|
|
734
534
|
throw new errors.PolytomicError({
|
|
735
535
|
message: _response.error.errorMessage,
|
|
@@ -758,29 +558,21 @@ class ModelSync {
|
|
|
758
558
|
* name: "Users Sync",
|
|
759
559
|
* schedule: {},
|
|
760
560
|
* target: {
|
|
761
|
-
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
762
|
-
* object: "Users"
|
|
561
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
|
|
763
562
|
* }
|
|
764
563
|
* })
|
|
765
564
|
*/
|
|
766
565
|
update(id, request, requestOptions) {
|
|
767
|
-
var _a;
|
|
768
566
|
return __awaiter(this, void 0, void 0, function* () {
|
|
567
|
+
var _a, _b;
|
|
769
568
|
const _response = yield core.fetcher({
|
|
770
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
569
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}`),
|
|
771
570
|
method: "PUT",
|
|
772
|
-
headers: {
|
|
773
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
774
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
571
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
775
572
|
? yield core.Supplier.get(this._options.version)
|
|
776
|
-
: undefined,
|
|
777
|
-
"X-Fern-Language": "JavaScript",
|
|
778
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
779
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
780
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
781
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
782
|
-
},
|
|
573
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
783
574
|
contentType: "application/json",
|
|
575
|
+
requestType: "json",
|
|
784
576
|
body: request,
|
|
785
577
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
786
578
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -817,7 +609,7 @@ class ModelSync {
|
|
|
817
609
|
body: _response.error.rawBody,
|
|
818
610
|
});
|
|
819
611
|
case "timeout":
|
|
820
|
-
throw new errors.PolytomicTimeoutError();
|
|
612
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling PUT /api/syncs/{id}.");
|
|
821
613
|
case "unknown":
|
|
822
614
|
throw new errors.PolytomicError({
|
|
823
615
|
message: _response.error.errorMessage,
|
|
@@ -832,29 +624,23 @@ class ModelSync {
|
|
|
832
624
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
833
625
|
* @throws {@link Polytomic.ForbiddenError}
|
|
834
626
|
* @throws {@link Polytomic.NotFoundError}
|
|
627
|
+
* @throws {@link Polytomic.ConflictError}
|
|
835
628
|
* @throws {@link Polytomic.InternalServerError}
|
|
836
629
|
*
|
|
837
630
|
* @example
|
|
838
631
|
* await client.modelSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
839
632
|
*/
|
|
840
633
|
remove(id, requestOptions) {
|
|
841
|
-
var _a;
|
|
842
634
|
return __awaiter(this, void 0, void 0, function* () {
|
|
635
|
+
var _a, _b;
|
|
843
636
|
const _response = yield core.fetcher({
|
|
844
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
637
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}`),
|
|
845
638
|
method: "DELETE",
|
|
846
|
-
headers: {
|
|
847
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
848
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
639
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
849
640
|
? yield core.Supplier.get(this._options.version)
|
|
850
|
-
: undefined,
|
|
851
|
-
"X-Fern-Language": "JavaScript",
|
|
852
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
853
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
854
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
855
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
856
|
-
},
|
|
641
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
857
642
|
contentType: "application/json",
|
|
643
|
+
requestType: "json",
|
|
858
644
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
859
645
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
860
646
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -870,6 +656,8 @@ class ModelSync {
|
|
|
870
656
|
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
871
657
|
case 404:
|
|
872
658
|
throw new Polytomic.NotFoundError(_response.error.body);
|
|
659
|
+
case 409:
|
|
660
|
+
throw new Polytomic.ConflictError(_response.error.body);
|
|
873
661
|
case 500:
|
|
874
662
|
throw new Polytomic.InternalServerError(_response.error.body);
|
|
875
663
|
default:
|
|
@@ -886,7 +674,7 @@ class ModelSync {
|
|
|
886
674
|
body: _response.error.rawBody,
|
|
887
675
|
});
|
|
888
676
|
case "timeout":
|
|
889
|
-
throw new errors.PolytomicTimeoutError();
|
|
677
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling DELETE /api/syncs/{id}.");
|
|
890
678
|
case "unknown":
|
|
891
679
|
throw new errors.PolytomicError({
|
|
892
680
|
message: _response.error.errorMessage,
|
|
@@ -910,23 +698,16 @@ class ModelSync {
|
|
|
910
698
|
* })
|
|
911
699
|
*/
|
|
912
700
|
activate(id, request, requestOptions) {
|
|
913
|
-
var _a;
|
|
914
701
|
return __awaiter(this, void 0, void 0, function* () {
|
|
702
|
+
var _a, _b;
|
|
915
703
|
const _response = yield core.fetcher({
|
|
916
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
704
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}/activate`),
|
|
917
705
|
method: "POST",
|
|
918
|
-
headers: {
|
|
919
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
920
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
706
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
921
707
|
? yield core.Supplier.get(this._options.version)
|
|
922
|
-
: undefined,
|
|
923
|
-
"X-Fern-Language": "JavaScript",
|
|
924
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
925
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
926
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
927
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
928
|
-
},
|
|
708
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
929
709
|
contentType: "application/json",
|
|
710
|
+
requestType: "json",
|
|
930
711
|
body: request,
|
|
931
712
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
932
713
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -959,7 +740,69 @@ class ModelSync {
|
|
|
959
740
|
body: _response.error.rawBody,
|
|
960
741
|
});
|
|
961
742
|
case "timeout":
|
|
962
|
-
throw new errors.PolytomicTimeoutError();
|
|
743
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/syncs/{id}/activate.");
|
|
744
|
+
case "unknown":
|
|
745
|
+
throw new errors.PolytomicError({
|
|
746
|
+
message: _response.error.errorMessage,
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* @param {string} id - The active execution of this sync ID will be cancelled.
|
|
753
|
+
* @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration.
|
|
754
|
+
*
|
|
755
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
756
|
+
* @throws {@link Polytomic.ForbiddenError}
|
|
757
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
758
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
759
|
+
*
|
|
760
|
+
* @example
|
|
761
|
+
* await client.modelSync.cancel("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
762
|
+
*/
|
|
763
|
+
cancel(id, requestOptions) {
|
|
764
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
765
|
+
var _a, _b;
|
|
766
|
+
const _response = yield core.fetcher({
|
|
767
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}/cancel`),
|
|
768
|
+
method: "POST",
|
|
769
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
770
|
+
? yield core.Supplier.get(this._options.version)
|
|
771
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
772
|
+
contentType: "application/json",
|
|
773
|
+
requestType: "json",
|
|
774
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
775
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
776
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
777
|
+
});
|
|
778
|
+
if (_response.ok) {
|
|
779
|
+
return _response.body;
|
|
780
|
+
}
|
|
781
|
+
if (_response.error.reason === "status-code") {
|
|
782
|
+
switch (_response.error.statusCode) {
|
|
783
|
+
case 401:
|
|
784
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
785
|
+
case 403:
|
|
786
|
+
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
787
|
+
case 404:
|
|
788
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
789
|
+
case 500:
|
|
790
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
791
|
+
default:
|
|
792
|
+
throw new errors.PolytomicError({
|
|
793
|
+
statusCode: _response.error.statusCode,
|
|
794
|
+
body: _response.error.body,
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
switch (_response.error.reason) {
|
|
799
|
+
case "non-json":
|
|
800
|
+
throw new errors.PolytomicError({
|
|
801
|
+
statusCode: _response.error.statusCode,
|
|
802
|
+
body: _response.error.rawBody,
|
|
803
|
+
});
|
|
804
|
+
case "timeout":
|
|
805
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/syncs/{id}/cancel.");
|
|
963
806
|
case "unknown":
|
|
964
807
|
throw new errors.PolytomicError({
|
|
965
808
|
message: _response.error.errorMessage,
|
|
@@ -986,24 +829,17 @@ class ModelSync {
|
|
|
986
829
|
* @example
|
|
987
830
|
* await client.modelSync.start("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
988
831
|
*/
|
|
989
|
-
start(
|
|
990
|
-
|
|
991
|
-
|
|
832
|
+
start(id_1) {
|
|
833
|
+
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
834
|
+
var _a, _b;
|
|
992
835
|
const _response = yield core.fetcher({
|
|
993
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
836
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}/executions`),
|
|
994
837
|
method: "POST",
|
|
995
|
-
headers: {
|
|
996
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
997
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
838
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
998
839
|
? yield core.Supplier.get(this._options.version)
|
|
999
|
-
: undefined,
|
|
1000
|
-
"X-Fern-Language": "JavaScript",
|
|
1001
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
1002
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
1003
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
1004
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
1005
|
-
},
|
|
840
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1006
841
|
contentType: "application/json",
|
|
842
|
+
requestType: "json",
|
|
1007
843
|
body: request,
|
|
1008
844
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1009
845
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -1040,7 +876,7 @@ class ModelSync {
|
|
|
1040
876
|
body: _response.error.rawBody,
|
|
1041
877
|
});
|
|
1042
878
|
case "timeout":
|
|
1043
|
-
throw new errors.PolytomicTimeoutError();
|
|
879
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/syncs/{id}/executions.");
|
|
1044
880
|
case "unknown":
|
|
1045
881
|
throw new errors.PolytomicError({
|
|
1046
882
|
message: _response.error.errorMessage,
|
|
@@ -1060,23 +896,16 @@ class ModelSync {
|
|
|
1060
896
|
* await client.modelSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
1061
897
|
*/
|
|
1062
898
|
getStatus(id, requestOptions) {
|
|
1063
|
-
var _a;
|
|
1064
899
|
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
+
var _a, _b;
|
|
1065
901
|
const _response = yield core.fetcher({
|
|
1066
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.
|
|
902
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/syncs/${encodeURIComponent(id)}/status`),
|
|
1067
903
|
method: "GET",
|
|
1068
|
-
headers: {
|
|
1069
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
1070
|
-
"X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
904
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
|
|
1071
905
|
? yield core.Supplier.get(this._options.version)
|
|
1072
|
-
: undefined,
|
|
1073
|
-
"X-Fern-Language": "JavaScript",
|
|
1074
|
-
"X-Fern-SDK-Name": "polytomic",
|
|
1075
|
-
"X-Fern-SDK-Version": "1.11.3",
|
|
1076
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
1077
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
1078
|
-
},
|
|
906
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1079
907
|
contentType: "application/json",
|
|
908
|
+
requestType: "json",
|
|
1080
909
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1081
910
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1082
911
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1106,7 +935,7 @@ class ModelSync {
|
|
|
1106
935
|
body: _response.error.rawBody,
|
|
1107
936
|
});
|
|
1108
937
|
case "timeout":
|
|
1109
|
-
throw new errors.PolytomicTimeoutError();
|
|
938
|
+
throw new errors.PolytomicTimeoutError("Timeout exceeded when calling GET /api/syncs/{id}/status.");
|
|
1110
939
|
case "unknown":
|
|
1111
940
|
throw new errors.PolytomicError({
|
|
1112
941
|
message: _response.error.errorMessage,
|
|
@@ -1114,10 +943,6 @@ class ModelSync {
|
|
|
1114
943
|
}
|
|
1115
944
|
});
|
|
1116
945
|
}
|
|
1117
|
-
get executions() {
|
|
1118
|
-
var _a;
|
|
1119
|
-
return ((_a = this._executions) !== null && _a !== void 0 ? _a : (this._executions = new Client_1.Executions(this._options)));
|
|
1120
|
-
}
|
|
1121
946
|
_getAuthorizationHeader() {
|
|
1122
947
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1123
948
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|