Skip to content

Commit d2d02bc

Browse files
committed
DOC-204 Warehouses
1 parent ac3e93f commit d2d02bc

File tree

5 files changed

+198
-5
lines changed

5 files changed

+198
-5
lines changed

scripts/papi.js

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,18 +402,59 @@ const updateDestinations = async () => {
402402
}
403403

404404
const updateWarehouses = async () => {
405+
let warehouses = []
406+
let nextPageToken = "MA=="
407+
let warehousesUpdated = []
408+
409+
405410
while (nextPageToken !== null) {
406411
const res = await getCatalog(`${PAPI_URL}/catalog/warehouses/`, nextPageToken)
407-
destinations = destinations.concat(res.data.destinationsCatalog)
412+
warehouses = warehouses.concat(res.data.warehousesCatalog)
408413
nextPageToken = res.data.pagination.next
409414
}
410415

411-
destinations.sort((a, b) => {
416+
warehouses.sort((a, b) => {
412417
if(a.name < b.name) { return -1; }
413418
if(a.name > b.name) { return 1; }
414419
return 0;
415420
})
421+
422+
warehouses.forEach(warehouse => {
423+
let slug = slugify(warehouse.slug)
424+
let url = `connections/storage/catalog/${slug}`
425+
426+
let settings = warehouse.options
427+
settings.sort((a, b) => {
428+
if(a.name < b.name) { return -1; }
429+
if(a.name > b.name) { return 1; }
430+
return 0;
431+
})
432+
433+
let updatedWarehouse = {
434+
display_name: warehouse.name,
435+
slug,
436+
description: warehouse.description,
437+
logo: {
438+
url: warehouse.logos.default
439+
},
440+
mark: {
441+
url: warehouse.logos.mark
442+
},
443+
settings
444+
}
445+
warehousesUpdated.push(updatedWarehouse)
446+
doesCatalogItemExist(updatedWarehouse)
447+
448+
})
449+
const options = { noArrayIndent: true };
450+
output = "# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT\n"
451+
var todayDate = new Date().toISOString().slice(0,10);
452+
output += "# warehouse data last updated " + todayDate + " \n";
453+
output += yaml.safeDump({ items: warehousesUpdated }, options);
454+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/catalog/warehouses_papi.yml`), output);
455+
416456
}
417457

418458
updateDestinations()
419-
//updateSources()
459+
//updateSources()
460+
updateWarehouses()

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2021-06-09
2+
# destination categories last updated 2021-06-11
33
items:
44
- display_name: Email Marketing
55
slug: email-marketing

src/_data/catalog/destinations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination data last updated 2021-06-09
2+
# destination data last updated 2021-06-11
33
items:
44
- display_name: ActiveCampaign
55
name: ActiveCampaign

src/_data/catalog/warehouses_papi.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2+
# warehouse data last updated 2021-06-11
3+
items:
4+
- display_name: Azure SQL Data Warehouse
5+
slug: azuresqldw
6+
description: Connector for Azure SQL Data Warehouse
7+
logo:
8+
url: 'https://cdn.filepicker.io/api/file/VKbuWjNjQPKOnOWijFe4'
9+
mark:
10+
url: 'https://cdn.filepicker.io/api/file/EUJvt69Q7qMqCvGrVtiu'
11+
settings: []
12+
- display_name: Azure SQL Database
13+
slug: azuresqldb
14+
description: Connector for Azure SQL Database
15+
logo:
16+
url: 'https://msftplayground.com/wp-content/uploads/2017/04/logoAzureSql.png'
17+
mark:
18+
url: ''
19+
settings: []
20+
- display_name: BigQuery
21+
slug: bigquery
22+
description: Powered by Google Cloud Platform
23+
logo:
24+
url: 'https://cdn.filepicker.io/api/file/bDzeRa75SZc6FfgfoUK6'
25+
mark:
26+
url: 'https://cdn.filepicker.io/api/file/Vk6iFlMvQeynbg30ZEtt'
27+
settings:
28+
- name: gc-project
29+
required: true
30+
type: string
31+
- display_name: IBM Db2 Warehouse
32+
slug: db2
33+
description: Db2 is a data warehouse hosted by IBM
34+
logo:
35+
url: 'https://image.ibb.co/i4rS3K/IBM_Db2_logotype_pos_RGB.jpg'
36+
mark:
37+
url: ''
38+
settings:
39+
- name: ciphertext
40+
required: true
41+
type: string
42+
- name: database
43+
required: true
44+
type: string
45+
- name: hostname
46+
required: true
47+
type: string
48+
- name: password
49+
required: true
50+
type: string
51+
- name: port
52+
required: true
53+
type: string
54+
- name: username
55+
required: true
56+
type: string
57+
- display_name: Postgres
58+
slug: postgres
59+
description: Open source data warehouse
60+
logo:
61+
url: 'https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg'
62+
mark:
63+
url: ''
64+
settings:
65+
- name: ciphertext
66+
required: true
67+
type: string
68+
- name: database
69+
required: true
70+
type: string
71+
- name: hostname
72+
required: true
73+
type: string
74+
- name: password
75+
required: true
76+
type: string
77+
- name: port
78+
required: true
79+
type: string
80+
- name: username
81+
required: true
82+
type: string
83+
- display_name: Redshift
84+
slug: redshift
85+
description: Powered by Amazon Web Services
86+
logo:
87+
url: 'https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg'
88+
mark:
89+
url: ''
90+
settings:
91+
- name: ciphertext
92+
required: true
93+
type: string
94+
- name: database
95+
required: true
96+
type: string
97+
- name: hostname
98+
required: true
99+
type: string
100+
- name: password
101+
required: true
102+
type: string
103+
- name: port
104+
required: true
105+
type: string
106+
- name: username
107+
required: true
108+
type: string
109+
- display_name: Snowflake
110+
slug: snowflake
111+
description: Data warehouse built for the cloud
112+
logo:
113+
url: 'https://cdn.filepicker.io/api/file/JrQWOYvMRRCVvSHp4HL0'
114+
mark:
115+
url: 'https://cdn.filepicker.io/api/file/OBhrGoCRKaSyvAhDX3fw'
116+
settings: []
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Data Storage catalog
3+
hide_toc: true
4+
menu_icon: "read-more"
5+
layout: catalog
6+
---
7+
8+
<div class="destinations-catalog">
9+
<div class="destinations-catalog__section">
10+
<div class="flex flex--wrap waffle waffle--xlarge">
11+
{% assign warehouses = site.data.catalog.warehouses_papi.items | sort: "display_name" %}
12+
{% for warehouse in warehouses %}
13+
<div class="flex__column flex__column--6">
14+
<a class="thumbnail-integration flex flex--middle" href="{{ site.baseurl }}/{{ warehouse.url }}/">
15+
<div class="thumbnail-integration__content">
16+
<div class="flex flex--wrap flex--middle waffle waffle--xlarge@medium">
17+
<div class="flex__column flex__column--12 flex__column--2@medium thumbnail-integration__logo-wrapper">
18+
{% if warehouse.mark.url != '' %}
19+
<img class="thumbnail-integration__logo image" alt="{{ warehouse.display_name }}" src="{{ warehouse.mark.url }}" />
20+
{% else %}
21+
<img class="thumbnail-integration__logo image" alt="{{ warehouse.display_name }}" src="{{ warehouse.logo.url }}" />
22+
{% endif %}
23+
</div>
24+
<h5 class="flex__column flex__column--12 flex__column--10@medium">{{ warehouse.display_name }}</h5>
25+
</div>
26+
{% if warehouse.status == 'PUBLIC_BETA' %}
27+
<p class="thumbnail-integration__label">Beta</p>
28+
{% endif %}
29+
</div>
30+
</a>
31+
</div>
32+
33+
{% endfor %}
34+
</div>
35+
</div>
36+
</div>

0 commit comments

Comments
 (0)