Skip to content

Commit 9beaea7

Browse files
committed
source-shopify-native: conditionally discover PII streams
Only specific Shopify plans can access PII data that's fetched via the `customers`, `orders`, and `fulfillment_orders` streams. The connector now discovers that stream if the Shopify plan is a Plus or higher account, is a partner development account, or is not one of the known non-PII plans (Basic & Starter) AND the connector is using an access token from the user's custom Shopify app (i.e. not our public OAuth app). Additionally, the name of each resource was moved into the `ShopifyGraphQLResource` class to reduce a little duplication & make it easier to filter out specific resources after they're instantiated.
1 parent 0f02f8b commit 9beaea7

File tree

23 files changed

+148
-28
lines changed

23 files changed

+148
-28
lines changed

source-shopify-native/source_shopify_native/graphql/abandoned_checkouts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
class AbandonedCheckouts(ShopifyGraphQLResource):
11+
NAME = "abandoned_checkouts"
1112
QUERY = """
1213
id
1314
abandonedCheckoutUrl

source-shopify-native/source_shopify_native/graphql/collections/collections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ async def process_result(
128128

129129

130130
class CustomCollections(_Collections):
131+
NAME = "custom_collections"
131132
COLLECTION_TYPE = "custom"
132133

133134
@staticmethod
@@ -142,6 +143,7 @@ def process_result(
142143

143144

144145
class SmartCollections(_Collections):
146+
NAME = "smart_collections"
145147
COLLECTION_TYPE = "smart"
146148

147149
@staticmethod

source-shopify-native/source_shopify_native/graphql/collections/metafields.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
class CustomCollectionMetafields(MetafieldsResource):
6+
NAME = "custom_collection_metafields"
67
PARENT_ID_KEY = "gid://shopify/Collection/"
78

89
@staticmethod
@@ -18,6 +19,7 @@ def build_query(start: datetime, end: datetime) -> str:
1819

1920

2021
class SmartCollectionMetafields(MetafieldsResource):
22+
NAME = "smart_collection_metafields"
2123
PARENT_ID_KEY = "gid://shopify/Collection/"
2224

2325
@staticmethod

source-shopify-native/source_shopify_native/graphql/customers/customers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
class Customers(ShopifyGraphQLResource):
9+
NAME = "customers"
910
QUERY = """
1011
displayName
1112
email

source-shopify-native/source_shopify_native/graphql/customers/metafields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
class CustomerMetafields(MetafieldsResource):
6+
NAME = "customer_metafields"
67
PARENT_ID_KEY = "gid://shopify/Customer/"
78

89
@staticmethod

source-shopify-native/source_shopify_native/graphql/inventory/inventory_items.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
class InventoryItems(ShopifyGraphQLResource):
9+
NAME = "inventory_items"
910
QUERY = """
1011
id
1112
legacyResourceId

source-shopify-native/source_shopify_native/graphql/inventory/inventory_levels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
class InventoryLevels(ShopifyGraphQLResource):
10+
NAME = "inventory_levels"
1011
QUERY = """
1112
inventoryLevels {
1213
edges {

source-shopify-native/source_shopify_native/graphql/locations/locations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
class Locations(ShopifyGraphQLResource):
9+
NAME = "locations"
910
QUERY = """
1011
id
1112
name

source-shopify-native/source_shopify_native/graphql/locations/metafields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
class LocationMetafields(MetafieldsResource):
6+
NAME = "location_metafields"
67
PARENT_ID_KEY = "gid://shopify/Location/"
78

89
@staticmethod

source-shopify-native/source_shopify_native/graphql/orders/agreements.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
class OrderAgreements(ShopifyGraphQLResource):
11+
NAME = "order_agreements"
1112
QUERY = """
1213
agreements {
1314
edges {

0 commit comments

Comments
 (0)