repo_id
stringlengths 32
150
| file_path
stringlengths 46
183
| content
stringlengths 1
290k
| __index_level_0__
int64 0
0
|
---|---|---|---|
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-druva/Makefile | # Pinned python dependencies
PIP_VERSION ?= 23.1.2
SETUPTOOLS_VERSION ?= 65.5.1
WHEEL_VERSION ?= 0.38.4
# Activate venv
VIRTUAL_ENV ?= $(PWD)/.venv
PATH := ${VIRTUAL_ENV}/bin:${PATH}
.PHONY: init pre-commit precommit pytest dagit test-container run-test-container create-docker-builder localstack localstack-down
.venv:
python3 -m venv .venv
install: .venv
pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION} wheel==${WHEEL_VERSION}
CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install -e .[dev,test]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-druva/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-druva"
description = "`tap-druva` is a Singer tap for druva, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "druva"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-druva = "tap_druva.tap:TapDruva.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-druva/README.md | # tap-druva
`tap-druva` is a Singer tap for druva.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Setup
Run
```shell
meltano install
```
## Configuration
TODO
## Discovery
Streams and fields can be discovered through running the `select` command
```shell
meltano select tap-druva --list --all
```
If you wish to select individual fields this can also be done at this point or directly in metlano.yml
## Run pipeline
The pipeline can be run with
```shell
meltano elt tap-druva target-jsonl --job_id=some_job_id
```
The output files can be found in the output directory
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-druva/meltano.yml | version: 1
send_anonymous_usage_stats: false
project_id: tap-druva
plugins:
extractors:
- name: tap-druva
namespace: tap_druva
pip_url: -e .
capabilities:
- state
- catalog
- discover
# Add config settings here
# settings:
select:
- "*.*"
settings:
- name: client_id
- name: client_secret
kind: password
- name: endpoint
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/auth.py | """druva Authentication."""
from __future__ import annotations
import base64
import requests
from singer_sdk.authenticators import OAuthAuthenticator, SingletonMeta
from singer_sdk.helpers._util import utc_now
# The SingletonMeta metaclass makes your streams reuse the same authenticator instance.
# If this behaviour interferes with your use-case, you can remove the metaclass.
class DruvaAuthenticator(OAuthAuthenticator, metaclass=SingletonMeta):
"""Authenticator class for druva."""
@property
def oauth_request_body(self) -> dict:
"""Define the OAuth request body for the AutomaticTestTap API.
Returns:
A dict with the request body
"""
return {
"scope": self.oauth_scopes,
"grant_type": "client_credentials",
}
def update_access_token(self) -> None:
"""Update `access_token` along with: `last_refreshed` and `expires_in`. Copied from base
Authenticator to add in specific auth headers that druva requires
Raises:
RuntimeError: When OAuth login fails.
"""
if (client_id := self.client_id) is not None:
if (client_secret := self.client_secret) is not None:
token = base64.b64encode(f"{client_id}:{client_secret}".encode()).decode("utf-8")
else:
raise ValueError("client_secret must be provided in configuration")
else:
raise ValueError("client_id must be provided in configuration")
request_time = utc_now()
auth_request_payload = self.oauth_request_payload
token_response = requests.post(
self.auth_endpoint,
data=auth_request_payload,
timeout=60,
headers={"authorization": f"Basic {token}"}
)
try:
token_response.raise_for_status()
except requests.HTTPError as ex:
raise RuntimeError(
f"Failed OAuth login, response was '{token_response.json()}'. {ex}",
) from ex
self.logger.info("OAuth authorization attempt was successful.")
token_json = token_response.json()
self.access_token = token_json["access_token"]
self.expires_in = token_json.get("expires_in", self._default_expiration)
if self.expires_in is None:
self.logger.debug(
"No expires_in receied in OAuth response and no "
"default_expiration set. Token will be treated as if it never "
"expires.",
)
self.last_refreshed = request_time
@classmethod
def create_for_stream(cls, stream) -> DruvaAuthenticator: # noqa: ANN001
"""Instantiate an authenticator for a specific Singer stream.
Args:
stream: The Singer stream instance.
Returns:
A new authenticator.
"""
return cls(
stream=stream,
auth_endpoint="https://apis.druva.com/token",
oauth_scopes="read",
)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/streams.py | """Stream type classes for tap-druva."""
from __future__ import annotations
from pathlib import Path
from tap_druva.client import DruvaStream
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class CyberResilienceSettings(DruvaStream):
name = "cyber_resilience_settings"
path = "/realize/rwc/v1/settings"
primary_keys = []
replication_key = None
schema_filepath = SCHEMAS_DIR / "cyber_resilience_settings.json"
class SensitiveDataGovernanceSettings(DruvaStream):
name = "sensitive_data_governance_settings"
path = "/insync/sdg/v1/settings"
primary_keys = []
replication_key = None
schema_filepath = SCHEMAS_DIR / "sensitive_data_governance_settings.json"
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/client.py | """REST client handling, including druvaStream base class."""
from __future__ import annotations
from functools import cached_property
from collections.abc import Callable
import requests
from singer_sdk.streams import RESTStream
from tap_druva.auth import DruvaAuthenticator
_Auth = Callable[[requests.PreparedRequest], requests.PreparedRequest]
class DruvaStream(RESTStream):
"""druva stream class."""
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
endpoint_: str = self.config["endpoint"]
if endpoint_.endswith("/"):
endpoint_ = endpoint_.rstrip("/")
return endpoint_
# Set this value or override `get_new_paginator`.
@cached_property
def authenticator(self) -> _Auth:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return DruvaAuthenticator.create_for_stream(self)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
if "user_agent" in self.config:
headers["User-Agent"] = self.config.get("user_agent")
return headers
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/tap.py | """druva tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_druva import streams
class TapDruva(Tap):
"""druva tap class."""
name = "tap-druva"
config_jsonschema = th.PropertiesList(
th.Property(
"client_id",
th.StringType,
required=True,
description="The client_id for the credential",
),
th.Property(
"client_secret",
th.StringType,
required=True,
secret=True,
description="The client secret for the endpoint.",
),
th.Property(
"endpoint",
th.StringType,
description="The API endpoint",
)
).to_dict()
def discover_streams(self) -> list[streams.DruvaStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [streams.CyberResilienceSettings(self), streams.SensitiveDataGovernanceSettings(self)]
if __name__ == "__main__":
TapDruva.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/schemas/cyber_resilience_settings.json | {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"AVScanEnabled": {
"type": "boolean"
},
"allowAdminToSkipScanEndpoints": {
"type": "boolean"
},
"allowAdminToSkipScanServers": {
"type": "boolean"
},
"allowUserToSkipScanEndpoints": {
"type": "boolean"
},
"fileHashScanEnabled": {
"type": "boolean"
},
"skipScanForDeviceReplace": {
"type": "boolean"
}
},
"required": [
"AVScanEnabled",
"fileHashScanEnabled",
"allowAdminToSkipScanEndpoints",
"allowUserToSkipScanEndpoints",
"allowAdminToSkipScanServers",
"skipScanForDeviceReplace"
],
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva | /Users/nchebolu/work/raptor/taps/tap-druva/src/tap_druva/schemas/sensitive_data_governance_settings.json | {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"daysToResolveArchivedViolations": {
"type": "integer"
},
"daysToResolveCriticalViolations": {
"type": "integer"
},
"daysToResolveNonCriticalViolations": {
"type": "integer"
},
"isArchiveScan": {
"type": "boolean"
},
"isAutoArchiveResolvedViolations": {
"type": "boolean"
},
"isAutoResolveViolations": {
"type": "boolean"
}
},
"required": [
"isAutoResolveViolations",
"isArchiveScan",
"daysToResolveNonCriticalViolations",
"daysToResolveArchivedViolations",
"daysToResolveCriticalViolations",
"isAutoArchiveResolvedViolations"
],
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-obsidian/Makefile | # Pinned python dependencies
PIP_VERSION ?= 23.1.2
SETUPTOOLS_VERSION ?= 65.5.1
WHEEL_VERSION ?= 0.38.4
# Activate venv
VIRTUAL_ENV ?= $(PWD)/.venv
PATH := ${VIRTUAL_ENV}/bin:${PATH}
.PHONY: init pre-commit precommit pytest dagit test-container run-test-container create-docker-builder localstack localstack-down
.venv:
python3 -m venv .venv
install: .venv
pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION} wheel==${WHEEL_VERSION}
CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install -e .[dev,test]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-obsidian/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-obsidian"
description = "`tap-obsidian` is a Singer tap for obsidian, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "obsidian"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"psycopg2-binary",
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-obsidian = "tap_obsidian.tap:TapObsidian.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-obsidian/README.md | # tap-obsidian
`tap-obsidian` is a Singer tap for obsidian.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Setup
Run
```shell
meltano install
```
## Configuration
TODO
## Discovery
Streams and fields can be discovered through running the `select` command
```shell
meltano select tap-obsidian --list --all
```
If you wish to select individual fields this can also be done at this point or directly in metlano.yml
## Run pipeline
The pipeline can be run with
```shell
meltano elt tap-obsidian target-jsonl --job_id=some_job_id
```
The output files can be found in the output directory
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-obsidian/meltano.yml | version: 1
send_anonymous_usage_stats: false
project_id: tap-obsidian
plugins:
extractors:
- name: tap-obsidian
namespace: tap_obsidian
pip_url: -e .
capabilities:
- state
- catalog
- discover
# Add config settings here
settings:
- name: partition_org_id
- name: postgres_host
- name: postgres_port
- name: postgres_database
- name: postgres_username
- name: postgres_password
kind: password
select:
- "*.browser_id"
- "*.emails"
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-obsidian/src | /Users/nchebolu/work/raptor/taps/tap-obsidian/src/tap_obsidian/streams.py | import typing as t
from sqlalchemy import Table
from tap_obsidian.client import ObsidianExtensionStream
class ExtensionUsersStream(ObsidianExtensionStream):
name = "users"
def get_table_name(self) -> str:
return "extension_users"
def get_columns(self, table: Table) -> list[t.Any]:
return [
table.c.browser_id,
table.c.emails,
]
| 0 |
/Users/nchebolu/work/raptor/taps/tap-obsidian/src | /Users/nchebolu/work/raptor/taps/tap-obsidian/src/tap_obsidian/client.py | from __future__ import annotations
import typing as t
from singer_sdk import Stream
from singer_sdk.helpers._typing import TypeConformanceLevel
from sqlalchemy import MetaData, Table, select
from sqlalchemy.engine import Engine, URL, create_engine
from sqlalchemy.orm import Session
from sqlalchemy.sql import Select
from sqlalchemy.sql.base import ImmutableColumnCollection
from contextlib import contextmanager
from functools import cache, cached_property
from pathlib import Path
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
SCHEMA_FILEPATH = SCHEMAS_DIR / "generic.json"
class ObsidianExtensionStream(Stream):
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.NONE
@property
def schema_filepath(self) -> Path | None:
return SCHEMA_FILEPATH
def get_schema_name(self) -> str:
return f"{self.config['partition_org_id']}_analytics"
def get_table_name(self) -> str:
raise NotImplementedError("Must define a table name")
@cache
def get_table(self) -> Table:
return Table(self.get_table_name(), self.db_metadata, schema=self.get_schema_name(), autoload_with=self.engine)
def get_columns(self, table: Table) -> ImmutableColumnCollection:
return t.cast(ImmutableColumnCollection, table.columns)
def get_select_statement(self, context: dict | None) -> Select:
return select(self.get_columns(self.get_table()))
@cached_property
def engine(self) -> Engine:
engine = create_engine(self.db_url, echo=False,)
return t.cast(Engine, engine)
@cached_property
def db_url(self) -> str:
"""Concatenate a SQLAlchemy URL for use in connecting to the source.
Args:
config: A dict with connection parameters
Returns:
SQLAlchemy connection string
"""
url = URL.create(
drivername="postgresql",
host=self.config["postgres_host"],
port=self.config["postgres_port"],
database=self.config["postgres_database"],
username=self.config["postgres_username"],
password=self.config["postgres_password"],
)
return str(url)
@cached_property
def db_metadata(self):
return MetaData()
@property
@contextmanager
def session(self) -> t.Generator[Session, None, None]:
with Session(self.engine) as session:
yield session
def get_records(
self,
context: dict | None,
) -> t.Iterable[dict | tuple[dict, dict | None]]:
with self.session as session:
stmt = self.get_select_statement(context)
for row in session.execute(stmt, execution_options={"stream_results": True}):
yield self.transform_row(dict(row))
def transform_row(self, row: dict) -> dict:
return row
| 0 |
/Users/nchebolu/work/raptor/taps/tap-obsidian/src | /Users/nchebolu/work/raptor/taps/tap-obsidian/src/tap_obsidian/tap.py | from __future__ import annotations
import typing as t
from singer_sdk import Stream, Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_obsidian import streams
class TapObsidian(Tap):
"""Obsidian tap class."""
name = "tap-obsidian"
config_jsonschema = th.PropertiesList(
th.Property(
"postgres_host",
th.StringType,
required=True,
description="The postgres host to connect to",
),
th.Property(
"postgres_port",
th.StringType,
required=True,
description="The postgres port to connect to",
),
th.Property(
"postgres_database",
th.StringType,
required=True,
description="The postgres database to connect to",
),
th.Property(
"postgres_username",
th.StringType,
required=True,
description="The postgres username to connect with",
),
th.Property(
"postgres_password",
th.StringType,
required=True,
secret=True,
description="The postgres password to connect with",
),
th.Property(
"partition_org_id",
th.StringType,
required=True,
description="The org id to partition the data by",
)
).to_dict()
def discover_streams(self) -> t.Sequence[Stream]:
return [
streams.ExtensionUsersStream(self)
]
if __name__ == "__main__":
TapObsidian.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-obsidian/src/tap_obsidian | /Users/nchebolu/work/raptor/taps/tap-obsidian/src/tap_obsidian/schemas/generic.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": true,
"properties": {},
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-successfactors/Makefile | # Pinned python dependencies
PIP_VERSION ?= 23.1.2
SETUPTOOLS_VERSION ?= 65.5.1
WHEEL_VERSION ?= 0.38.4
# Activate venv
VIRTUAL_ENV ?= $(PWD)/.venv
PATH := ${VIRTUAL_ENV}/bin:${PATH}
.PHONY: init pre-commit precommit pytest dagit test-container run-test-container create-docker-builder localstack localstack-down
.venv:
python3 -m venv .venv
install: .venv
pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION} wheel==${WHEEL_VERSION}
CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install -e .[dev,test]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-successfactors/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-successfactors"
description = "`tap-successfactors` is a Singer tap for successfactors, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "successfactors"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-successfactors = "tap_successfactors.tap:TapSuccessfactors.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-successfactors/README.md | # tap-successfactors
`tap-successfactors` is a Singer tap for successfactors.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Setup
Run
```shell
meltano install
```
## Configuration
TODO
## Discovery
Streams and fields can be discovered through running the `select` command
```shell
meltano select tap-successfactors --list --all
```
If you wish to select individual fields this can also be done at this point or directly in metlano.yml
## Run pipeline
The pipeline can be run with
```shell
meltano elt tap-successfactors target-jsonl --job_id=some_job_id
```
The output files can be found in the output directory
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-successfactors/meltano.yml | version: 1
send_anonymous_usage_stats: false
project_id: tap-successfactors
plugins:
extractors:
- name: tap-successfactors
namespace: tap_successfactors
pip_url: -e .
capabilities:
- state
- catalog
- discover
select:
- '*.*'
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-successfactors/src | /Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors/streams.py | """Stream type classes for tap-successfactors."""
from __future__ import annotations
from pathlib import Path
from singer_sdk import typing as th
from tap_successfactors.client import SuccessfactorsStream
class UsersStream(SuccessfactorsStream):
name = "users"
path = "/odata/v2/User?$filter=status in 't','f','T','F','e','d'"
primary_keys = ["userId"]
replication_key = None
# TODO: add select parameter for required fields.
class PermissionRolesStream(SuccessfactorsStream):
"""
RBP uses permission roles to group a set of permissions. After grouping
the permissions into a role, you can assign the role to a group of users,
granting them access to certain tasks and features in your system.
"""
name = "rbp_permission_roles"
path = "/odata/v2/RBPRole"
primary_keys = ["roleId"]
replication_key = None
def get_child_context(self, record: dict, context: dict | None) -> dict:
return {"roleId": record["roleId"]}
class PermissionAssignmentRules(SuccessfactorsStream):
"""
Rules are defined by determining which permission roles you’ll assign to
your groups or users. From the Permission Role Detail screen in your system,
each rule is represented by a row that contains your list of granted users
or groups and the associated target group. Depending on the complexity of
the roles and access or target group assignments, your roles could have
various combinations of access and target group rules.
"""
name = "rbp_permission_assignment_rules"
# TODO: add select parameter for required fields
path = "/odata/v2/RBPRule?$expand=accessGroups,targetGroups,roles"
primary_keys = ["ruleId"]
replication_key = None
class PermissionsStream(SuccessfactorsStream):
"""List of permissions assigned to each role"""
name = "rbp_permissions"
path = "/odata/v2/RBPRole({roleId}L)/permissions"
primary_keys = ["permissionId"]
replication_key = None
parent_stream_type = PermissionRolesStream
class DynamicGroupsStream(SuccessfactorsStream):
# I'm not sure whether static groups are included in this endpoint
# TODO: might be able to take out since we expand groups in the permission rules stream
name = "dynamic_groups"
path = "/odata/v2/DynamicGroup"
primary_keys = ["GroupId"]
replication_key = None
| 0 |
/Users/nchebolu/work/raptor/taps/tap-successfactors/src | /Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors/client.py | """REST client handling, including SuccessfactorsStream base class."""
from __future__ import annotations
from pathlib import Path
from typing import Any
from collections.abc import Callable, Iterable
import requests
from singer_sdk.authenticators import BasicAuthenticator
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.helpers._typing import TypeConformanceLevel
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import RESTStream
from tap_successfactors.paginator import OData2Paginator
SCHEMA_FILE = Path(__file__).parent / "schemas" / "generic.json"
class SuccessfactorsStream(RESTStream):
"""successfactors stream class."""
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.NONE
schema_filepath = SCHEMA_FILE
# server side pagination type cursor or snapshot
paging_type: str = "cursor"
records_jsonpath = "$.d.results[*]" # Or override `parse_response`
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
return self.config.get("url_base")
@property
def authenticator(self) -> BasicAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return BasicAuthenticator.create_for_stream(
self,
username=self.config.get("username", "") + "@" + self.config.get("company_id", ""),
password=self.config.get("password", ""),
)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
if "user_agent" in self.config:
headers["User-Agent"] = self.config.get("user_agent")
headers["Accept"] = "application/json"
return headers
def get_new_paginator(self) -> BaseAPIPaginator:
return OData2Paginator(None, ("d", "__next"), "$skiptoken")
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
if next_page_token:
params["$skiptoken"] = next_page_token
if self.replication_key:
params["$orderby"] = self.replication_key
return params
def parse_response(self, response: requests.Response) -> Iterable[dict]:
"""Parse the response and return an iterator of result records.
Args:
response: The HTTP ``requests.Response`` object.
Yields:
Each record from the source.
"""
yield from extract_jsonpath(self.records_jsonpath, input=response.json())
| 0 |
/Users/nchebolu/work/raptor/taps/tap-successfactors/src | /Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors/paginator.py | import logging
from typing import Any
from requests import Response
from urllib.parse import urlparse, parse_qs
from functools import reduce
from singer_sdk.pagination import BaseAPIPaginator
class OData2Paginator(BaseAPIPaginator):
def __init__(self, start_value: Any, page_info_path: str, cursor_param: str) -> None:
super().__init__(start_value)
self.page_info_path = page_info_path
self.cursor_param = cursor_param
def get_next(self, response: Response) -> Any | None:
"""Get the next pagination token or index from the API response.
Args:
response: API response object.
Returns:
The next page token or index. Return `None` from this method to indicate
the end of pagination.
"""
response_data: dict = response.json()
next_page_token: str = None
if (raw_url := reduce(dict.get, self.page_info_path, response_data)):
parsed_url = urlparse(raw_url)
next_page_token = parse_qs(parsed_url.query)[self.cursor_param]
logging.info(f'Found cursor for pagination: {next_page_token}')
return next_page_token
| 0 |
/Users/nchebolu/work/raptor/taps/tap-successfactors/src | /Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors/tap.py | """successfactors tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th
from tap_successfactors import streams
class TapSuccessfactors(Tap):
"""successfactors tap class."""
name = "tap-successfactors"
config_jsonschema = th.PropertiesList(
th.Property(
"url_base",
th.StringType,
description="The url for the API service",
),
th.Property(
"username",
th.StringType,
description="The username for the API service",
),
th.Property(
"password",
th.StringType,
description="The password for the API service",
),
th.Property(
"company_id",
th.StringType,
description="Company ID",
),
).to_dict()
def discover_streams(self) -> list[streams.SuccessfactorsStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.UsersStream(self),
streams.PermissionRolesStream(self),
streams.PermissionAssignmentRules(self),
streams.PermissionsStream(self),
streams.DynamicGroupsStream(self),
]
if __name__ == "__main__":
TapSuccessfactors.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors | /Users/nchebolu/work/raptor/taps/tap-successfactors/src/tap_successfactors/schemas/generic.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": true,
"properties": {},
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-jumpcloud"
description = "`tap-jumpcloud` is a Singer tap for jumpcloud, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "jumpcloud"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-jumpcloud = 'tap_jumpcloud.tap:TapJumpcloud.cli'
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/README.md | # `tap-jumpcloud`
Jumpcloud tap class.
Built with the [Meltano Singer SDK](https://sdk.meltano.com).
## Installation
An example GitLab installation command:
```bash
pipx install git+https://gitlab.com/ORG_NAME/tap-jumpcloud.git
```
## Capabilities
* `catalog`
* `state`
* `discover`
* `about`
* `stream-maps`
* `schema-flattening`
## Settings
| Setting | Required | Default | Description |
|:--------------------|:--------:|:-------:|:------------|
| auth_token | True | None | API key from https://console.jumpcloud.com ,click your profile picture, then "My API Key" |
A full list of supported settings and capabilities is available by running: `tap-jumpcloud --about`
### Configure using environment variables
This Singer tap will automatically import any environment variables within the working directory's
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.
### Source Authentication and Authorization
To obtain an API Key, login to Jumpcloud, click your profile in the upper right and select `My API Key`. Use this value in tap config.
## Usage
You can easily run `tap-jumpcloud` by itself or in a pipeline using [Meltano](https://meltano.com/).
### Executing the Tap Directly
```bash
tap-jumpcloud --version
tap-jumpcloud --help
tap-jumpcloud --config CONFIG --discover > ./catalog.json
```
## Developer Resources
Follow these instructions to contribute to this project.
### Initialize your Development Environment
```bash
pipx install poetry
poetry install
```
### Create and Run Tests
Create tests within the `tap_jumpcloud/tests` subfolder and
then run:
```bash
poetry run pytest
```
You can also test the `tap-jumpcloud` CLI interface directly using `poetry run`:
```bash
poetry run tap-jumpcloud --help
```
### Testing with [Meltano](https://www.meltano.com)
_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._
Next, install Meltano (if you haven't already) and any needed plugins:
```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-jumpcloud
meltano install
```
Now you can test and orchestrate using Meltano:
```bash
# Test invocation:
meltano invoke tap-jumpcloud --version
# OR run a test `elt` pipeline:
meltano elt tap-jumpcloud target-jsonl
```
### SDK Dev Guide
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/meltano.yml | version: 1
send_anonymous_usage_stats: true
project_id: tap-jumpcloud
default_environment: test
environments:
- name: test
plugins:
extractors:
- name: tap-jumpcloud
namespace: tap_jumpcloud
pip_url: -e .
capabilities:
- state
- catalog
- discover
- about
- stream-maps
settings:
- name: auth_token
kind: password
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/streams.py | """Stream type classes for tap-jumpcloud."""
from __future__ import annotations
from typing import Any, Dict, Optional
from singer_sdk import typing as th # JSON Schema typing helpers
from tap_jumpcloud.client import JumpcloudStream
from pathlib import Path
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class AuthenticationPolicyStream(JumpcloudStream):
"""Authentication Policies."""
name = "authentication_policy"
path = "/v2/authn/policies"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
class UserGroupStream(JumpcloudStream):
"""User Groups stream."""
name = "usergroup"
path = "/v2/usergroups"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
def get_child_context(self, record: dict, context: dict | None) -> dict:
return {
"usergroup_id": record["id"],
}
class UserGroupMemberStream(JumpcloudStream):
"""Gets members of a UserGroup."""
name = "usergroup_member"
path = "/v2/usergroups/{usergroup_id}/members"
primary_keys = ["id"]
ignore_parent_replication_key = True
parent_stream_type = UserGroupStream
partitions = None
schema_filepath = SCHEMAS_DIR / f"{name}.json"
class SystemGroupStream(JumpcloudStream):
"""System Groups stream."""
name = "systemgroup"
path = "/v2/systemgroups"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
def get_child_context(self, record: dict, context: dict | None) -> dict:
return {
"_sdc_systemgroup_id": record["id"],
}
class SystemGroupAssociationStream(JumpcloudStream):
"""System Group stream."""
name = "systemgroup_association"
path = "/v2/systemgroups/{_sdc_systemgroup_id}/associations"
primary_keys = ["id","_sdc_systemgroup_id"]
ignore_parent_replication_key = True
parent_stream_type = SystemGroupStream
@property
def base_partition(self):
return [
{"targets": "command"},
{"targets": "policy"},
{"targets": "policy_group"},
{"targets": "user"},
{"targets": "user_group"},
]
partitions=[]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
def get_url_params(
self,
context: dict | None,
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
params["targets"] = context['targets']
return params
class UserStream(JumpcloudStream):
name = "user"
path = "/systemusers"
primary_keys = ["id"]
replication_key = "_id"
records_jsonpath = "$['results'].[*]"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
api_version = 1
class OrganizationsStream(JumpcloudStream):
"""Organizations stream."""
name = "organizations"
path = "/organizations"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
api_version = 1
class SettingsStream(JumpcloudStream):
"""Settings stream."""
name = "settings"
path = "/settings"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
api_version = 1
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/client.py | """REST client handling, including JumpcloudStream base class."""
from __future__ import annotations
from pathlib import Path
from typing import Any, cast
from collections.abc import Callable, Iterable
import requests
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.streams import RESTStream
PAGE_SIZE = 100
from singer_sdk.pagination import BaseOffsetPaginator
class Jumpcloudv2Paginator(BaseOffsetPaginator):
def has_more(self, response):
count = response.headers.get("x-total-count")
return int(count if count else 0) > self.get_next(response)
class Jumpcloudv1Paginator(BaseOffsetPaginator):
def has_more(self, response):
if "totalCount" in response.json():
count = response.json()["totalCount"]
return int(count if count else 0) > self.get_next(response)
else:
return False
class JumpcloudStream(RESTStream):
"""Jumpcloud stream class.
Subclasses that access the v1 API must set "api_version = 1"
"""
api_version = 2 # Default to version 2 of the API.
url_base = "https://console.jumpcloud.com/api"
records_jsonpath = "$[*]"
def get_new_paginator(self):
if self.api_version == 2:
return Jumpcloudv2Paginator(start_value=0, page_size=PAGE_SIZE)
elif self.api_version == 1:
return Jumpcloudv1Paginator(start_value=0, page_size=PAGE_SIZE)
@property
def authenticator(self) -> APIKeyAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return APIKeyAuthenticator.create_for_stream(
self,
key="x-api-key",
value=self.config["auth_token"],
location="header",
)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
if "user_agent" in self.config:
headers["User-Agent"] = self.config.get("user_agent")
return headers
def get_url_params(
self,
context: dict | None,
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
params["limit"] = PAGE_SIZE
if next_page_token:
params["skip"] = next_page_token
if self.replication_key:
params["sort"] = [self.replication_key]
return params
# Sourced from: https://github.com/AutoIDM/tap-clickup/pull/117/files#diff-4490b7dbe49a82fea4fdf63d08c6c503536d30f56841c428f2998bf03b4b94a2
def from_parent_context(self, context: dict):
if self.partitions is None:
return context
else:
# Goal here is to combine Parent/Child relationships with Partions
# Another way to think about this is that Partitions are now
# Lists of contexts, used to create multiple requests based on one context.
# ie we have one team_id and we need a requst
# for archieved=true and archieved=False
# For N Child relationships if we have K base_partitions we'll end up with N*K partitions
# Assumption is that base_partition is a list of dicts
child_context_plus_base_partition = []
for partition in self.base_partition:
child_plus_partition = context.copy()
child_plus_partition.update(partition)
child_context_plus_base_partition.append(child_plus_partition)
self.partitions = child_context_plus_base_partition
return None # self.partitions handles context in the _sync call. Important this is None to use partitions
# Sourced from: https://github.com/AutoIDM/tap-clickup/pull/117/files#diff-4490b7dbe49a82fea4fdf63d08c6c503536d30f56841c428f2998bf03b4b94a2
def _sync_children(self, child_context: dict) -> None:
for child_stream in self.child_streams:
if child_stream.selected or child_stream.has_selected_descendents:
child_stream.sync(
child_stream.from_parent_context(context=child_context)
)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/__init__.py | """Tap for Jumpcloud."""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/tap.py | """Jumpcloud tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_jumpcloud import streams
class TapJumpcloud(Tap):
"""Jumpcloud tap class."""
name = "tap-jumpcloud"
config_jsonschema = th.PropertiesList(
th.Property(
"auth_token",
th.StringType,
required=True,
description=("API key from https://console.jumpcloud.com ,"
"click your profile picture, then \"My API Key\""),
),
).to_dict()
def discover_streams(self) -> list[streams.JumpcloudStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.AuthenticationPolicyStream(self),
streams.UserGroupStream(self),
streams.UserGroupMemberStream(self),
streams.SystemGroupStream(self),
streams.SystemGroupAssociationStream(self),
streams.UserStream(self),
streams.OrganizationsStream(self),
streams.SettingsStream(self)
]
if __name__ == "__main__":
TapJumpcloud.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/settings.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"API_KEY": {
"type": [
"null",
"string"
]
},
"CLIENT_SIDE_REQUEST_LIMIT": {
"type": [
"null",
"integer"
]
},
"CONNECT_KEY": {
"type": [
"null",
"string"
]
},
"CSRF_TOKEN": {
"type": [
"null",
"string"
]
},
"DIRECTORIES_CONFIG": {
"properties": {
"connectKey": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"EMAIL": {
"type": [
"null",
"string"
]
},
"GLOBAL_CONFIG": {
"properties": {
"identitySourceAgentVersion": {
"type": [
"null",
"string"
]
},
"latestWhatsNewPublishedDate": {
"type": [
"null",
"string"
]
},
"syncAgentVersion": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"HAS_CREDIT_CARD": {
"type": [
"null",
"boolean"
]
},
"ID": {
"type": [
"null",
"string"
]
},
"IS_CUSTOMER": {
"type": [
"null",
"boolean"
]
},
"LDAP_CONFIG": {
"properties": {
"administrator": {
"type": [
"null",
"string"
]
},
"apiKey": {
"type": [
"null",
"string"
]
},
"directoriesActive": {
"type": [
"null",
"boolean"
]
},
"organizationId": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"MAX_SYSTEM_USERS": {
"type": [
"null",
"integer"
]
},
"ORG_ID": {
"type": [
"null",
"string"
]
},
"ROLE": {
"type": [
"null",
"string"
]
},
"SETTINGS": {
"properties": {
"agentVersion": {
"type": [
"null",
"string"
]
},
"contactEmail": {
"type": [
"null",
"string"
]
},
"contactName": {
"type": [
"null",
"string"
]
},
"deviceIdentificationEnabled": {
"type": [
"null",
"boolean"
]
},
"disableCommandRunner": {
"type": [
"null",
"boolean"
]
},
"disableGoogleLogin": {
"type": [
"null",
"boolean"
]
},
"disableLdap": {
"type": [
"null",
"boolean"
]
},
"disableUM": {
"type": [
"null",
"boolean"
]
},
"duplicateLDAPGroups": {
"type": [
"null",
"boolean"
]
},
"enableGoogleApps": {
"type": [
"null",
"boolean"
]
},
"enableManagedUID": {
"type": [
"null",
"boolean"
]
},
"enableO365": {
"type": [
"null",
"boolean"
]
},
"enableUserPortalAgentInstall": {
"type": [
"null",
"boolean"
]
},
"features": {
"properties": {
"directoryInsights": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"directoryInsightsPremium": {
"properties": {
"createdAt": {
"type": [
"null",
"string"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"updatedAt": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"systemInsights": {
"properties": {
"createdAt": {
"type": [
"null",
"string"
]
},
"enableNewDarwin": {
"type": [
"null",
"boolean"
]
},
"enableNewLinux": {
"type": [
"null",
"boolean"
]
},
"enableNewWindows": {
"type": [
"null",
"boolean"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"updatedAt": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"growthData": {
"properties": {
"experimentStates": {
"properties": {
"22640402990": {
"properties": {
"experimentName": {
"type": [
"null",
"string"
]
},
"variationState": {
"properties": {
"variationId": {
"type": [
"null",
"string"
]
},
"variationName": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"onboardingState": {
"properties": {
"signupReferralUrl": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"name": {
"type": [
"null",
"string"
]
},
"newSystemUserStateDefaults": {
"properties": {
"applicationImport": {
"type": [
"null",
"string"
]
},
"csvImport": {
"type": [
"null",
"string"
]
},
"manualEntry": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"passwordCompliance": {
"type": [
"null",
"string"
]
},
"passwordPolicy": {
"properties": {
"allowUsernameSubstring": {
"type": [
"null",
"boolean"
]
},
"daysAfterExpirationToSelfRecover": {
"type": [
"null",
"integer"
]
},
"daysBeforeExpirationToForceReset": {
"type": [
"null",
"integer"
]
},
"effectiveDate": {
"type": [
"null",
"string"
]
},
"enableDaysAfterExpirationToSelfRecover": {
"type": [
"null",
"boolean"
]
},
"enableDaysBeforeExpirationToForceReset": {
"type": [
"null",
"boolean"
]
},
"enableLockoutTimeInSeconds": {
"type": [
"null",
"boolean"
]
},
"enableMaxHistory": {
"type": [
"null",
"boolean"
]
},
"enableMaxLoginAttempts": {
"type": [
"null",
"boolean"
]
},
"enableMinChangePeriodInDays": {
"type": [
"null",
"boolean"
]
},
"enableMinLength": {
"type": [
"null",
"boolean"
]
},
"enablePasswordExpirationInDays": {
"type": [
"null",
"boolean"
]
},
"enableRecoveryEmail": {
"type": [
"null",
"boolean"
]
},
"enableResetLockoutCounter": {
"type": [
"null",
"boolean"
]
},
"lockoutTimeInSeconds": {
"type": [
"null",
"integer"
]
},
"maxHistory": {
"type": [
"null",
"integer"
]
},
"maxLoginAttempts": {
"type": [
"null",
"integer"
]
},
"minChangePeriodInDays": {
"type": [
"null",
"integer"
]
},
"minLength": {
"type": [
"null",
"integer"
]
},
"needsLowercase": {
"type": [
"null",
"boolean"
]
},
"needsNumeric": {
"type": [
"null",
"boolean"
]
},
"needsSymbolic": {
"type": [
"null",
"boolean"
]
},
"needsUppercase": {
"type": [
"null",
"boolean"
]
},
"passwordExpirationInDays": {
"type": [
"null",
"integer"
]
},
"resetLockoutCounterMinutes": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"pendingDelete": {
"type": [
"null",
"boolean"
]
},
"showIntro": {
"type": [
"null",
"boolean"
]
},
"systemUserPasswordExpirationInDays": {
"type": [
"null",
"integer"
]
},
"systemUsersCanEdit": {
"type": [
"null",
"boolean"
]
},
"userPortal": {
"properties": {
"idleSessionDurationMinutes": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"windowsMDM": {
"properties": {
"autoEnroll": {
"type": [
"null",
"boolean"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"STRIPE_ID_PRESENT": {
"type": [
"null",
"boolean"
]
},
"SUPPORT_LEVEL": {
"type": [
"null",
"string"
]
},
"USER_NEED_PW_RESET": {
"type": [
"null",
"boolean"
]
},
"USER_PASS_SET": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/authentication_policy.json | {
"properties": {
"conditions": {
"properties": {
"all": {
"items": {
"properties": {
"deviceEncrypted": {
"type": [
"null",
"boolean"
]
},
"deviceManaged": {
"type": [
"null",
"boolean"
]
},
"ipAddressIn": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"locationIn": {
"properties": {
"countries": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"not": {
"properties": {
"ipAddressIn": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"locationIn": {
"properties": {
"countries": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"any": {
"items": {
"properties": {
"deviceEncrypted": {
"type": [
"null",
"boolean"
]
},
"deviceManaged": {
"type": [
"null",
"boolean"
]
},
"ipAddressIn": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"locationIn": {
"properties": {
"countries": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"not": {
"properties": {
"ipAddressIn": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"locationIn": {
"properties": {
"countries": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"description": {
"type": [
"null",
"string"
]
},
"disabled": {
"type": [
"null",
"boolean"
]
},
"effect": {
"properties": {
"action": {
"type": [
"null",
"string"
]
},
"obligations": {
"properties": {
"mfa": {
"properties": {
"required": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"userVerification": {
"properties": {
"requirement": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"targets": {
"properties": {
"resources": {
"items": {
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"userAttributes": {
"properties": {
"exclusions": {
"items": {
"properties": {
"field": {
"type": [
"null",
"string"
]
},
"operator": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"inclusions": {
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"userGroups": {
"properties": {
"exclusions": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"inclusions": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"users": {
"properties": {
"inclusions": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/organizations.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"results": {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"created": {
"type": [
"null",
"string"
]
},
"displayName": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"logoUrl": {
"type": [
"null",
"string"
]
}
},
"type": "array"
}
}
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/usergroup.json | {
"properties": {
"attributes": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"email": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/user.json | {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"account_locked": {
"type": [
"null",
"boolean"
]
},
"account_locked_date": {
"type": [
"null",
"string"
]
},
"activated": {
"type": [
"null",
"boolean"
]
},
"addresses": {
"items": {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"country": {
"type": [
"null",
"string"
]
},
"locality": {
"type": [
"null",
"string"
]
},
"poBox": {
"type": [
"null",
"string"
]
},
"postalCode": {
"type": [
"null",
"string"
]
},
"region": {
"type": [
"null",
"string"
]
},
"streetAddress": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"allow_public_key": {
"type": [
"null",
"boolean"
]
},
"alternateEmail": {
"type": [
"null",
"string"
]
},
"attributes": {
"items": {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"company": {
"type": [
"null",
"string"
]
},
"costCenter": {
"type": [
"null",
"string"
]
},
"created": {
"type": [
"null",
"string"
]
},
"department": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"disableDeviceMaxLoginAttempts": {
"type": [
"null",
"boolean"
]
},
"displayname": {
"type": [
"null",
"string"
]
},
"email": {
"type": [
"null",
"string"
]
},
"employeeIdentifier": {
"type": [
"null",
"string"
]
},
"employeeType": {
"type": [
"null",
"string"
]
},
"enable_managed_uid": {
"type": [
"null",
"boolean"
]
},
"enable_user_portal_multifactor": {
"type": [
"null",
"boolean"
]
},
"external_dn": {
"type": [
"null",
"string"
]
},
"external_source_type": {
"type": [
"null",
"string"
]
},
"externally_managed": {
"type": [
"null",
"boolean"
]
},
"firstname": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"jobTitle": {
"type": [
"null",
"string"
]
},
"lastname": {
"type": [
"null",
"string"
]
},
"ldap_binding_user": {
"type": [
"null",
"boolean"
]
},
"location": {
"type": [
"null",
"string"
]
},
"managedAppleId": {
"type": [
"null",
"string"
]
},
"manager": {
"type": [
"null",
"string"
]
},
"mfa": {
"properties": {
"configured": {
"type": [
"null",
"boolean"
]
},
"exclusion": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"mfaEnrollment": {
"properties": {
"overallStatus": {
"type": [
"null",
"string"
]
},
"pushStatus": {
"type": [
"null",
"string"
]
},
"totpStatus": {
"type": [
"null",
"string"
]
},
"webAuthnStatus": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"middlename": {
"type": [
"null",
"string"
]
},
"organization": {
"type": [
"null",
"string"
]
},
"password_expiration_date": {
"type": [
"null",
"string"
]
},
"password_expired": {
"type": [
"null",
"boolean"
]
},
"password_never_expires": {
"type": [
"null",
"boolean"
]
},
"passwordless_sudo": {
"type": [
"null",
"boolean"
]
},
"phoneNumbers": {
"items": {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"number": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"recoveryEmail": {
"properties": {
"address": {
"type": [
"null",
"string"
]
},
"verified": {
"type": [
"null",
"boolean"
]
},
"verifiedAt": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"samba_service_user": {
"type": [
"null",
"boolean"
]
},
"ssh_keys": {
"items": {
"properties": {
"_id": {
"type": [
"null",
"string"
]
},
"create_date": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"public_key": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"string",
"object"
]
},
"type": [
"null",
"array"
]
},
"state": {
"type": [
"null",
"string"
]
},
"sudo": {
"type": [
"null",
"boolean"
]
},
"suspended": {
"type": [
"null",
"boolean"
]
},
"systemUsername": {
"type": [
"null",
"string"
]
},
"totp_enabled": {
"type": [
"null",
"boolean"
]
},
"unix_guid": {
"type": [
"null",
"integer"
]
},
"unix_uid": {
"type": [
"null",
"integer"
]
},
"username": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/systemgroup.json | {
"properties": {
"attributes": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"email": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/usergroup_member.json | {
"properties": {
"attributes": {
"type": [
"null",
"string"
]
},
"to": {
"properties": {
"attributes": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"usergroup_id": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud | /Users/nchebolu/work/raptor/taps/tap-jumpcloud/src/tap_jumpcloud/schemas/systemgroup_association.json | {
"properties": {
"_sdc_systemgroup_id": {
"type": [
"null",
"string"
]
},
"attributes": {
"type": [
"null",
"object"
]
},
"to": {
"properties": {
"attributes": {
"type": [
"null",
"object"
]
},
"id": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-monday/Makefile | # Pinned python dependencies
PIP_VERSION ?= 23.1.2
SETUPTOOLS_VERSION ?= 65.5.1
WHEEL_VERSION ?= 0.38.4
# Activate venv
VIRTUAL_ENV ?= $(PWD)/.venv
PATH := ${VIRTUAL_ENV}/bin:${PATH}
.PHONY: init pre-commit precommit pytest dagit test-container run-test-container create-docker-builder localstack localstack-down
.venv:
python3 -m venv .venv
install: .venv
pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION} wheel==${WHEEL_VERSION}
CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install -e .[dev,test]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-monday/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-monday"
description = "`tap-monday` is a Singer tap for monday, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "monday"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-monday = "tap_monday.tap:TapMonday.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-monday/README.md | # tap-monday
`tap-monday` is a Singer tap for monday.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Setup
Run
```shell
meltano install
```
## Configuration
TODO
## Discovery
Streams and fields can be discovered through running the `select` command
```shell
meltano select tap-monday --list --all
```
If you wish to select individual fields this can also be done at this point or directly in metlano.yml
## Run pipeline
The pipeline can be run with
```shell
meltano elt tap-monday target-jsonl --job_id=some_job_id
```
The output files can be found in the output directory
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-monday/meltano.yml | version: 1
default_environment: dev
send_anonymous_usage_stats: false
project_id: tap-monday
environments:
- name: dev
plugins:
extractors:
- name: tap-monday
namespace: tap_monday
pip_url: -e .
capabilities:
- state
- catalog
- discover
# Add config settings here
settings:
- name: auth_token
select:
- "*.*"
config:
auth_token:
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/streams.py | """Stream type classes for tap-monday."""
from __future__ import annotations
from pathlib import Path
from tap_monday.client import MondayPaginator, MondayStream
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class PlanStream(MondayStream):
"""Stream to fetch Monday Plan. """
name ="plan"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["tier","version"]
records_jsonpath = "$.data.account.plan[*]"
query = """
account {
plan {
max_users
period
tier
version
}
}
"""
def parse_response(self, response: requests.Response) -> Iterable[dict]:
"""
Add optional override for plan endpoint to enforce generating
value plan data for customer licensing trail.
"""
resp_json = response.json()
plan = resp_json['data']['account']['plan']
if plan == None:
# Handle if there is no plan (I.e free account)
mockResp = [{"max_users": 100, "version": 2, "period": "1-Year", "tier":"pro"}]
nullResp = [{"max_users": None, "version": None, "period": None, "tier": None}]
plan = mockResp
yield from plan
class UserStream(MondayStream):
"""Stream to fetch all Monday Users."""
name = "user"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["id"]
records_jsonpath = "$.data.users[*]"
def get_new_paginator(self) -> MondayPaginator:
"""Create a MondayPaginator that retrieves 1000 records per page."""
return MondayPaginator(limit=1000, jsonpath=self.records_jsonpath)
# This query, when paginated at 1000 records per page, costs 73010 complexity.
# Note that all API calls are rate-limited to 5,000,000 complexity per minute.
# Docs: https://developer.monday.com/api-reference/docs/rate-limits
query = """
query ($limit: Int, $page: Int) {
users(limit: $limit, page: $page) {
birthday
country_code
created_at
current_language
email
enabled
id
is_admin
is_guest
is_pending
is_view_only
is_verified
join_date
last_activity
location
mobile_phone
name
photo_original
photo_small
photo_thumb
photo_thumb_small
photo_tiny
sign_up_product_kind
time_zone_identifier
title
url
utc_hours_diff
account {
id
}
out_of_office {
active
disable_notifications
end_date
start_date
type
}
teams {
id
}
}
}"""
class WorkspaceStream(MondayStream):
"""Stream to fetch all Monday Workspaces."""
name = "workspace"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["id"]
records_jsonpath = "$.data.workspaces[*]"
def get_new_paginator(self) -> MondayPaginator:
"""Create a MondayPaginator that retrieves 10 records per page."""
return MondayPaginator(limit=10, jsonpath=self.records_jsonpath)
# This query, when paginated at 10 records per page, costs 300530 complexity.
# Note that all API calls are rate-limited to 5,000,000 complexity per minute.
# Limiting subqueries to 10,000 records is necessary to keep complexity low.
# Docs: https://developer.monday.com/api-reference/docs/rate-limits
query = """
query ($limit: Int, $page: Int) {
workspaces(state: all, limit: $limit, page: $page) {
created_at
description
id
kind
name
state
account_product {
id
kind
}
owners_subscribers(limit: 10000) {
id
}
settings {
icon {
color
image
}
}
teams_subscribers(limit: 10000) {
id
}
users_subscribers(limit: 10000) {
id
}
}
}"""
class AccountStream(MondayStream):
"""Stream to fetch a Monday account.
Pagination is not available for this endpoint.
"""
name = "account"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["id"]
records_jsonpath = "$.data.account"
# This query costs 36 complexity.
# Note that all API calls are rate-limited to 5,000,000 complexity per minute.
# Docs: https://developer.monday.com/api-reference/docs/rate-limits
query = """
query {
account {
country_code
first_day_of_the_week
id
logo
name
show_timeline_weekends
sign_up_product_kind
slug
tier
plan {
max_users
period
tier
version
}
products {
id
kind
}
}
}"""
class TeamStream(MondayStream):
"""Stream to fetch all Monday Teams.
Pagination is not available for this endpoint.
"""
name = "team"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["id"]
records_jsonpath = "$.data.teams[*]"
# This query costs 3010 complexity.
# Note that all API calls are rate-limited to 5,000,000 complexity per minute.
# Docs: https://developer.monday.com/api-reference/docs/rate-limits
query = """
query {
teams {
id
name
picture_url
}
}"""
class BoardStream(MondayStream):
"""Stream to fetch all Monday Boards."""
name = "board"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
primary_keys = ["id"]
records_jsonpath = "$.data.boards[*]"
def get_new_paginator(self) -> MondayPaginator:
"""Create a MondayPaginator that retrieves 10 records per page."""
return MondayPaginator(limit=10, jsonpath=self.records_jsonpath)
# This query, when paginated at 10 records per page, costs 190560 complexity.
# Note that all API calls are rate-limited to 5,000,000 complexity per minute.
# Docs: https://developer.monday.com/api-reference/docs/rate-limits
query = """
query ($limit: Int, $page: Int) {
boards(state: all, limit: $limit, page: $page) {
board_folder_id
board_kind
description
id
item_terminology
items_count
name
permissions
state
type
updated_at
workspace_id
columns {
archived
description
id
settings_str
title
type
width
}
creator {
id
}
groups {
archived
color
deleted
id
position
title
}
owners {
id
}
subscribers {
id
}
views {
id
name
settings_str
type
view_specific_data_str
}
}
}"""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/client.py | """GraphQL client handling, including MondayStream base class."""
from __future__ import annotations
from http import HTTPStatus
from typing import Any, Optional
from collections.abc import Generator
import backoff
import requests
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.exceptions import FatalAPIError, RetriableAPIError
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator
from singer_sdk.streams import GraphQLStream
class MondayPaginator(BaseAPIPaginator[Optional[list]]):
"""Pagination for Monday streams."""
def __init__(
self,
limit: int,
jsonpath: str,
*args: Any,
**kwargs: Any,
) -> None:
"""Create a new paginator.
Args:
limit: The maximum number of records to be returned per page.
jsonpath: The path to the records, to check if more are present.
args: Paginator positional arguments for base class.
kwargs: Paginator keyword arguments for base class.
"""
super().__init__([("limit", limit), ("page", 1)], *args, **kwargs)
self._limit = limit
self._jsonpath = jsonpath
def has_more(self, response: requests.Response) -> bool:
"""Check if all records for the stream have been processed."""
all_matches = extract_jsonpath(self._jsonpath, response.json())
return next(all_matches, None) is not None
def get_next(self, response: requests.Response) -> list | None: # noqa: ARG002
"""Get the next page number.
Args:
response: API response object.
Returns:
The next page number.
"""
return [("limit", self._limit), ("page", self._page_count + 1)]
class MondayStream(GraphQLStream):
"""Monday stream class."""
# GraphQL uses a static endpoint for all API calls.
# MondayStream() subclasses won't even have unique endpoints, just unique queries.
url_base: str = "https://api.monday.com/v2"
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
# Not documented as required, but added for explicitness.
headers["Accept"] = "application/json"
# Indicating Content-Type to the server is required.
# Docs: https://developer.monday.com/api-reference/docs/getting-started-1#using-the-api
headers["Content-Type"] = "application/json"
return headers
@property
def authenticator(self) -> APIKeyAuthenticator:
"""Return a new authenticator object.
After going through the initial OAuth2.0 flow, a bearer token is provided.
This token never expires.
From then on, a simple 'Authorization: Bearer {token}' format is sufficient.
Returns:
An authenticator instance.
"""
return APIKeyAuthenticator.create_for_stream(
stream = self,
key = "Authorization",
value = self.config["auth_token"],
location = "header"
)
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
) -> dict[str, Any]:
"""Get the parameters to make an API request.
For a GraphQL stream, these parameters are passed as variables.
Some GraphQL queries use $-prepended variables to access these parameters.
"""
params: dict = {}
# Pagination documentation:
# https://developer.monday.com/api-reference/docs/rate-limits#pagination
if next_page_token:
params.update(next_page_token)
return params
def validate_response(self, response: requests.Response) -> None:
"""The API will sometimes return 200 OK despite the occurence of an error.
Docs: https://developer.monday.com/api-reference/docs/errors
This override checks for that circumstance and handles it appropriately.
"""
if ( # If the response is 200 OK but the JSON has an 'errors' object.
response.status_code == HTTPStatus.OK
and next(extract_jsonpath("$.errors", input=response.json()), None)
is not None
):
# Check if the JSON has a status code.
# If so, use that to test for a retriable or fatal error.
status = next(
extract_jsonpath("$.status_code", input=response.json()),
None,
)
# If the JSON doesn't have a status code, raise a fatal error.
if status is None:
msg = self.response_error_message(response)
raise FatalAPIError(msg)
# If the above doesn't apply, check for errors normally using status code.
else:
status = response.status_code
# If the status is within the 500 range, raise a retriable error.
if (
status in self.extra_retry_statuses
or HTTPStatus.INTERNAL_SERVER_ERROR <= status <= max(HTTPStatus)
):
msg = self.response_error_message(response)
raise RetriableAPIError(msg, response)
# If the status is within the 400 range, raise a fatal error.
if HTTPStatus.BAD_REQUEST <= status < HTTPStatus.INTERNAL_SERVER_ERROR:
msg = self.response_error_message(response)
raise FatalAPIError(msg)
def response_error_message(self, response: requests.Response) -> str:
"""Override to give additional information about failed requests.
When a response provides an error code, as well as returning the HTTP status
for that error code, also provide the JSON body from the response.
"""
try:
json_info = "\nJSON Data: " + str(response.json())
except requests.exceptions.JSONDecodeError:
json_info = ""
return super().response_error_message(response) + json_info
def backoff_wait_generator(self) -> Generator[float, None, None]:
"""Override backoff to wait 60 seconds between requests.
The Monday API has a query budget of 5,000,000 "complexity" per user per
minute, so backing off for 60 seconds is appropriate.
To see the complexity cost of each stream, reference streams.py.
"""
return backoff.constant(interval=60)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/tap.py | """Monday tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_monday import streams
class TapMonday(Tap):
"""Monday tap class."""
name = "tap-monday"
config_jsonschema = th.PropertiesList(
th.Property(
"auth_token",
th.StringType,
required=True,
secret=True, # Flag config as protected.
description="The token to authenticate against the API service",
),
).to_dict()
def discover_streams(self) -> list[streams.MondayStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.UserStream(self),
streams.PlanStream(self),
# streams.WorkspaceStream(self),
# streams.AccountStream(self),
# streams.TeamStream(self),
# streams.BoardStream(self),
]
if __name__ == "__main__":
TapMonday.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/workspace.json | {
"properties": {
"account_product": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
},
"kind": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"kind": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owners_subscribers": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"settings": {
"properties": {
"icon": {
"properties": {
"color": {
"type": [
"null",
"string"
]
},
"image": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
},
"state": {
"type": [
"null",
"string"
]
},
"teams_subscribers": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"users_subscribers": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/plan.json | {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"max_users": {
"type": [
"null",
"integer"
]
},
"period": {
"type": [
"null",
"string"
]
},
"tier": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"integer"
]
}
},
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/board.json | {
"properties": {
"board_folder_id": {
"type": [
"null",
"integer"
]
},
"board_kind": {
"type": [
"null",
"string"
]
},
"columns": {
"items": {
"properties": {
"archived": {
"type": [
"null",
"boolean"
]
},
"description": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"string"
]
},
"settings_str": {
"type": [
"null",
"string"
]
},
"title": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
},
"width": {
"type": [
"integer",
"null"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"creator": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"description": {
"type": [
"null",
"string"
]
},
"groups": {
"items": {
"properties": {
"archived": {
"type": [
"boolean",
"null"
]
},
"color": {
"type": [
"null",
"string"
]
},
"deleted": {
"type": [
"boolean",
"null"
]
},
"id": {
"type": [
"null",
"string"
]
},
"position": {
"type": [
"null",
"string"
]
},
"title": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"id": {
"type": [
"null",
"string"
]
},
"item_terminology": {
"type": [
"null",
"string"
]
},
"items_count": {
"type": [
"null",
"integer"
]
},
"name": {
"type": [
"null",
"string"
]
},
"owners": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"permissions": {
"type": [
"null",
"string"
]
},
"state": {
"type": [
"null",
"string"
]
},
"subscribers": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"tags": {
"items": {
"properties": {
"color": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"type": {
"type": [
"null",
"string"
]
},
"updated_at": {
"type": [
"null",
"string"
]
},
"views": {
"items": {
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"settings_str": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
},
"view_specific_data_str": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"workspace_id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/account.json | {
"properties": {
"country_code": {
"type": [
"null",
"string"
]
},
"first_day_of_the_week": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"logo": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"plan": {
"properties": {
"max_users": {
"type": [
"null",
"integer"
]
},
"period": {
"type": [
"null",
"string"
]
},
"tier": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"products": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
},
"kind": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"show_timeline_weekends": {
"type": [
"null",
"boolean"
]
},
"sign_up_product_kind": {
"type": [
"null",
"string"
]
},
"slug": {
"type": [
"null",
"string"
]
},
"tier": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/user.json | {
"properties": {
"account": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"birthday": {
"type": [
"null",
"string"
]
},
"country_code": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"current_language": {
"type": [
"null",
"string"
]
},
"email": {
"type": [
"null",
"string"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"is_admin": {
"type": [
"null",
"boolean"
]
},
"is_guest": {
"type": [
"null",
"boolean"
]
},
"is_pending": {
"type": [
"null",
"boolean"
]
},
"is_verified": {
"type": [
"null",
"boolean"
]
},
"is_view_only": {
"type": [
"null",
"boolean"
]
},
"join_date": {
"type": [
"null",
"string"
]
},
"last_activity": {
"type": [
"null",
"string"
]
},
"location": {
"type": [
"null",
"string"
]
},
"mobile_phone": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"out_of_office": {
"properties": {
"active": {
"type": [
"null",
"boolean"
]
},
"disable_notifications": {
"type": [
"null",
"boolean"
]
},
"end_date": {
"type": [
"null",
"string"
]
},
"start_date": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"photo_original": {
"type": [
"null",
"string"
]
},
"photo_small": {
"type": [
"null",
"string"
]
},
"photo_thumb": {
"type": [
"null",
"string"
]
},
"photo_thumb_small": {
"type": [
"null",
"string"
]
},
"photo_tiny": {
"type": [
"null",
"string"
]
},
"sign_up_product_kind": {
"type": [
"null",
"string"
]
},
"teams": {
"items": {
"properties": {
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"time_zone_identifier": {
"type": [
"null",
"string"
]
},
"title": {
"type": [
"null",
"string"
]
},
"url": {
"type": [
"null",
"string"
]
},
"utc_hours_diff": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday | /Users/nchebolu/work/raptor/taps/tap-monday/src/tap_monday/schemas/team.json | {
"properties": {
"id": {
"type": [
"null",
"integer"
]
},
"name": {
"type": [
"null",
"string"
]
},
"picture_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-gitlab/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-gitlab"
description = "`tap-gitlab` is a Singer tap for gitlab, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "gitlab"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"singer-sdk==0.25.0",
]
[project.scripts]
tap-gitlab = "tap_gitlab.tap:TapGitLab.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-gitlab/README.md | # tap-gitlab
`tap-gitlab` is a Singer tap for GitLab.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Installation
An example GitLab installation command:
```bash
pipx install git+https://gitlab.com/ORG_NAME/tap-gitlab.git
```
## Configuration
### Accepted Config Options
| Setting | Required | Default | Description |
|:------------|:--------:|:------------------:|:-----------------------------------------------------------------------------------------|
| auth_token | True | None | The token to authenticate against the API service. |
| api_url | False | https://gitlab.com | The url for the API service. Examples: https://gitlab.com or https://gitlab.org_name.com |
| group_id | True | None | The id of the group to collect data for |
| api_version | False | 4 | The version of the API to use (4 is strongly recommended). |
A full list of supported settings and capabilities for this
tap is available by running:
```bash
tap-gitlab --about
```
### Configure using environment variables
This Singer tap will automatically import any environment variables within the working directory's
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.
### Source Authentication and Authorization
To use this tap, you will need to create an access token. This can be done by following the steps below:
1. In the upper-right corner, select your avatar.
2. Select "Edit profile".
3. On the left sidebar, select "Access Tokens".
4. Enter a name and expiry date for the token.
5. Select the `read_api` scope.
6. Select "Create personal access token".
Copy the token displayed at the top of the page into tap config. After you leave the page, you no longer have access to the token.
## Usage
You can easily run `tap-gitlab` by itself or in a pipeline using [Meltano](https://meltano.com/).
### Common Errors
#### `A 404 error occurred, but this does not mean that the endpoint is invalid. It likely indicates that GitLab Ultimate is not enabled for the group. This record (context['_sdc_group_id']=12345678) will be skipped and the tap will continue. e=SkipAPIError('404 Client Error: Not Found for path: /api/v4/groups/12345678/member_roles')`
As discussed in [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/20878#note_1385379312), a 404 error from the GitLab API does not necessarily represent that a resource doesn't exist. In the case of the member_roles endpoint (`MemberRoleStream()`), it more likely indicates that the associated group does not have GitLab Ultimate.
Our implementation of the tap, when it encounters a 404 from member_roles, merely logs that fact with a warning, skips the record, and continues executing the tap.
### Executing the Tap Directly
```bash
tap-gitlab --version
tap-gitlab --help
tap-gitlab --config CONFIG --discover > ./catalog.json
```
## Developer Resources
Follow these instructions to contribute to this project.
### Initialize your Development Environment
```bash
pipx install poetry
poetry install
```
### Create and Run Tests
Create tests within the `tests` subfolder and
then run:
```bash
poetry run pytest
```
You can also test the `tap-gitlab` CLI interface directly using `poetry run`:
```bash
poetry run tap-gitlab --help
```
### Testing with [Meltano](https://www.meltano.com)
_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._
Next, install Meltano (if you haven't already) and any needed plugins:
```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-gitlab
meltano install
```
Now you can test and orchestrate using Meltano:
```bash
# Test invocation:
meltano invoke tap-gitlab --version
# OR run a test `elt` pipeline:
meltano elt tap-gitlab target-jsonl
```
### SDK Dev Guide
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-gitlab/meltano.yml | version: 1
send_anonymous_usage_stats: true
project_id: tap-gitlab
default_environment: test
environments:
- name: test
plugins:
extractors:
- name: tap-gitlab
namespace: tap_gitlab
pip_url: -e .
capabilities:
- state
- catalog
- discover
- about
- stream-maps
settings:
- name: auth_token
kind: password
- name: api_url
- name: group_id
- name: api_version
kind: integer
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/streams.py | """Stream type classes for tap-gitlab."""
from __future__ import annotations
from http import HTTPStatus
from pathlib import Path
from typing import Any
from collections.abc import Iterable
import requests
from singer_sdk import typing as th # JSON Schema typing helpers
from tap_gitlab.client import GitLabStream, GitLabPaginator, SkipAPIError
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class GroupIDStream(GitLabStream):
"""
This Stream hits both the /groups/{group_name} endpoint and the
/groups/{group_name}/descendant_groups endpoint. It then extracts the ID from each
and combines it into a single Stream which can then be used as a parent. For each
ID returned from either endpoint, GroupStream() uses the /groups/{group_name}
endpoint to get full data on the group. GroupStream() uses group ID instead of
group name though, ensuring consistency across runs even if group names change.
"""
name = "groupid"
path = "/api/v{api_version}/groups/{group_id}/{endpoint}"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
@property
def partitions(self):
return [{"endpoint": ""}, {"endpoint": "descendant_groups"}]
def get_child_context(self, record: dict, context: th.Optional[dict]) -> dict:
"""Return a context dictionary for child streams."""
return {
"_sdc_group_id": record["id"],
}
def post_process(self, row: dict, context: dict | None = None) -> dict | None:
"""This stream only needs a group's ID, so all extraneous data is removed."""
return {"id": row["id"]}
class GroupSettingsStream(GitLabStream):
name = "groupsettings"
path = "/api/v{api_version}/groups/{_sdc_group_id}"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: th.Any | None,
) -> dict[str, th.Any]:
"""
Using params["with_projects"] = "false" provides the same compatibility for v4
of the API that v5 will.
Projects are instead provided via ProjectStream.
From the docs: https://docs.gitlab.com/ee/api/groups.html
The projects and shared_projects attributes in the response are deprecated
and scheduled for removal in API v5. To get the details of all projects
within a group, use either the list a group's projects or the list a
group's shared projects endpoint.
"""
params = super().get_url_params(context=context, next_page_token=next_page_token)
params["with_projects"] = "false"
return params
class MemberStream(GitLabStream):
name = "member"
path = "/api/v{api_version}/groups/{_sdc_group_id}/members/all"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
class MemberRoleStream(GitLabStream):
name = "memberrole"
path = "/api/v{api_version}/groups/{_sdc_group_id}/member_roles"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
def validate_response(self, response: requests.Response) -> None:
"""
A 404 error for this endpoint doesn't actually indicate the non-existence of
the endpoint. 404 occurs if the group in question doesn't have GitLab
Ultimate. In this situation, the record should be skipped, but other groups
should still be checked for their member roles. A custom exception is used for
this purpose, then handled appropriately in get_records.
"""
if response.status_code == HTTPStatus.NOT_FOUND:
msg = self.response_error_message(response)
raise SkipAPIError(msg)
super().validate_response(response)
def get_records(self, context: dict | None) -> Iterable[dict[str, Any]]:
try:
for record in self.request_records(context):
transformed_record = self.post_process(record, context)
if transformed_record is None:
# Record filtered out during post_process()
continue
yield transformed_record
# If validate_response() throws a SkipAPIError, log the instance but continue
# with the rest of the tap.
except SkipAPIError as e:
self.logger.warning(
"A 404 error occurred, but this does not mean that the endpoint is"
" invalid. It likely indicates that GitLab Ultimate is not enabled for"
f" the group. The record ({_sdc_group_id=}) will be skipped"
f" and the tap will continue. {e=}"
)
class RunnerStream(GitLabStream):
name = "runner"
path = "/api/v{api_version}/groups/{_sdc_group_id}/runners"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
class ProjectStream(GitLabStream):
name = "project"
path = "/api/v{api_version}/groups/{_sdc_group_id}/projects"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
def get_new_paginator(self):
"""
This endpoint is one of a few that support keyset pagination at time of
writing. For groups with *many* projects, this will be more efficient than
offset pagination.
100 is the maximum page size.
"""
return GitLabPaginator(
start_value=[
("page", "1"),
("per_page", "100"),
("pagination", "keyset"),
("order_by", "id"),
("sort", "desc"),
]
)
class HookStream(GitLabStream):
name = "hook"
path = "/api/v{api_version}/groups/{_sdc_group_id}/hooks"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
parent_stream_type = GroupIDStream
class MetadataStream(GitLabStream):
name = "metadata"
path = "/api/v{api_version}/metadata"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/client.py | """REST client handling, including GitLabStream base class."""
from __future__ import annotations
import json
from pathlib import Path
from typing import Any, Optional
from urllib.parse import parse_qsl, urlparse
from requests import Response
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import RESTStream
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class GitLabPaginator(BaseAPIPaginator[Optional[list]]):
def get_next(self, response: Response) -> list | None:
next_url = response.links.get("next", {}).get("url")
return parse_qsl(urlparse(next_url).query) if next_url else None
class SkipAPIError(Exception):
"""
Exception raised when a failed request should not be retried,
but should instead merely skip the associated record.
"""
class GitLabStream(RESTStream):
"""GitLab stream class."""
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
return self.config["api_url"]
@property
def parent_group_id(self) -> int:
"""Return the parent group ID, configurable via tap settings."""
return int(self.config["group_id"])
@property
def api_version(self) -> str:
"""Return the version of the API, configurable via tap settings."""
return self.config["api_version"]
records_jsonpath = "$[*]"
@property
def authenticator(self) -> APIKeyAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return APIKeyAuthenticator.create_for_stream(
self,
key="PRIVATE-TOKEN",
value=self.config["auth_token"],
location="header",
)
# Pagination documentation: https://docs.gitlab.com/ee/api/rest/#pagination
def get_new_paginator(self):
return GitLabPaginator(
start_value=[("page", "1"), ("per_page", "100")]
) # 100 is the maximum page size.
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
headers["Accept"] = "application/json"
return headers
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
# Pagination documentation: https://docs.gitlab.com/ee/api/rest/#pagination
if next_page_token:
params.update(next_page_token)
return params
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/__init__.py | """Tap for GitLab."""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/tap.py | """GitLab tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_gitlab import streams
class TapGitLab(Tap):
"""GitLab tap class."""
name = "tap-gitlab"
config_jsonschema = th.PropertiesList(
th.Property(
"auth_token",
th.StringType,
required=True,
secret=True, # Flag config as protected.
description="The token to authenticate against the API service.",
),
th.Property(
"api_url",
th.StringType,
# Defaults to gitlab.com for GitLab SaaS, but gitlab.org_name.com would
# also be possible for self-hosted instances.
default="https://gitlab.com",
description=(
"The url for the API service. Examples: https://gitlab.com "
"or https://gitlab.org_name.com"
),
),
th.Property(
"group_id",
th.IntegerType,
required=True,
description="The ID of the group to gather data on. Example: 123",
),
th.Property(
"api_version",
th.IntegerType,
# This was built for version 4 of the API but would hopefully be
# compatible with version 5 as well.
default=4,
description="The version of the API to use (4 is strongly recommended).",
),
).to_dict()
def discover_streams(self) -> list[streams.GitLabStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.GroupIDStream(self),
streams.GroupSettingsStream(self),
streams.MemberStream(self),
streams.ProjectStream(self),
streams.MetadataStream(self),
# These streams require admin access. Since we aren't
# using them yet, let's disable them so connection works with a lower privilege level.
# streams.MemberRoleStream(self),
# streams.RunnerStream(self),
# streams.HookStream(self),
]
if __name__ == "__main__":
TapGitLab.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/groupid.json | {
"properties": {
"endpoint": {
"type": [
"null",
"string"
]
},
"group_name": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/hook.json | {
"properties": {
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"alert_status": {
"type": [
"null",
"string"
]
},
"confidential_issues_events": {
"type": [
"null",
"boolean"
]
},
"confidential_note_events": {
"type": [
"null",
"boolean"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"deployment_events": {
"type": [
"null",
"boolean"
]
},
"disabled_until": {
"type": "null"
},
"enable_ssl_verification": {
"type": [
"null",
"boolean"
]
},
"group_id": {
"type": [
"null",
"integer"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"issues_events": {
"type": [
"null",
"boolean"
]
},
"job_events": {
"type": [
"null",
"boolean"
]
},
"merge_requests_events": {
"type": [
"null",
"boolean"
]
},
"note_events": {
"type": [
"null",
"boolean"
]
},
"pipeline_events": {
"type": [
"null",
"boolean"
]
},
"push_events": {
"type": [
"null",
"boolean"
]
},
"push_events_branch_filter": {
"type": [
"null",
"string"
]
},
"releases_events": {
"type": [
"null",
"boolean"
]
},
"repository_update_events": {
"type": [
"null",
"boolean"
]
},
"subgroup_events": {
"type": [
"null",
"boolean"
]
},
"tag_push_events": {
"type": [
"null",
"boolean"
]
},
"url": {
"type": [
"null",
"string"
]
},
"url_variables": {
"items": {
"properties": {
"key": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"wiki_page_events": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/project.json | {
"properties": {
"_links": {
"properties": {
"cluster_agents": {
"type": [
"null",
"string"
]
},
"events": {
"type": [
"null",
"string"
]
},
"issues": {
"type": [
"null",
"string"
]
},
"labels": {
"type": [
"null",
"string"
]
},
"members": {
"type": [
"null",
"string"
]
},
"merge_requests": {
"type": [
"null",
"string"
]
},
"repo_branches": {
"type": [
"null",
"string"
]
},
"self": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"allow_merge_on_skipped_pipeline": {
"type": [
"null",
"boolean"
]
},
"allow_pipeline_trigger_approve_deployment": {
"type": [
"null",
"boolean"
]
},
"analytics_access_level": {
"type": [
"null",
"string"
]
},
"approvals_before_merge": {
"type": [
"null",
"integer"
]
},
"archived": {
"type": [
"null",
"boolean"
]
},
"auto_cancel_pending_pipelines": {
"type": [
"null",
"string"
]
},
"auto_devops_deploy_strategy": {
"type": [
"null",
"string"
]
},
"auto_devops_enabled": {
"type": [
"null",
"boolean"
]
},
"autoclose_referenced_issues": {
"type": [
"null",
"boolean"
]
},
"avatar_url": {
"type": [
"null",
"string"
]
},
"build_git_strategy": {
"type": [
"null",
"string"
]
},
"build_timeout": {
"type": [
"null",
"integer"
]
},
"builds_access_level": {
"type": [
"null",
"string"
]
},
"can_create_merge_request_in": {
"type": [
"null",
"boolean"
]
},
"ci_allow_fork_pipelines_to_run_in_parent_project": {
"type": [
"null",
"boolean"
]
},
"ci_config_path": {
"type": [
"null",
"string"
]
},
"ci_default_git_depth": {
"type": [
"null",
"integer"
]
},
"ci_forward_deployment_enabled": {
"type": [
"null",
"boolean"
]
},
"ci_job_token_scope_enabled": {
"type": [
"null",
"boolean"
]
},
"ci_opt_in_jwt": {
"type": [
"null",
"boolean"
]
},
"ci_separated_caches": {
"type": [
"null",
"boolean"
]
},
"compliance_frameworks": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"container_expiration_policy": {
"properties": {
"cadence": {
"type": [
"null",
"string"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"keep_n": {
"type": [
"null",
"integer"
]
},
"name_regex": {
"type": [
"null",
"string"
]
},
"name_regex_keep": {
"type": [
"null",
"string"
]
},
"next_run_at": {
"type": [
"null",
"string"
]
},
"older_than": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"container_registry_access_level": {
"type": [
"null",
"string"
]
},
"container_registry_enabled": {
"type": [
"null",
"boolean"
]
},
"container_registry_image_prefix": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"creator_id": {
"type": [
"null",
"integer"
]
},
"default_branch": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"description_html": {
"type": [
"null",
"string"
]
},
"emails_disabled": {
"type": [
"null",
"boolean"
]
},
"empty_repo": {
"type": [
"null",
"boolean"
]
},
"enforce_auth_checks_on_uploads": {
"type": [
"null",
"boolean"
]
},
"environments_access_level": {
"type": [
"null",
"string"
]
},
"external_authorization_classification_label": {
"type": [
"null",
"string"
]
},
"feature_flags_access_level": {
"type": [
"null",
"string"
]
},
"forked_from_project": {
"properties": {
"avatar_url": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"default_branch": {
"type": [
"null",
"string"
]
},
"description": {
"type": [
"null",
"string"
]
},
"forks_count": {
"type": [
"null",
"integer"
]
},
"http_url_to_repo": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"last_activity_at": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"name_with_namespace": {
"type": [
"null",
"string"
]
},
"namespace": {
"properties": {
"avatar_url": {
"type": [
"null",
"string"
]
},
"full_path": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"kind": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"parent_id": {
"type": [
"null",
"integer"
]
},
"path": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"path": {
"type": [
"null",
"string"
]
},
"path_with_namespace": {
"type": [
"null",
"string"
]
},
"readme_url": {
"type": [
"null",
"string"
]
},
"ssh_url_to_repo": {
"type": [
"null",
"string"
]
},
"star_count": {
"type": [
"null",
"integer"
]
},
"tag_list": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"topics": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"web_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"forking_access_level": {
"type": [
"null",
"string"
]
},
"forks_count": {
"type": [
"null",
"integer"
]
},
"group_runners_enabled": {
"type": [
"null",
"boolean"
]
},
"http_url_to_repo": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"import_status": {
"type": [
"null",
"string"
]
},
"import_type": {
"type": [
"null",
"string"
]
},
"import_url": {
"type": [
"null",
"string"
]
},
"infrastructure_access_level": {
"type": [
"null",
"string"
]
},
"issue_branch_template": {
"type": [
"null",
"string"
]
},
"issues_access_level": {
"type": [
"null",
"string"
]
},
"issues_enabled": {
"type": [
"null",
"boolean"
]
},
"issues_template": {
"type": [
"null",
"string"
]
},
"jobs_enabled": {
"type": [
"null",
"boolean"
]
},
"keep_latest_artifact": {
"type": [
"null",
"boolean"
]
},
"last_activity_at": {
"type": [
"null",
"string"
]
},
"lfs_enabled": {
"type": [
"null",
"boolean"
]
},
"marked_for_deletion_at": {
"type": [
"null",
"string"
]
},
"marked_for_deletion_on": {
"type": [
"null",
"string"
]
},
"merge_commit_template": {
"type": [
"null",
"string"
]
},
"merge_method": {
"type": [
"null",
"string"
]
},
"merge_pipelines_enabled": {
"type": [
"null",
"boolean"
]
},
"merge_requests_access_level": {
"type": [
"null",
"string"
]
},
"merge_requests_enabled": {
"type": [
"null",
"boolean"
]
},
"merge_requests_template": {
"type": [
"null",
"string"
]
},
"merge_trains_enabled": {
"type": [
"null",
"boolean"
]
},
"mirror": {
"type": [
"null",
"boolean"
]
},
"monitor_access_level": {
"type": [
"null",
"string"
]
},
"mr_default_target_self": {
"type": [
"null",
"boolean"
]
},
"name": {
"type": [
"null",
"string"
]
},
"name_with_namespace": {
"type": [
"null",
"string"
]
},
"namespace": {
"properties": {
"avatar_url": {
"type": [
"null",
"string"
]
},
"full_path": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"kind": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"parent_id": {
"type": [
"null",
"integer"
]
},
"path": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"only_allow_merge_if_all_discussions_are_resolved": {
"type": [
"null",
"boolean"
]
},
"only_allow_merge_if_all_status_checks_passed": {
"type": [
"null",
"boolean"
]
},
"only_allow_merge_if_pipeline_succeeds": {
"type": [
"null",
"boolean"
]
},
"open_issues_count": {
"type": [
"null",
"integer"
]
},
"packages_enabled": {
"type": [
"null",
"boolean"
]
},
"pages_access_level": {
"type": [
"null",
"string"
]
},
"path": {
"type": [
"null",
"string"
]
},
"path_with_namespace": {
"type": [
"null",
"string"
]
},
"printing_merge_request_link_enabled": {
"type": [
"null",
"boolean"
]
},
"public_jobs": {
"type": [
"null",
"boolean"
]
},
"readme_url": {
"type": [
"null",
"string"
]
},
"releases_access_level": {
"type": [
"null",
"string"
]
},
"remove_source_branch_after_merge": {
"type": [
"null",
"boolean"
]
},
"repository_access_level": {
"type": [
"null",
"string"
]
},
"request_access_enabled": {
"type": [
"null",
"boolean"
]
},
"requirements_access_level": {
"type": [
"null",
"string"
]
},
"requirements_enabled": {
"type": [
"null",
"boolean"
]
},
"resolve_outdated_diff_discussions": {
"type": [
"null",
"boolean"
]
},
"restrict_user_defined_variables": {
"type": [
"null",
"boolean"
]
},
"runner_token_expiration_interval": {
"type": [
"null",
"integer"
]
},
"runners_token": {
"type": [
"null",
"string"
]
},
"security_and_compliance_access_level": {
"type": [
"null",
"string"
]
},
"security_and_compliance_enabled": {
"type": [
"null",
"boolean"
]
},
"service_desk_address": {
"type": [
"null",
"string"
]
},
"service_desk_enabled": {
"type": [
"null",
"boolean"
]
},
"shared_runners_enabled": {
"type": [
"null",
"boolean"
]
},
"shared_with_groups": {
"items": {
"properties": {
"expires_at": {
"type": [
"null",
"string"
]
},
"group_access_level": {
"type": [
"null",
"integer"
]
},
"group_full_path": {
"type": [
"null",
"string"
]
},
"group_id": {
"type": [
"null",
"integer"
]
},
"group_name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"snippets_access_level": {
"type": [
"null",
"string"
]
},
"snippets_enabled": {
"type": [
"null",
"boolean"
]
},
"squash_commit_template": {
"type": [
"null",
"string"
]
},
"squash_option": {
"type": [
"null",
"string"
]
},
"ssh_url_to_repo": {
"type": [
"null",
"string"
]
},
"star_count": {
"type": [
"null",
"integer"
]
},
"suggestion_commit_message": {
"type": [
"null",
"string"
]
},
"tag_list": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"topics": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"updated_at": {
"type": [
"null",
"string"
]
},
"visibility": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
},
"wiki_access_level": {
"type": [
"null",
"string"
]
},
"wiki_enabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/member.json | {
"properties": {
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"access_level": {
"type": [
"null",
"integer"
]
},
"avatar_url": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"created_by": {
"properties": {
"avatar_url": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"name": {
"type": [
"null",
"string"
]
},
"state": {
"type": [
"null",
"string"
]
},
"username": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"email": {
"type": [
"null",
"string"
]
},
"expires_at": {
"type": [
"null",
"string"
]
},
"group_saml_identity": {
"properties": {
"extern_uid": {
"type": [
"null",
"string"
]
},
"provider": {
"type": [
"null",
"string"
]
},
"saml_provider_id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"membership_state": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"state": {
"type": [
"null",
"string"
]
},
"username": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/metadata.json | {
"properties": {
"enterprise": {
"type": [
"null",
"boolean"
]
},
"kas": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
},
"externalUrl": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"revision": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/runner.json | {
"properties": {
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"active": {
"type": [
"null",
"boolean"
]
},
"description": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"ip_address": {
"type": [
"null",
"string"
]
},
"is_shared": {
"type": [
"null",
"boolean"
]
},
"name": {
"type": [
"null",
"string"
]
},
"online": {
"type": [
"null",
"boolean"
]
},
"paused": {
"type": [
"null",
"boolean"
]
},
"runner_type": {
"type": [
"null",
"string"
]
},
"status": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/memberrole.json | {
"properties": {
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"base_access_level": {
"type": [
"null",
"integer"
]
},
"group_id": {
"type": [
"null",
"integer"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"read_code": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab | /Users/nchebolu/work/raptor/taps/tap-gitlab/src/tap_gitlab/schemas/groupsettings.json | {
"properties": {
"_sdc_group_id": {
"type": [
"null",
"integer"
]
},
"auto_ban_user_on_excessive_projects_download": {
"type": [
"null",
"boolean"
]
},
"auto_devops_enabled": {
"type": [
"null",
"boolean"
]
},
"avatar_url": {
"type": [
"null",
"string"
]
},
"created_at": {
"type": [
"null",
"string"
]
},
"default_branch_protection": {
"type": [
"null",
"integer"
]
},
"description": {
"type": [
"null",
"string"
]
},
"emails_disabled": {
"type": [
"null",
"boolean"
]
},
"extra_shared_runners_minutes_limit": {
"type": [
"null",
"integer"
]
},
"full_name": {
"type": [
"null",
"string"
]
},
"full_path": {
"type": [
"null",
"string"
]
},
"id": {
"type": [
"null",
"integer"
]
},
"ip_restriction_ranges": {
"type": [
"null",
"string"
]
},
"ldap_access": {
"type": [
"null",
"boolean"
]
},
"ldap_cn": {
"type": [
"null",
"string"
]
},
"lfs_enabled": {
"type": [
"null",
"boolean"
]
},
"marked_for_deletion_on": {
"type": [
"null",
"string"
]
},
"membership_lock": {
"type": [
"null",
"boolean"
]
},
"mentions_disabled": {
"type": [
"null",
"boolean"
]
},
"name": {
"type": [
"null",
"string"
]
},
"parent_id": {
"type": [
"null",
"integer"
]
},
"path": {
"type": [
"null",
"string"
]
},
"prevent_forking_outside_group": {
"type": [
"null",
"boolean"
]
},
"prevent_sharing_groups_outside_hierarchy": {
"type": [
"null",
"boolean"
]
},
"project_creation_level": {
"type": [
"null",
"string"
]
},
"request_access_enabled": {
"type": [
"null",
"boolean"
]
},
"require_two_factor_authentication": {
"type": [
"null",
"boolean"
]
},
"runners_token": {
"type": [
"null",
"string"
]
},
"share_with_group_lock": {
"type": [
"null",
"boolean"
]
},
"shared_runners_minutes_limit": {
"type": [
"null",
"integer"
]
},
"shared_with_groups": {
"items": {
"properties": {
"expires_at": {
"type": [
"null",
"string"
]
},
"group_access_level": {
"type": [
"null",
"integer"
]
},
"group_full_path": {
"type": [
"null",
"string"
]
},
"group_id": {
"type": [
"null",
"integer"
]
},
"group_name": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
},
"subgroup_creation_level": {
"type": [
"null",
"string"
]
},
"two_factor_grace_period": {
"type": [
"null",
"integer"
]
},
"unique_project_download_limit": {
"type": [
"null",
"integer"
]
},
"unique_project_download_limit_alertlist": {
"items": {
"type": [
"null",
"integer"
]
},
"type": [
"null",
"array"
]
},
"unique_project_download_limit_allowlist": {
"items": {
"type": [
"null",
"integer",
"string"
]
},
"type": [
"null",
"array"
]
},
"unique_project_download_limit_interval_in_seconds": {
"type": [
"null",
"integer"
]
},
"visibility": {
"type": [
"null",
"string"
]
},
"web_url": {
"type": [
"null",
"string"
]
},
"wiki_access_level": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-1password/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-1password"
description = "`tap-1password` is a Singer tap for 1password, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "1password"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0",
"genson==1.2.2"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-1password = "tap_1password.tap:Tap1password.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-1password/README.md | ### tap-1password
1. `TAP_1PASSWORD_API_URL` should be filled in based on the following:
| is account on | fill `TAP_1PASSWORD_API_URL` with |
|---------------|------------------------------------------------------------------------------------------------------------------|
| 1Password.com | https://events.1password.com (1Password Business) `OR` https://events.ent.1password.com (1Password Enterprise) |
| 1Password.ca | https://events.1password.ca |
| 1Password.eu | https://events.1password.eu |
2. `TAP_1PASSWORD_API_KEY` is the bearer token.
3. `TAP_1PASSWORD_SERVICE_ACCOUNT_TOKEN` is the service account token .
For local testing create a `.env` file with the above values.
```
TAP_1PASSWORD_API_URL={from vault}
TAP_1PASSWORD_API_KEY={from vault}
TAP_1PASSWORD_SERVICE_ACCOUNT_TOKEN={from vault}
```
### Initialize your Development Environment
```bash
pipx install poetry
poetry install
```
Make sure to install the [1password-cli](https://cache.agilebits.com/dist/1P/op2/pkg/v2.16.0-beta.01/op_apple_universal_v2.16.0-beta.01.pkg) on mac for local testing.
We require this beta version to obtain data from service accounts.
### Testing with [Meltano](https://www.meltano.com)
_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._
Next, install Meltano (if you haven't already) and any needed plugins:
```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-1password
# to install all taps or targets
meltano install
# to only install tap
meltano install extractor tap-1password
```
Now you can test and orchestrate using Meltano:
```bash
# Test invocation:
meltano invoke tap-1password --discover
# OR run a test `elt` pipeline:
meltano elt tap-1password target-jsonl
```
### SDK Dev Guide
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-1password/meltano.yml | version: 1
send_anonymous_usage_stats: false
project_id: "tap-1password"
plugins:
extractors:
- name: "tap-1password"
namespace: "tap_1password"
pip_url: -e .
capabilities:
- state
- catalog
- discover
settings:
# TODO: To configure using Meltano, declare settings and their types here:
- name: api_url
- name: api_key
kind: password
- name: service_account_token
kind: password
select:
# TODO: change these
- signinattempts.*
- auditevents.*
- users.*
- groups.*
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
- name: target-csv
variant: hotgluexyz
pip_url: git+https://github.com/hotgluexyz/target-csv.git@0.3.3
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/streams.py | """Stream type classes for tap-1password."""
from __future__ import annotations
from pathlib import Path
from tap_1password.client import OnePasswordStream, OnePasswordCLIStream
class SignInAttemptsStream(OnePasswordStream):
name = "signinattempts"
path = "/signinattempts"
primary_keys = ["id"]
class AuditeventsStream(OnePasswordStream):
name = "auditevents"
path = "/auditevents"
primary_keys = ["id"]
class UsersStream(OnePasswordCLIStream):
name = "users"
primary_keys = ["id"]
mgmt_command = "users"
class GroupsStream(OnePasswordCLIStream):
name = "groups"
primary_keys = ["id"]
mgmt_command = "group"
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/client.py | """REST client handling, including 1PasswordStream base class. """
from __future__ import annotations
import json
import os
import subprocess
from pathlib import Path
from typing import Any
from collections.abc import Callable, Iterable
import requests
from singer_sdk.authenticators import BearerTokenAuthenticator
from singer_sdk.helpers._typing import TypeConformanceLevel
from singer_sdk.pagination import BaseAPIPaginator
from singer_sdk.streams import RESTStream, Stream
from singer_sdk.streams.rest import _TToken
from tap_1password.paginator import OnePasswordPaginator
_Auth = Callable[[requests.PreparedRequest], requests.PreparedRequest]
SCHEMA_FILE = Path(__file__).parent / "schemas" / "generic.json"
DEFAULT_LOOKBACK_DAYS = 90
class OnePasswordStream(RESTStream):
"""1Password stream class."""
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.NONE
schema_filepath = SCHEMA_FILE
rest_method = "POST"
records_jsonpath = "$.[*]"
next_page_token_jsonpath = "$.cursor" # Or override `get_next_page_token`
# cursor is opaque, so since we want to allow incremental sync, we don't want to check sorted results
replication_key = "cursor"
check_sorted = False
is_sorted = True
@property
def is_timestamp_replication_key(self) -> bool:
return False
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
api_url = self.config["api_url"].rstrip("/")
return f"{api_url}/api/v1"
@property
def authenticator(self) -> BearerTokenAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return BearerTokenAuthenticator.create_for_stream(
self,
token=self.config["api_key"],
)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
if "user_agent" in self.config:
headers["User-Agent"] = self.config.get("user_agent")
# If not using an authenticator, you may also provide inline auth headers:
# headers["Private-Token"] = self.config.get("auth_token")
headers["Content-Type"] = "application/json"
return headers
def get_new_paginator(self) -> BaseAPIPaginator:
if self.next_page_token_jsonpath:
return OnePasswordPaginator(self.next_page_token_jsonpath)
return super().get_new_paginator()
def prepare_request(self, context: dict | None, next_page_token: _TToken | None) -> requests.PreparedRequest:
"""
The cursor is a top-level opaque token. When we parse the response, since we yield each item in the items
array, we'll need to keep track of the token that was used to make this request and include it on each record.
"""
self.prev_cursor = next_page_token or self.get_starting_replication_key_value(context)
return super().prepare_request(context, next_page_token)
def prepare_request_payload(
self,
context: dict | None,
next_page_token: Any | None,
) -> dict | None:
"""Prepare the data payload for the REST API request.
By default, no payload will be sent (return None).
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary with the JSON body for a POST requests.
"""
# Pagination
if next_page_token:
return {"cursor": next_page_token}
# Pull the starting context from passed in state
starting_cursor = self.get_starting_replication_key_value(context)
if starting_cursor:
return {"cursor": starting_cursor}
# Default lookback period when no previous state passed
return {"limit": 1000, "start_time": self.config["start_time"]}
def parse_response(self, response: requests.Response) -> Iterable[dict]:
"""
We want to yield each item separately, but include the cursor with the record for
incremental loads.
"""
for record in super().parse_response(response):
tot_items = len(record["items"])
for i, item in enumerate(record["items"], 1):
cursor = self.prev_cursor if i < tot_items else record["cursor"]
yield {**item, "cursor": cursor}
class OnePasswordCLIStream(Stream):
"""1Password stream class for data that only is accessible through the CLI"""
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.NONE
schema_filepath = SCHEMA_FILE
mgmt_command: str
command: str = "list"
def get_records(self, context: dict | None) -> Iterable[dict | tuple[dict, dict]]:
assert self.mgmt_command and self.command, "You must specify CLI commands in order to retreive records"
return self.cli(self.mgmt_command, self.command)
def cli(self, mgmt_command: str, command: str, *args) -> Iterable[dict]:
cmd = ["op", "--format=json", mgmt_command, command, *args]
env = {**os.environ, "OP_SERVICE_ACCOUNT_TOKEN": self.config["service_account_token"]}
completed_process = subprocess.run(cmd, capture_output=True, text=True, env=env)
if completed_process.returncode != 0:
raise Exception(
f"""1Password op subprocess failed as exit code
did not equal 0. Return Code: {completed_process.returncode}\n Error: {completed_process.stderr}."""
)
return json.loads(completed_process.stdout)
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/__init__.py | """Tap for 1Password."""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/paginator.py | from __future__ import annotations
from requests import Response
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import JSONPathPaginator
class OnePasswordPaginator(JSONPathPaginator):
"""
Onepassword paginator
"""
has_more_jsonpath = "$.has_more"
def get_next(self, response: Response) -> str | None:
has_more = next(extract_jsonpath(self.has_more_jsonpath, response.json()), False)
if not has_more:
return None
next_page_token = super().get_next(response)
if next_page_token == self.current_value:
return None
return next_page_token
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/tap.py | """1Password tap class."""
from __future__ import annotations
from datetime import datetime, timedelta, timezone
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from singer_sdk.streams.core import Stream
from tap_1password import streams
class Tap1password(Tap):
"""1Password tap class."""
name = "tap-1password"
# Update the following section with the expected config values
config_jsonschema = th.PropertiesList(
th.Property(
"api_url",
th.StringType,
required=True,
description="""API URL is either https://events.1password.com,
https://events.ent.1password.com, https://events.1password.ca or
https://events.1password.eu""",
),
th.Property(
"api_key",
th.StringType,
required=True,
description="""bearer token""",
),
th.Property("service_account_token", th.StringType, required=True, description="Service account token"),
th.Property(
"start_time",
th.StringType,
required=True,
default=(datetime.utcnow() - timedelta(days=90)).replace(tzinfo=timezone.utc).isoformat(timespec="seconds"),
description="Start time for a new query in ISO format",
),
).to_dict()
def discover_streams(self) -> list[Stream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.SignInAttemptsStream(self),
streams.AuditeventsStream(self),
streams.UsersStream(self),
streams.GroupsStream(self),
]
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password | /Users/nchebolu/work/raptor/taps/tap-1password/src/tap_1password/schemas/generic.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": true,
"properties": {},
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/example_files/users.json | [
{
"email": "jmcreynolds@obsidiansecurity.com",
"id": "52I2R2FY4BAIRP7ARX2BAPUQ3Q",
"name": "Joren McReynolds",
"state": "ACTIVE",
"type": "MEMBER"
},
{
"email": "mmccurdy@obsidiansecurity.com",
"id": "4436KSC4TNFQXBDI5ICU43IIEM",
"name": "Marcus McCurdy",
"state": "ACTIVE",
"type": "MEMBER"
},
{
"email": "cslusher@obsidiansecurity.com",
"id": "ANZLKVE2LJBU3PN6L2QV2DH6V4",
"name": "Craig Slusher",
"state": "ACTIVE",
"type": "MEMBER"
},
{
"email": "jherath@obsidiansecurity.com",
"id": "S5GCOXTBPRGCTNZPQT4NIJHGTU",
"name": "Jerome Herath",
"state": "ACTIVE",
"type": "MEMBER"
},
{
"email": "ahalim@obsidiansecurity.com",
"id": "NKYOC7V2ZJGJ3EDY4LJBSGIELU",
"name": "Anthony Halim",
"state": "ACTIVE",
"type": "MEMBER"
}
]
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/example_files/auditevents.json | [
{
"action": "create",
"actor_uuid": "52I2R2FY4BAIRP7ARX2BAPUQ3Q",
"aux_id": 10450117,
"aux_uuid": "52I2R2FY4BAIRP7ARX2BAPUQ3Q",
"cursor": "Zv-BAwEBE0VsYXN0aWNzZWFyY2hDdXJzb3IB_4IAAQUBBUxpbWl0AQQAAQlTdGFydFRpbWUB_4QAAQdFbmRUaW1lAf-EAAELU2VhcmNoQWZ0ZXIBBAABClRpZUJyZWFrZXIBDAAAAAr_gwUBAv-GAAAAOv-CAQYBDwEAAAAO26QUYgAAAAD_TAL6Aw5fpYBmARozQ1c1WDdQMjU2WURCM0VJUjZKSVZUR0U0TQA",
"location": {
"city": "Denver",
"country": "United States",
"latitude": 39.6796,
"longitude": -104.9626,
"region": "Colorado"
},
"object_type": "device",
"object_uuid": "4spczs3sj3sawuwa44l5ktsosm",
"session": {
"device_uuid": "4spczs3sj3sawuwa44l5ktsosm",
"ip": "174.29.83.7",
"login_time": "2023-03-30T00:02:32.590639334Z",
"uuid": "53TU6YC3VREM3I7IQ2W4LCDLYU"
},
"timestamp": "2023-03-30T00:02:32.606247117Z",
"uuid": "G2F2XGVFLUENL7GBKEIVK6IEV6"
},
{
"action": "create",
"actor_uuid": "4436KSC4TNFQXBDI5ICU43IIEM",
"cursor": null,
"location": {
"city": "Collingswood",
"country": "United States",
"latitude": 39.9152,
"longitude": -75.0739,
"region": "New Jersey"
},
"object_type": "device",
"object_uuid": "up2mp5g6qnsnhmnbzszb34z22a",
"session": {
"device_uuid": "6kaipnfuih34yvqmn6y63smlpu",
"ip": "173.72.72.250",
"login_time": "2023-04-03T18:23:11.278758317Z",
"uuid": "DHVU7EGXH5CSJN6RZ6HEKXWGHA"
},
"timestamp": "2023-04-03T18:23:47.599725915Z",
"uuid": "ADTCPJGO2CEVH6GE3KT2HFJFJD"
}
]
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/example_files/signinattempts.json | [
{
"category": "firewall_failed",
"client": {
"app_name": "1Password Browser",
"app_version": "20240",
"ip_address": "192.0.2.254",
"os_name": "MacOSX",
"os_version": "13.2",
"platform_name": "Chrome",
"platform_version": "string"
},
"country": "France",
"cursor": "aGVsbG8hIGlzIGl0IG1lIHlvdSBhcmUgbG9va2luZyBmb3IK",
"details": {
"value": "Europe"
},
"location": {
"city": "Toronto",
"country": "Canada",
"latitude": 43.5991,
"longitude": -79.4988,
"region": "Ontario"
},
"session_uuid": "A5K6COGVRVEJXJW3XQZGS7VAMM",
"target_user": {
"email": "wendy_appleseed@agilebits.com",
"name": "Wendy Appleseed",
"uuid": "IR7VJHJ36JHINBFAD7V2T5MP3E"
},
"timestamp": "2023-03-15T16:32:50-03:00",
"type": "continent_blocked",
"uuid": "56YE2TYN2VFYRLNSHKPW5NVT5E"
},
{
"category": "success",
"client": {
"app_name": "1Password CLI",
"app_version": "2160001",
"ip_address": "2603:6010:9d01:fa28:55b5:e679:eba3:27e9",
"os_name": "MacOSX",
"os_version": "13.3",
"platform_name": "CS-EN-M004NLJ6YP",
"platform_version": "arm64"
},
"country": "US",
"cursor": null,
"details": null,
"location": {
"city": "Hudson",
"country": "US",
"latitude": 41.2479,
"longitude": -81.4349,
"region": "Ohio"
},
"session_uuid": "RIIVSMUJUFAXRL6QLLB7W33UR4",
"target_user": {
"email": "pxfgkcmx3bxhq@1passwordserviceaccounts.com",
"name": "Slush SA",
"uuid": "PSOLT6M27VEQPM4WDQB2IAQKYM"
},
"timestamp": "2023-04-04T12:36:00.549305849Z",
"type": "credentials_ok",
"uuid": "WFM3PYUKCFFMDBCF3RFV36BV7E"
}
]
| 0 |
/Users/nchebolu/work/raptor/taps/tap-1password/src | /Users/nchebolu/work/raptor/taps/tap-1password/src/example_files/groups.json | [
{
"created_at": "2023-03-30T00:02:34Z",
"description": "Can reset user passwords if account recovery is enabled.",
"id": "konfjlk5bgmvurkkamtk3lgdjy",
"name": "Recovery",
"state": "ACTIVE"
},
{
"created_at": "2023-03-30T00:02:34Z",
"description": "Access to billing and account administration.",
"id": "d57g6e35bvl7uceiggm26z4vme",
"name": "Owners",
"state": "ACTIVE"
},
{
"created_at": "2023-03-30T00:02:34Z",
"description": "Administration of users, groups, and vaults.",
"id": "7l4gfx74qx7ji4ue5eh2w55qy4",
"name": "Administrators",
"state": "ACTIVE"
},
{
"created_at": "2023-03-30T00:02:34Z",
"description": "All team members.",
"id": "crqr3d6g7oprcloil7jzr3yo3u",
"name": "Team Members",
"state": "ACTIVE"
}
]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-salesforce/Makefile | # Pinned python dependencies
PIP_VERSION ?= 23.1.2
SETUPTOOLS_VERSION ?= 65.5.1
WHEEL_VERSION ?= 0.38.4
# Activate venv
VIRTUAL_ENV ?= $(PWD)/.venv
PATH := ${VIRTUAL_ENV}/bin:${PATH}
.PHONY: init pre-commit precommit pytest dagit test-container run-test-container create-docker-builder localstack localstack-down
.venv:
python3 -m venv .venv
install: .venv
pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION} wheel==${WHEEL_VERSION}
CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install -e .[dev,test]
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-salesforce/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-salesforce"
description = "`tap-salesforce` is a Singer tap for salesforce, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "salesforce"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0",
"simple-salesforce==1.12.2",
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"responses==0.22.0",
"freezegun==1.2.2"
]
[project.scripts]
tap-salesforce = "tap_salesforce.tap:Tapsalesforce.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-salesforce/README.md | # tap-salesforce
`tap-salesforce` is a Singer tap for salesforce.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
## Setup
Run
```shell
meltano install
```
## Configuration
TODO
## Discovery
Streams and fields can be discovered through running the `select` command
```shell
meltano select tap-salesforce --list --all
```
If you wish to select individual fields this can also be done at this point or directly in metlano.yml
## Run pipeline
The pipeline can be run with
```shell
meltano elt tap-salesforce target-jsonl --job_id=some_job_id
```
The output files can be found in the output directory
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-salesforce/meltano.yml | version: 1
send_anonymous_usage_stats: false
project_id: tap-salesforce
default-environment: dev
environments:
- name: dev
plugins:
extractors:
- name: tap-salesforce
namespace: tap_salesforce
pip_url: -e .
capabilities:
- state
- catalog
- discover
# Add config settings here
settings:
- name: token_url
- name: current_step
kind: boolean
- name: client_id
- name: client_secret
kind: password
- name: refresh_token
kind: password
# config:
# token_url:
# client_id:
# client_secret:
# refresh_token:
select:
- '*.*'
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-salesforce/src | /Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce/streams.py | """Stream type classes for tap-salesforce."""
from __future__ import annotations
from http import HTTPStatus
from singer_sdk import typing as th # JSON Schema typing helpers
from singer_sdk.helpers.jsonpath import extract_jsonpath
from typing import Any, Optional
from collections.abc import Callable, Iterable
from tap_salesforce.client import salesforceStream
from pathlib import Path
import requests
class InstalledSubscriberPackageStream(salesforceStream):
name = "installed_subscriber_package"
tooling_api = True
soql = """
SELECT Id, SubscriberPackageId, SubscriberPackage.NamespacePrefix, SubscriberPackage.Name,
SubscriberPackageVersion.Id, SubscriberPackageVersion.Name, SubscriberPackageVersion.MajorVersion,
SubscriberPackageVersion.MinorVersion, SubscriberPackageVersion.PatchVersion,
SubscriberPackageVersion.BuildNumber, SubscriberPackageVersion.PublisherName, SubscriberPackageVersion.IsManaged,
SubscriberPackageVersion.IsSecurityReviewed
FROM InstalledSubscriberPackage
"""
primary_keys = ["id"]
replication_key = None
class ApiEventStream(salesforceStream):
name = "api_event"
soql = """
SELECT AdditionalInfo,ApiType,ApiVersion,Application,Client,ConnectedAppId,EventDate,
EventIdentifier,LoginHistoryId,LoginKey,Operation,Platform,PolicyId,PolicyOutcome,
QueriedEntities,Query,RelatedEventIdentifier,RowsReturned,SessionKey,SessionLevel,
SourceIp,UserAgent,UserId,Username
FROM ApiEvent
"""
activity = True
# primary_keys = ["id"]
replication_key = None
| 0 |
/Users/nchebolu/work/raptor/taps/tap-salesforce/src | /Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce/client.py | from __future__ import annotations
import logging
import datetime
import time
from typing import Optional
from collections.abc import Iterable
from urllib.parse import urlencode
from pathlib import Path
import requests
from simple_salesforce import Salesforce
from simple_salesforce.exceptions import SalesforceMalformedRequest
from singer_sdk.streams import Stream
from singer_sdk.helpers._typing import TypeConformanceLevel
logger = logging.getLogger("meltano")
SCHEMA_FILE = Path(__file__).parent / "schemas" / "generic.json"
STEP_TIME = 86400 # 1 day, in seconds
def format_sf_time(dt: datetime.datetime):
return dt.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
class salesforceStream(Stream):
"""Stream class for salesforce streams."""
salesforce_client: Salesforce | None = None
soql: str
tooling_api: bool = False
activity: bool = False
date_field: str = "EventDate" # for filtering activity
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.NONE
schema_filepath = SCHEMA_FILE
def get_records(
self,
context: dict | None,
) -> Iterable[dict]:
sfclient = self.create_client()
query = self.soql
if self.activity:
now = int(time.time())
start_time = now - (now % STEP_TIME)
if not self.config.get("current_step"):
start_time = start_time - STEP_TIME
end_time = start_time + STEP_TIME
start_ts = datetime.datetime.utcfromtimestamp(start_time)
end_ts = datetime.datetime.utcfromtimestamp(end_time)
query += f" WHERE {self.date_field} >= {format_sf_time(start_ts)} AND EventDate < {format_sf_time(end_ts)}"
try:
if self.tooling_api:
result = sfclient.toolingexecute("query?" + urlencode({"q": query}))
else:
result = sfclient.query_all(query)
except SalesforceMalformedRequest as e:
logger.info(f"Installed Subscriber Packages retrival failed with error: {e}")
return {}
return result["records"]
def create_client(self) -> Salesforce:
if self.salesforce_client:
return self.salesforce_client
get_access_token = requests.post(self.config.get("token_url"), params={
"client_id": self.config.get("client_id"),
"client_secret": self.config.get("client_secret"),
"refresh_token": self.config.get("refresh_token"),
"grant_type": "refresh_token",
})
if get_access_token.status_code != 200:
raise Exception(
"Unable to generate salesforce access token: " + str(get_access_token) + get_access_token.text)
token = get_access_token.json()
if "access_token" not in token or "instance_url" not in token:
raise Exception("Failed to generate salesforce access token " + str(get_access_token))
sf = Salesforce(session_id=token["access_token"], instance_url=token["instance_url"])
self.salesforce_client = sf
return sf
| 0 |
/Users/nchebolu/work/raptor/taps/tap-salesforce/src | /Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce/.py | """salesforce Authentication."""
from __future__ import annotations
# TODO: Delete this file or add custom authentication logic as needed.
| 0 |
/Users/nchebolu/work/raptor/taps/tap-salesforce/src | /Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce/tap.py | """salesforce tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
# TODO: Import your custom stream types here:
from tap_salesforce import streams
class Tapsalesforce(Tap):
"""salesforce tap class."""
name = "tap-salesforce"
config_jsonschema = th.PropertiesList(
th.Property(
"token_url",
th.StringType,
required=True,
secret=False,
description="Token generation URL",
default="https://login.salesforce.com/services/oauth2/token"
),
th.Property(
"current_step",
th.BooleanType,
required=True,
secret=False,
description="Are we running for the current step? True = current window, False = previous window",
default=False
),
th.Property(
"client_id",
th.StringType,
required=True,
secret=False,
description="Client ID/App id",
),
th.Property(
"client_secret",
th.StringType,
required=True,
secret=True,
description="Client ID/App id",
),
th.Property(
"refresh_token",
th.StringType,
required=True,
secret=True,
description="Client ID/App id",
),
).to_dict()
def discover_streams(self) -> list[streams.salesforceStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.InstalledSubscriberPackageStream(self),
streams.ApiEventStream(self),
]
if __name__ == "__main__":
Tapsalesforce.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce | /Users/nchebolu/work/raptor/taps/tap-salesforce/src/tap_salesforce/schemas/generic.json | {
"$id": "http://example.com/example.json",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"additionalProperties": true,
"properties": {},
"type": "object"
}
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-zendesk/pyproject.toml | [build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "tap-zendesk"
description = "`tap-zendesk` is a Singer tap for zendesk, built with the Meltano SDK for Singer Taps."
readme = "README.md"
requires-python = ">=3.11"
keywords = ["meltano", "zendesk"]
classifiers = [
"Framework :: Meltano",
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dependencies = [
"singer-sdk==0.25.0",
"requests==2.29.0"
]
[project.optional-dependencies]
dev = [
"pre-commit==2.20.0",
"black[d]==22.12.0",
"aiohttp",
"keyring",
"meltano==2.18.0"
]
test = [
"pytest==7.2.0",
"singer-sdk==0.25.0",
]
[project.scripts]
tap-zendesk = "tap_zendesk.tap:TapZendesk.cli"
[tool.isort]
profile = "black"
[tool.black]
line-length = 120
target-version = ['py311']
[tool.pyright]
exclude = [".venv", "tests", "migrations"]
pythonVersion = "3.11"
include = ["src"]
venvPath = "."
venv = ".venv"
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-zendesk/README.md | # tap-zendesk
`tap-zendesk` is a Singer tap for Zendesk.
Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
_**Note:** Due to the unavailability of custom roles without an Enterprise plan, this tap does not pull data on any custom roles that might be configured._
## Installation
An example GitLab installation command:
```bash
pipx install git+https://gitlab.com/ORG_NAME/tap-zendesk.git
```
## Configuration
### Accepted Config Options
## Settings
| Setting | Required | Default | Description |
|:----------|:--------:|:-------:|:----------------------------------------------------------------------------------------------|
| api_token | True | None | The token to authenticate against the API service. |
| email | True | None | The email address of the connecting user. |
| api_url | True | None | The url for the API service, including your subdomain. Example: https://org_name.zendesk.com. |
A full list of supported settings and capabilities for this
tap is available by running:
```bash
tap-zendesk --about
```
### Configure using environment variables
This Singer tap will automatically import any environment variables within the working directory's
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.
### Source Authentication and Authorization
Complete the following steps to obtain an access token:
1. Log in to Zendesk as an administrator.
2. Click on the "Zendesk Products" button in the upper right. It looks like four rounded squares.
3. Select "Admin Center"
4. Select "Apps and integrations"
5. Select "APIs -> Zendesk API"
6. Select "OAuth Clients"
7. Select "Add OAuth client"
8. Fill in a Client name of your choice and a Redirect URL of `http://localhost`
9. Select "Save"
10. Note the client's Unique identifier and Secret.
11. Make a GET request to: `{your_api_url}/oauth/authorizations/new?client_id={your_unique_identifier}&redirect_uri=http://localhost&scope=read&response_type=code`
12. Note the authorization code that is returned in the address bar of your browser.
13. Make a POST request to: `{your_api_url}/oauth/tokens` with the body:
```
{
"grant_type": "authorization_code",
"code": "{your_authorization_code}",
"client_id": "{your_unique_identifier}",
"client_secret": "{your_client_secret}",
"redirect_uri": "http://localhost",
"scope": "read"
}
```
14. Copy the returned access token into tap config. This access token won't expire.
## Usage
You can easily run `tap-zendesk` by itself or in a pipeline using [Meltano](https://meltano.com/).
### Common Errors
#### `Properties ('user_fields',) were present in the 'user' stream but not found in catalog schema. Ignoring.`
This warning indicates that the 'user_fields' property in the 'user' stream was skipped. 'user_fields' represents custom data that some Zendesk customers choose to add to their users. However, the custom data does not have a consistent schema, and as such, we've decided to omit it from this tap.
### Executing the Tap Directly
```bash
tap-zendesk --version
tap-zendesk --help
tap-zendesk --config CONFIG --discover > ./catalog.json
```
## Developer Resources
Follow these instructions to contribute to this project.
### Initialize your Development Environment
```bash
pipx install poetry
poetry install
```
### Create and Run Tests
Create tests within the `tests` subfolder and
then run:
```bash
poetry run pytest
```
You can also test the `tap-zendesk` CLI interface directly using `poetry run`:
```bash
poetry run tap-zendesk --help
```
### Testing with [Meltano](https://www.meltano.com)
_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._
Next, install Meltano (if you haven't already) and any needed plugins:
```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-zendesk
meltano install
```
Now you can test and orchestrate using Meltano:
```bash
# Test invocation:
meltano invoke tap-zendesk --version
# OR run a test `elt` pipeline:
meltano elt tap-zendesk target-jsonl
```
### SDK Dev Guide
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
| 0 |
/Users/nchebolu/work/raptor/taps | /Users/nchebolu/work/raptor/taps/tap-zendesk/meltano.yml | version: 1
send_anonymous_usage_stats: true
project_id: tap-zendesk
default_environment: test
environments:
- name: test
plugins:
extractors:
- name: tap-zendesk
namespace: tap_zendesk
pip_url: -e .
capabilities:
- state
- catalog
- discover
- about
- stream-maps
settings:
- name: auth_token
kind: password
- name: api_url
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zendesk/src | /Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk/streams.py | """Stream type classes for tap-zendesk."""
from __future__ import annotations
from pathlib import Path
from singer_sdk import typing as th # JSON Schema typing helpers
from tap_zendesk.client import ZendeskPaginator, ZendeskStream
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
class SettingStream(ZendeskStream):
# No primary key is available. Pagination is not used.
name = "setting"
path = "/api/v2/account/settings"
schema_filepath = SCHEMAS_DIR / f"{name}.json"
class UserStream(ZendeskStream):
name = "user"
path = "/api/v2/users"
primary_keys = ["id"]
schema_filepath = SCHEMAS_DIR / f"{name}.json"
records_jsonpath = "$.users[*]"
# Pagination documentation: https://developer.zendesk.com/api-reference/introduction/pagination/
def get_new_paginator(self):
return ZendeskPaginator(start_value=[("page[size]", "100")]) # 100 is the maximum page size.
# There are three types of users: end-users, agents, and administrators.
# We only care about internal usesrs of Zendesk, which are agents and administrators.
# Fetching agents vs. fetching administrators requires different URL parameters, hence the partition.
partitions = [{"role": "admin"}, {"role": "agent"}]
def get_url_params(
self,
context: dict | None,
next_page_token: th.Any | None,
) -> dict[str, th.Any]:
params: dict = super().get_url_params(context, next_page_token)
params["role"] = context["role"]
return params
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zendesk/src | /Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk/client.py | """REST client handling, including ZendeskStream base class."""
from __future__ import annotations
from pathlib import Path
from typing import Any, Optional
from functools import cached_property
from base64 import b64encode
import requests
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.streams import RESTStream
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.pagination import BaseAPIPaginator
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")
# Pagination documentation: https://developer.zendesk.com/api-reference/introduction/pagination/
class ZendeskPaginator(BaseAPIPaginator[Optional[str]]):
def get_next(self, response: requests.Response) -> str | None:
all_matches = extract_jsonpath("$.meta.after_cursor", response.json())
result = [("page[size]", "100")] # 100 is the maximum page size.
result.append(("page[after]", next(all_matches, None)))
return result
def has_more(self, response: requests.Response) -> bool:
all_matches = extract_jsonpath("$.meta.has_more", response.json())
return next(all_matches, False)
class ZendeskStream(RESTStream):
"""Zendesk stream class."""
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
return self.config["api_url"]
records_jsonpath = "$[*]"
@cached_property
def basic_auth_token(self) -> str:
"""Encodes user email and api token to base64 for basic auth. Returns base64 token as a string."""
encoding_std = "ascii"
credentials = f"{self.config['email']}/token:{self.config['api_token']}"
credentials_encoded = b64encode(credentials.encode(encoding_std))
return credentials_encoded.decode(encoding_std)
@cached_property
def authenticator(self) -> APIKeyAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return APIKeyAuthenticator.create_for_stream(
self,
key="Authorization",
value="Basic " + self.basic_auth_token,
location="header",
)
@property
def http_headers(self) -> dict:
"""Return the http headers needed.
Returns:
A dictionary of HTTP headers.
"""
headers = {}
headers["Accept"] = "application/json"
return headers
def get_url_params(
self,
context: dict | None, # noqa: ARG002
next_page_token: Any | None,
) -> dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization.
Args:
context: The stream context.
next_page_token: The next page index or value.
Returns:
A dictionary of URL query parameters.
"""
params: dict = {}
if next_page_token:
params.update(next_page_token)
return params
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zendesk/src | /Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk/__init__.py | """Tap for Zendesk."""
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zendesk/src | /Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk/tap.py | """Zendesk tap class."""
from __future__ import annotations
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers
from tap_zendesk import streams
class TapZendesk(Tap):
"""Zendesk tap class."""
name = "tap-zendesk"
config_jsonschema = th.PropertiesList(
th.Property(
"api_token",
th.StringType,
required=True,
secret=True, # Flag config as protected.
description="The token to authenticate against the API service.",
),
th.Property(
"api_url",
th.StringType,
required=True,
description=(
"The url for the API service, including your subdomain. Example:"
" https://org_name.zendesk.com."
),
),
th.Property(
"email",
th.StringType,
required=True,
description="The email address of the Zendesk user to authenticate as.",
),
).to_dict()
def discover_streams(self) -> list[streams.ZendeskStream]:
"""Return a list of discovered streams.
Returns:
A list of discovered streams.
"""
return [
streams.SettingStream(self),
streams.UserStream(self),
]
if __name__ == "__main__":
TapZendesk.cli()
| 0 |
/Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk | /Users/nchebolu/work/raptor/taps/tap-zendesk/src/tap_zendesk/schemas/setting.json | {
"properties": {
"settings": {
"properties": {
"active_features": {
"properties": {
"access_logs_enabled": {
"type": [
"null",
"boolean"
]
},
"advanced_analytics": {
"type": [
"null",
"boolean"
]
},
"agent_forwarding": {
"type": [
"null",
"boolean"
]
},
"allow_ccs": {
"type": [
"null",
"boolean"
]
},
"audit_logs_gdpr": {
"type": [
"null",
"boolean"
]
},
"automatic_answers": {
"type": [
"null",
"boolean"
]
},
"bcc_archiving": {
"type": [
"null",
"boolean"
]
},
"benchmark_opt_out": {
"type": [
"null",
"boolean"
]
},
"business_hours": {
"type": [
"null",
"boolean"
]
},
"chat": {
"type": [
"null",
"boolean"
]
},
"chat_about_my_ticket": {
"type": [
"null",
"boolean"
]
},
"csat_reason_code": {
"type": [
"null",
"boolean"
]
},
"custom_object_nav_enabled": {
"type": [
"null",
"boolean"
]
},
"customer_satisfaction": {
"type": [
"null",
"boolean"
]
},
"dynamic_contents": {
"type": [
"null",
"boolean"
]
},
"explore": {
"type": [
"null",
"boolean"
]
},
"explore_forbidden": {
"type": [
"null",
"boolean"
]
},
"explore_not_set": {
"type": [
"null",
"boolean"
]
},
"explore_on_support_ent_plan": {
"type": [
"null",
"boolean"
]
},
"explore_on_support_pro_plan": {
"type": [
"null",
"boolean"
]
},
"facebook": {
"type": [
"null",
"boolean"
]
},
"facebook_login": {
"type": [
"null",
"boolean"
]
},
"forum_analytics": {
"type": [
"null",
"boolean"
]
},
"good_data_and_explore": {
"type": [
"null",
"boolean"
]
},
"good_data_only": {
"type": [
"null",
"boolean"
]
},
"google_login": {
"type": [
"null",
"boolean"
]
},
"insights": {
"type": [
"null",
"boolean"
]
},
"is_abusive": {
"type": [
"null",
"boolean"
]
},
"light_agents": {
"type": [
"null",
"boolean"
]
},
"markdown": {
"type": [
"null",
"boolean"
]
},
"on_hold_status": {
"type": [
"null",
"boolean"
]
},
"organization_access_enabled": {
"type": [
"null",
"boolean"
]
},
"rich_content_in_emails": {
"type": [
"null",
"boolean"
]
},
"sandbox": {
"type": [
"null",
"boolean"
]
},
"satisfaction_prediction": {
"type": [
"null",
"boolean"
]
},
"screencasts": {
"type": [
"null",
"boolean"
]
},
"suspended_ticket_notification": {
"type": [
"null",
"boolean"
]
},
"ticket_forms": {
"type": [
"null",
"boolean"
]
},
"ticket_tagging": {
"type": [
"null",
"boolean"
]
},
"topic_suggestion": {
"type": [
"null",
"boolean"
]
},
"twitter": {
"type": [
"null",
"boolean"
]
},
"twitter_login": {
"type": [
"null",
"boolean"
]
},
"user_org_fields": {
"type": [
"null",
"boolean"
]
},
"user_tagging": {
"type": [
"null",
"boolean"
]
},
"voice": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"agents": {
"properties": {
"agent_workspace": {
"type": [
"null",
"boolean"
]
},
"aw_auto_activation_status": {
"type": [
"null",
"integer"
]
},
"aw_auto_activation_timestamp": {
"type": [
"null",
"string"
]
},
"aw_prevent_opt_out": {
"type": [
"null",
"boolean"
]
},
"aw_self_serve_migration_enabled": {
"type": [
"null",
"boolean"
]
},
"focus_mode": {
"type": [
"null",
"boolean"
]
},
"idle_timeout_enabled": {
"type": [
"null",
"boolean"
]
},
"show_user_profile_page_toggle": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"api": {
"properties": {
"accepted_api_agreement": {
"type": [
"null",
"boolean"
]
},
"api_password_access": {
"type": [
"null",
"string"
]
},
"api_token_access": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"apps": {
"properties": {
"create_private": {
"type": [
"null",
"boolean"
]
},
"create_public": {
"type": [
"null",
"boolean"
]
},
"use": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"billing": {
"properties": {
"backend": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"branding": {
"properties": {
"favicon_url": {
"type": [
"null",
"string"
]
},
"header_color": {
"type": [
"null",
"string"
]
},
"header_logo_url": {
"type": [
"null",
"string"
]
},
"page_background_color": {
"type": [
"null",
"string"
]
},
"tab_background_color": {
"type": [
"null",
"string"
]
},
"text_color": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"brands": {
"properties": {
"default_brand_id": {
"type": [
"null",
"integer"
]
},
"require_brand_on_new_tickets": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"cdn": {
"properties": {
"cdn_provider": {
"type": [
"null",
"string"
]
},
"fallback_cdn_provider": {
"type": [
"null",
"string"
]
},
"hosts": {
"items": {
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"chat": {
"properties": {
"available": {
"type": [
"null",
"boolean"
]
},
"ctm_auto_activation_status": {
"type": [
"null",
"integer"
]
},
"ctm_auto_activation_timestamp": {
"type": [
"null",
"string"
]
},
"ctm_prevent_opt_out": {
"type": [
"null",
"boolean"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"integrated": {
"type": [
"null",
"boolean"
]
},
"maximum_request_count": {
"type": [
"null",
"integer"
]
},
"welcome_message": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"cross_sell": {
"properties": {
"show_chat_tooltip": {
"type": [
"null",
"boolean"
]
},
"xsell_source": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"gooddata_advanced_analytics": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"google_apps": {
"properties": {
"has_google_apps": {
"type": [
"null",
"boolean"
]
},
"has_google_apps_admin": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"groups": {
"properties": {
"check_group_name_uniqueness": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"knowledge": {
"properties": {
"default_search_filters_brands": {
"type": [
"null",
"string"
]
},
"default_search_filters_categories": {
"type": [
"null",
"string"
]
},
"default_search_filters_external_content_sources": {
"type": [
"null",
"string"
]
},
"default_search_filters_locales": {
"type": [
"null",
"string"
]
},
"default_search_filters_sections": {
"type": [
"null",
"string"
]
},
"require_article_templates": {
"type": [
"null",
"boolean"
]
},
"search_articles": {
"type": [
"null",
"boolean"
]
},
"search_community_posts": {
"type": [
"null",
"boolean"
]
},
"search_external_content": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"limits": {
"properties": {
"attachment_size": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"localization": {
"properties": {
"locale_ids": {
"items": {
"type": [
"null",
"integer"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"lotus": {
"properties": {
"pod_id": {
"type": [
"null",
"integer"
]
},
"prefer_lotus": {
"type": [
"null",
"boolean"
]
},
"reporting": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"metrics": {
"properties": {
"account_size": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"onboarding": {
"properties": {
"checklist_onboarding_version": {
"type": [
"null",
"integer"
]
},
"onboarding_segments": {
"type": [
"null",
"integer"
]
},
"product_sign_up": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"routing": {
"properties": {
"autorouting_tag": {
"type": [
"null",
"string"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"max_email_capacity": {
"type": [
"null",
"integer"
]
},
"max_messaging_capacity": {
"type": [
"null",
"integer"
]
},
"reassignment_messaging_enabled": {
"type": [
"null",
"boolean"
]
},
"reassignment_messaging_timeout": {
"type": [
"null",
"integer"
]
},
"reassignment_reopened_tickets_enabled": {
"type": [
"null",
"boolean"
]
},
"reassignment_reopened_tickets_messaging_statuses": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"reassignment_reopened_tickets_support_statuses": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
},
"reassignment_talk_timeout": {
"type": [
"null",
"integer"
]
},
"skills_enabled": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"rule": {
"properties": {
"enable_macro_suggestions": {
"type": [
"null",
"boolean"
]
},
"macro_most_used": {
"type": [
"null",
"boolean"
]
},
"macro_order": {
"type": [
"null",
"string"
]
},
"skill_based_filtered_views": {
"items": {
"type": [
"null",
"integer"
]
},
"type": [
"null",
"array"
]
},
"using_skill_based_routing": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"screencast": {
"properties": {
"enabled_for_tickets": {
"type": [
"null",
"boolean"
]
},
"host": {
"type": [
"null",
"string"
]
},
"tickets_recorder_id": {
"type": [
"null",
"integer"
]
}
},
"type": [
"null",
"object"
]
},
"side_conversations": {
"properties": {
"email_channel": {
"type": [
"null",
"boolean"
]
},
"slack_channel": {
"type": [
"null",
"boolean"
]
},
"tickets_channel": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"statistics": {
"properties": {
"forum": {
"type": [
"null",
"boolean"
]
},
"rule_usage": {
"type": [
"null",
"boolean"
]
},
"search": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"ticket_form": {
"properties": {
"raw_ticket_forms_instructions": {
"type": [
"null",
"string"
]
},
"ticket_forms_instructions": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"ticket_sharing_partners": {
"properties": {
"support_addresses": {
"items": {
"type": [
"null",
"string"
]
},
"type": [
"null",
"array"
]
}
},
"type": [
"null",
"object"
]
},
"tickets": {
"properties": {
"accepted_new_collaboration_tos": {
"type": [
"null",
"boolean"
]
},
"agent_can_change_requester": {
"type": [
"null",
"boolean"
]
},
"agent_collision": {
"type": [
"null",
"boolean"
]
},
"agent_email_ccs_become_followers": {
"type": [
"null",
"boolean"
]
},
"agent_ticket_deletion": {
"type": [
"null",
"boolean"
]
},
"allow_group_reset": {
"type": [
"null",
"boolean"
]
},
"app_shortcuts_context_panel_enabled": {
"type": [
"null",
"boolean"
]
},
"assign_default_organization": {
"type": [
"null",
"boolean"
]
},
"assign_tickets_upon_solve": {
"type": [
"null",
"boolean"
]
},
"auto_updated_ccs_followers_rules": {
"type": [
"null",
"boolean"
]
},
"collaboration": {
"type": [
"null",
"boolean"
]
},
"comment_email_ccs_allowed": {
"type": [
"null",
"boolean"
]
},
"comments_public_by_default": {
"type": [
"null",
"boolean"
]
},
"custom_statuses_enabled": {
"type": [
"null",
"boolean"
]
},
"edit_ticket_skills_permission": {
"type": [
"null",
"integer"
]
},
"email_attachments": {
"type": [
"null",
"boolean"
]
},
"emoji_autocompletion": {
"type": [
"null",
"boolean"
]
},
"follower_and_email_cc_collaborations": {
"type": [
"null",
"boolean"
]
},
"has_color_text": {
"type": [
"null",
"boolean"
]
},
"is_first_comment_private_enabled": {
"type": [
"null",
"boolean"
]
},
"light_agent_email_ccs_allowed": {
"type": [
"null",
"boolean"
]
},
"list_empty_views": {
"type": [
"null",
"boolean"
]
},
"list_newest_comments_first": {
"type": [
"null",
"boolean"
]
},
"markdown_ticket_comments": {
"type": [
"null",
"boolean"
]
},
"maximum_personal_views_to_list": {
"type": [
"null",
"integer"
]
},
"messaging_transcript_public": {
"type": [
"null",
"boolean"
]
},
"private_attachments": {
"type": [
"null",
"boolean"
]
},
"rich_text_comments": {
"type": [
"null",
"boolean"
]
},
"status_hold": {
"type": [
"null",
"boolean"
]
},
"tagging": {
"type": [
"null",
"boolean"
]
},
"ticket_followers_allowed": {
"type": [
"null",
"boolean"
]
},
"using_skill_based_routing": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"twitter": {
"properties": {
"shorten_url": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
},
"user": {
"properties": {
"agent_created_welcome_emails": {
"type": [
"null",
"boolean"
]
},
"end_user_phone_number_validation": {
"type": [
"null",
"boolean"
]
},
"have_gravatars_enabled": {
"type": [
"null",
"boolean"
]
},
"language_selection": {
"type": [
"null",
"boolean"
]
},
"multiple_organizations": {
"type": [
"null",
"boolean"
]
},
"tagging": {
"type": [
"null",
"boolean"
]
},
"time_zone_selection": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
},
"voice": {
"properties": {
"agent_confirmation_when_forwarding": {
"type": [
"null",
"boolean"
]
},
"agent_wrap_up_after_calls": {
"type": [
"null",
"boolean"
]
},
"enabled": {
"type": [
"null",
"boolean"
]
},
"logging": {
"type": [
"null",
"boolean"
]
},
"maximum_queue_size": {
"type": [
"null",
"integer"
]
},
"maximum_queue_wait_time": {
"type": [
"null",
"integer"
]
},
"only_during_business_hours": {
"type": [
"null",
"boolean"
]
},
"outbound_enabled": {
"type": [
"null",
"boolean"
]
},
"recordings_public": {
"type": [
"null",
"boolean"
]
},
"uk_mobile_forwarding": {
"type": [
"null",
"boolean"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
},
"type": [
"null",
"object"
]
}
| 0 |