Skip to content

Commit

Permalink
✨Source Google Webfonts: Make Connector Compatible with Builder (#38684)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Girard <[email protected]>
  • Loading branch information
2 people authored and xiaohansong committed May 29, 2024
1 parent 2013c61 commit b066af2
Show file tree
Hide file tree
Showing 14 changed files with 174 additions and 173 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#

from source_google_webfonts.run import run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: a68fbcde-b465-4ab3-b2a6-b0590a875835
dockerImageTag: 0.1.3
dockerImageTag: 0.1.4
dockerRepository: airbyte/source-google-webfonts
documentationUrl: https://docs.airbyte.com/integrations/sources/google-webfonts
githubIssueLabel: source-google-webfonts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.1.3"
version = "0.1.4"
name = "source-google-webfonts"
description = "Source implementation for Google Webfonts."
authors = [ "Airbyte <[email protected]>",]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#


Expand Down
Original file line number Diff line number Diff line change
@@ -1,148 +1,176 @@
version: "0.29.0"
version: 0.78.1

type: DeclarativeSource

check:
type: CheckStream
stream_names:
- fonts

definitions:
selector:
extractor:
field_path: ["items"]
requester:
url_base: "https://webfonts.googleapis.com/v1"
http_method: "GET"
streams:
fonts:
type: DeclarativeStream
name: fonts
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: >-
/webfonts?key={{ config['api_key'] }}&sort={{ config['sort'] or
'SORT_UNDEFINED'}}&prettyPrint={{ config['prettyPrint'] or
'true'}}&alt={{ config['alt'] or 'json'}}
http_method: GET
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- items
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/fonts"
base_requester:
type: HttpRequester
url_base: https://webfonts.googleapis.com/v1
authenticator:
type: ApiKeyAuthenticator
header: "apikey"
api_token: "{{ config['api_key'] }}"
inject_into:
type: RequestOption
inject_into: header
field_name: apikey

retriever:
record_selector:
$ref: "#/definitions/selector"
paginator:
type: NoPagination
requester:
$ref: "#/definitions/requester"
streams:
- $ref: "#/definitions/streams/fonts"

base_stream:
retriever:
$ref: "#/definitions/retriever"
spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- api_key
properties:
api_key:
type: string
title: API Key
airbyte_secret: true
description: >-
API key is required to access google apis, For getting your's goto
google console and generate api key for Webfonts
order: 0
alt:
type: string
description: Optional, Available params- json, media, proto
order: 1
prettyPrint:
type: string
description: Optional, boolean type
order: 2
sort:
type: string
description: Optional, to find how to sort
order: 3
additionalProperties: true

fonts_stream:
$ref: "#/definitions/base_stream"
$parameters:
name: "fonts"
path:
"/webfonts?key={{ config['api_key'] }}&sort={{ config['sort'] or 'SORT_UNDEFINED'}}&prettyPrint={{
config['prettyPrint'] or 'true'}}&alt={{ config['alt'] or 'json'}}"
metadata:
autoImportSchema:
fonts: false

schema_loader:
type: InlineSchemaLoader
schema:
definitions: {}
$schema: http://json-schema.org/draft-07/schema#
$id: https://example.com/object1666796406.json
title: Root
type: object
properties:
kind:
description: The API resource kind, always set to 'webfonts#webfontList'
$id: "#root/kind"
title: Kind
type: string
default: ""
pattern: ^.*$
items:
description: List of fonts available in the API
$id: "#root/items"
title: Items
type: array
default: []
items:
$id: "#root/items/items"
title: Items
schemas:
fonts:
type: object
$id: https://example.com/object1666796406.json
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
properties:
items:
type: array
$id: "#root/items"
default: []
description: List of fonts available in the API
items:
type: object
$id: "#root/items/items"
properties:
version:
type: string
$id: "#root/items/items/version"
description: Version of the font data
pattern: ^.*$
title: Version
category:
type: string
$id: "#root/items/items/category"
description: The category the font belongs to (e.g. 'sans-serif', 'serif')
pattern: ^.*$
title: Category
family:
type: string
$id: "#root/items/items/family"
description: The name of the font family (e.g. 'Roboto', 'Open Sans')
pattern: ^.*$
title: Family
files:
type: object
$id: "#root/items/items/files"
description: Different file variants available for the font
properties:
family:
description: The name of the font family (e.g. 'Roboto', 'Open Sans')
$id: "#root/items/items/family"
title: Family
type: string
default: ""
pattern: ^.*$
variants:
description: Different styles and weights available for the font
$id: "#root/items/items/variants"
title: Variants
type: array
default: []
items:
$id: "#root/items/items/variants/items"
title: Items
type: string
default: ""
pattern: ^.*$
subsets:
description: List of language subsets supported by the font
$id: "#root/items/items/subsets"
title: Subsets
type: array
default: []
items:
$id: "#root/items/items/subsets/items"
title: Items
type: string
default: ""
pattern: ^.*$
version:
description: Version of the font data
$id: "#root/items/items/version"
title: Version
italic:
type: string
default: ""
$id: "#root/items/items/files/italic"
description: URL to the italic font file
pattern: ^.*$
lastModified:
description: Timestamp of the last modification date of the font
$id: "#root/items/items/lastModified"
title: Lastmodified
title: Italic
regular:
type: string
default: ""
$id: "#root/items/items/files/regular"
description: URL to the regular font file
pattern: ^.*$
files:
description: Different file variants available for the font
$id: "#root/items/items/files"
title: Files
type: object
properties:
regular:
description: URL to the regular font file
$id: "#root/items/items/files/regular"
title: Regular
type: string
default: ""
pattern: ^.*$
italic:
description: URL to the italic font file
$id: "#root/items/items/files/italic"
title: Italic
type: string
default: ""
pattern: ^.*$
category:
description:
The category the font belongs to (e.g. 'sans-serif',
'serif')
$id: "#root/items/items/category"
title: Category
type: string
default: ""
pattern: ^.*$
kind:
description: The resource kind, should always be 'webfonts#webfont'
$id: "#root/items/items/kind"
title: Kind
type: string
default: ""
pattern: ^.*$
streams:
- "#/definitions/fonts_stream"

check:
stream_names:
- "fonts"
title: Regular
title: Files
kind:
type: string
$id: "#root/items/items/kind"
description: The resource kind, should always be 'webfonts#webfont'
pattern: ^.*$
title: Kind
lastModified:
type: string
$id: "#root/items/items/lastModified"
description: Timestamp of the last modification date of the font
pattern: ^.*$
title: Lastmodified
subsets:
type: array
$id: "#root/items/items/subsets"
default: []
description: List of language subsets supported by the font
items:
type: string
$id: "#root/items/items/subsets/items"
pattern: ^.*$
title: Items
title: Subsets
variants:
type: array
$id: "#root/items/items/variants"
default: []
description: Different styles and weights available for the font
items:
type: string
$id: "#root/items/items/variants/items"
pattern: ^.*$
title: Items
title: Variants
title: Items
title: Items
kind:
type: string
$id: "#root/kind"
description: The API resource kind, always set to 'webfonts#webfontList'
pattern: ^.*$
title: Kind
title: Root
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#


import sys

from airbyte_cdk.entrypoint import launch
from source_google_webfonts import SourceGoogleWebfonts

from .source import SourceGoogleWebfonts


def run():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
#

from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource
Expand Down
Loading

0 comments on commit b066af2

Please sign in to comment.