@owox/connectors 0.16.0-next-20251215173006 → 0.16.0-next-20251216083817

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +1986 -0
  2. package/dist/index.js +1986 -0
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6579,6 +6579,1989 @@ const TikTokAds = (function() {
6579
6579
  manifest
6580
6580
  };
6581
6581
  })();
6582
+ const ShopifyAds = (function() {
6583
+ const { AbstractException: AbstractException2, HttpRequestException: HttpRequestException2, OauthFlowException: OauthFlowException2, AbstractStorage: AbstractStorage2, AbstractSource: AbstractSource3, AbstractRunConfig: AbstractRunConfig3, AbstractConnector: AbstractConnector3, AbstractConfig: AbstractConfig2, HttpUtils: HttpUtils3, FileUtils: FileUtils3, DateUtils: DateUtils3, CryptoUtils: CryptoUtils3, AsyncUtils: AsyncUtils3, RunConfigDto: RunConfigDto2, OauthCredentialsDto: OauthCredentialsDto2, OauthCredentialsDtoBuilder: OauthCredentialsDtoBuilder2, SourceConfigDto: SourceConfigDto2, StorageConfigDto: StorageConfigDto2, ConfigDto: ConfigDto2, HTTP_STATUS: HTTP_STATUS2, EXECUTION_STATUS: EXECUTION_STATUS2, RUN_CONFIG_TYPE: RUN_CONFIG_TYPE2, CONFIG_ATTRIBUTES: CONFIG_ATTRIBUTES2, OAUTH_CONSTANTS: OAUTH_CONSTANTS2, OAUTH_SOURCE_CREDENTIALS_KEY: OAUTH_SOURCE_CREDENTIALS_KEY2 } = Core;
6584
+ var tenderTransactionsFields = {
6585
+ "id": {
6586
+ "description": "A globally-unique ID.",
6587
+ "type": "string",
6588
+ "graphqlPath": "id"
6589
+ },
6590
+ "amount": {
6591
+ "description": "The amount of the tender transaction.",
6592
+ "type": "float",
6593
+ "graphqlPath": "amount { amount }"
6594
+ },
6595
+ "currencyCode": {
6596
+ "description": "The currency code.",
6597
+ "type": "string",
6598
+ "graphqlPath": "amount { currencyCode }"
6599
+ },
6600
+ "remoteReference": {
6601
+ "description": "The remote gateway reference.",
6602
+ "type": "string",
6603
+ "graphqlPath": "remoteReference"
6604
+ },
6605
+ "test": {
6606
+ "description": "Whether the transaction is a test transaction.",
6607
+ "type": "bool",
6608
+ "graphqlPath": "test"
6609
+ },
6610
+ "orderId": {
6611
+ "description": "The ID of the order.",
6612
+ "type": "string",
6613
+ "graphqlPath": "order { id }"
6614
+ },
6615
+ "processedAt": {
6616
+ "description": "The date and time when the transaction was processed.",
6617
+ "type": "timestamp",
6618
+ "graphqlPath": "processedAt"
6619
+ }
6620
+ };
6621
+ var shopFields = {
6622
+ "id": {
6623
+ "description": "A globally-unique ID.",
6624
+ "type": "string",
6625
+ "graphqlPath": "id"
6626
+ },
6627
+ "name": {
6628
+ "description": "The name of the shop.",
6629
+ "type": "string",
6630
+ "graphqlPath": "name"
6631
+ },
6632
+ "email": {
6633
+ "description": "The email address of the shop.",
6634
+ "type": "string",
6635
+ "graphqlPath": "email"
6636
+ },
6637
+ "myshopifyDomain": {
6638
+ "description": "The myshopify.com domain of the shop.",
6639
+ "type": "string",
6640
+ "graphqlPath": "myshopifyDomain"
6641
+ },
6642
+ "primaryDomain": {
6643
+ "description": "The primary domain of the shop.",
6644
+ "type": "string",
6645
+ "graphqlPath": "primaryDomain { host }"
6646
+ },
6647
+ "currencyCode": {
6648
+ "description": "The currency code of the shop.",
6649
+ "type": "string",
6650
+ "graphqlPath": "currencyCode"
6651
+ },
6652
+ "timezoneAbbreviation": {
6653
+ "description": "The timezone abbreviation.",
6654
+ "type": "string",
6655
+ "graphqlPath": "timezoneAbbreviation"
6656
+ },
6657
+ "ianaTimezone": {
6658
+ "description": "The IANA timezone.",
6659
+ "type": "string",
6660
+ "graphqlPath": "ianaTimezone"
6661
+ },
6662
+ "weightUnit": {
6663
+ "description": "The default weight unit.",
6664
+ "type": "string",
6665
+ "graphqlPath": "weightUnit"
6666
+ },
6667
+ "billingAddressCity": {
6668
+ "description": "City from the billing address.",
6669
+ "type": "string",
6670
+ "graphqlPath": "billingAddress { city }"
6671
+ },
6672
+ "billingAddressCountry": {
6673
+ "description": "Country from the billing address.",
6674
+ "type": "string",
6675
+ "graphqlPath": "billingAddress { country }"
6676
+ },
6677
+ "billingAddressProvince": {
6678
+ "description": "Province from the billing address.",
6679
+ "type": "string",
6680
+ "graphqlPath": "billingAddress { province }"
6681
+ },
6682
+ "billingAddressZip": {
6683
+ "description": "Postal/ZIP code from the billing address.",
6684
+ "type": "string",
6685
+ "graphqlPath": "billingAddress { zip }"
6686
+ },
6687
+ "plan": {
6688
+ "description": "The shop plan name.",
6689
+ "type": "string",
6690
+ "graphqlPath": "plan { displayName }"
6691
+ },
6692
+ "contactEmail": {
6693
+ "description": "The contact email of the shop.",
6694
+ "type": "string",
6695
+ "graphqlPath": "contactEmail"
6696
+ },
6697
+ "customerAccountsV2": {
6698
+ "description": "The customer accounts version.",
6699
+ "type": "string",
6700
+ "graphqlPath": "customerAccountsV2 { loginRequiredAtCheckout }"
6701
+ },
6702
+ "taxesIncluded": {
6703
+ "description": "Whether taxes are included in prices.",
6704
+ "type": "bool",
6705
+ "graphqlPath": "taxesIncluded"
6706
+ },
6707
+ "taxShipping": {
6708
+ "description": "Whether shipping is taxed.",
6709
+ "type": "bool",
6710
+ "graphqlPath": "taxShipping"
6711
+ },
6712
+ "createdAt": {
6713
+ "description": "The date and time when the shop was created.",
6714
+ "type": "timestamp",
6715
+ "graphqlPath": "createdAt"
6716
+ },
6717
+ "updatedAt": {
6718
+ "description": "The date and time when the shop was last updated.",
6719
+ "type": "timestamp",
6720
+ "graphqlPath": "updatedAt"
6721
+ }
6722
+ };
6723
+ var productsFields = {
6724
+ "id": {
6725
+ "description": "A globally-unique ID.",
6726
+ "type": "string",
6727
+ "graphqlPath": "id"
6728
+ },
6729
+ "title": {
6730
+ "description": "The title of the product.",
6731
+ "type": "string",
6732
+ "graphqlPath": "title"
6733
+ },
6734
+ "handle": {
6735
+ "description": "A unique, human-friendly string for the product URL.",
6736
+ "type": "string",
6737
+ "graphqlPath": "handle"
6738
+ },
6739
+ "description": {
6740
+ "description": "The description of the product.",
6741
+ "type": "string",
6742
+ "graphqlPath": "description"
6743
+ },
6744
+ "descriptionHtml": {
6745
+ "description": "The description of the product in HTML format.",
6746
+ "type": "string",
6747
+ "graphqlPath": "descriptionHtml"
6748
+ },
6749
+ "vendor": {
6750
+ "description": "The name of the product vendor.",
6751
+ "type": "string",
6752
+ "graphqlPath": "vendor"
6753
+ },
6754
+ "productType": {
6755
+ "description": "The product type.",
6756
+ "type": "string",
6757
+ "graphqlPath": "productType"
6758
+ },
6759
+ "status": {
6760
+ "description": "The status of the product.",
6761
+ "type": "string",
6762
+ "graphqlPath": "status"
6763
+ },
6764
+ "tags": {
6765
+ "description": "A comma-separated list of tags.",
6766
+ "type": "string",
6767
+ "graphqlPath": "tags"
6768
+ },
6769
+ "templateSuffix": {
6770
+ "description": "The name of the template the product is using.",
6771
+ "type": "string",
6772
+ "graphqlPath": "templateSuffix"
6773
+ },
6774
+ "totalInventory": {
6775
+ "description": "The total inventory across all variants.",
6776
+ "type": "int32",
6777
+ "graphqlPath": "totalInventory"
6778
+ },
6779
+ "variantsCount": {
6780
+ "description": "The number of variants.",
6781
+ "type": "int32",
6782
+ "graphqlPath": "variantsCount { count }"
6783
+ },
6784
+ "featuredImageUrl": {
6785
+ "description": "The URL of the featured image.",
6786
+ "type": "string",
6787
+ "graphqlPath": "featuredImage { url }"
6788
+ },
6789
+ "priceRangeMinAmount": {
6790
+ "description": "The minimum price of the product.",
6791
+ "type": "float",
6792
+ "graphqlPath": "priceRangeV2 { minVariantPrice { amount } }"
6793
+ },
6794
+ "priceRangeMaxAmount": {
6795
+ "description": "The maximum price of the product.",
6796
+ "type": "float",
6797
+ "graphqlPath": "priceRangeV2 { maxVariantPrice { amount } }"
6798
+ },
6799
+ "seoTitle": {
6800
+ "description": "The SEO title.",
6801
+ "type": "string",
6802
+ "graphqlPath": "seo { title }"
6803
+ },
6804
+ "seoDescription": {
6805
+ "description": "The SEO description.",
6806
+ "type": "string",
6807
+ "graphqlPath": "seo { description }"
6808
+ },
6809
+ "onlineStoreUrl": {
6810
+ "description": "The URL of the product on the online store.",
6811
+ "type": "string",
6812
+ "graphqlPath": "onlineStoreUrl"
6813
+ },
6814
+ "publishedAt": {
6815
+ "description": "The date and time when the product was published.",
6816
+ "type": "timestamp",
6817
+ "graphqlPath": "publishedAt"
6818
+ },
6819
+ "createdAt": {
6820
+ "description": "The date and time when the product was created.",
6821
+ "type": "timestamp",
6822
+ "graphqlPath": "createdAt"
6823
+ },
6824
+ "updatedAt": {
6825
+ "description": "The date and time when the product was last updated.",
6826
+ "type": "timestamp",
6827
+ "graphqlPath": "updatedAt"
6828
+ }
6829
+ };
6830
+ var productVariantsFields = {
6831
+ "id": {
6832
+ "description": "A globally-unique ID.",
6833
+ "type": "string",
6834
+ "graphqlPath": "id"
6835
+ },
6836
+ "title": {
6837
+ "description": "The title of the variant.",
6838
+ "type": "string",
6839
+ "graphqlPath": "title"
6840
+ },
6841
+ "displayName": {
6842
+ "description": "The display name of the variant.",
6843
+ "type": "string",
6844
+ "graphqlPath": "displayName"
6845
+ },
6846
+ "sku": {
6847
+ "description": "The SKU of the variant.",
6848
+ "type": "string",
6849
+ "graphqlPath": "sku"
6850
+ },
6851
+ "barcode": {
6852
+ "description": "The barcode of the variant.",
6853
+ "type": "string",
6854
+ "graphqlPath": "barcode"
6855
+ },
6856
+ "price": {
6857
+ "description": "The price of the variant.",
6858
+ "type": "float",
6859
+ "graphqlPath": "price"
6860
+ },
6861
+ "compareAtPrice": {
6862
+ "description": "The compare at price of the variant.",
6863
+ "type": "float",
6864
+ "graphqlPath": "compareAtPrice"
6865
+ },
6866
+ "position": {
6867
+ "description": "The position of the variant in the list.",
6868
+ "type": "int32",
6869
+ "graphqlPath": "position"
6870
+ },
6871
+ "inventoryQuantity": {
6872
+ "description": "The total inventory quantity.",
6873
+ "type": "int32",
6874
+ "graphqlPath": "inventoryQuantity"
6875
+ },
6876
+ "inventoryPolicy": {
6877
+ "description": "The inventory policy.",
6878
+ "type": "string",
6879
+ "graphqlPath": "inventoryPolicy"
6880
+ },
6881
+ "inventoryItemId": {
6882
+ "description": "The ID of the inventory item.",
6883
+ "type": "string",
6884
+ "graphqlPath": "inventoryItem { id }"
6885
+ },
6886
+ "productId": {
6887
+ "description": "The ID of the product.",
6888
+ "type": "string",
6889
+ "graphqlPath": "product { id }"
6890
+ },
6891
+ "productTitle": {
6892
+ "description": "The title of the product.",
6893
+ "type": "string",
6894
+ "graphqlPath": "product { title }"
6895
+ },
6896
+ "taxable": {
6897
+ "description": "Whether the variant is taxable.",
6898
+ "type": "bool",
6899
+ "graphqlPath": "taxable"
6900
+ },
6901
+ "taxCode": {
6902
+ "description": "The tax code.",
6903
+ "type": "string",
6904
+ "graphqlPath": "taxCode"
6905
+ },
6906
+ "availableForSale": {
6907
+ "description": "Whether the variant is available for sale.",
6908
+ "type": "bool",
6909
+ "graphqlPath": "availableForSale"
6910
+ },
6911
+ "createdAt": {
6912
+ "description": "The date and time when the variant was created.",
6913
+ "type": "timestamp",
6914
+ "graphqlPath": "createdAt"
6915
+ },
6916
+ "updatedAt": {
6917
+ "description": "The date and time when the variant was last updated.",
6918
+ "type": "timestamp",
6919
+ "graphqlPath": "updatedAt"
6920
+ }
6921
+ };
6922
+ var pagesFields = {
6923
+ "id": {
6924
+ "description": "A globally-unique ID.",
6925
+ "type": "string",
6926
+ "graphqlPath": "id"
6927
+ },
6928
+ "title": {
6929
+ "description": "The title of the page.",
6930
+ "type": "string",
6931
+ "graphqlPath": "title"
6932
+ },
6933
+ "handle": {
6934
+ "description": "A unique, human-friendly string for the page URL.",
6935
+ "type": "string",
6936
+ "graphqlPath": "handle"
6937
+ },
6938
+ "body": {
6939
+ "description": "The body content of the page.",
6940
+ "type": "string",
6941
+ "graphqlPath": "body"
6942
+ },
6943
+ "bodySummary": {
6944
+ "description": "A summary of the body content.",
6945
+ "type": "string",
6946
+ "graphqlPath": "bodySummary"
6947
+ },
6948
+ "isPublished": {
6949
+ "description": "Whether the page is published.",
6950
+ "type": "bool",
6951
+ "graphqlPath": "isPublished"
6952
+ },
6953
+ "templateSuffix": {
6954
+ "description": "The name of the template the page is using.",
6955
+ "type": "string",
6956
+ "graphqlPath": "templateSuffix"
6957
+ },
6958
+ "publishedAt": {
6959
+ "description": "The date and time when the page was published.",
6960
+ "type": "timestamp",
6961
+ "graphqlPath": "publishedAt"
6962
+ },
6963
+ "createdAt": {
6964
+ "description": "The date and time when the page was created.",
6965
+ "type": "timestamp",
6966
+ "graphqlPath": "createdAt"
6967
+ },
6968
+ "updatedAt": {
6969
+ "description": "The date and time when the page was last updated.",
6970
+ "type": "timestamp",
6971
+ "graphqlPath": "updatedAt"
6972
+ }
6973
+ };
6974
+ var ordersFields = {
6975
+ "id": {
6976
+ "description": "A globally-unique ID.",
6977
+ "type": "string",
6978
+ "graphqlPath": "id"
6979
+ },
6980
+ "name": {
6981
+ "description": "The order name, generated by combining the order_number with the shop order prefix.",
6982
+ "type": "string",
6983
+ "graphqlPath": "name"
6984
+ },
6985
+ "email": {
6986
+ "description": "The email address of the customer.",
6987
+ "type": "string",
6988
+ "graphqlPath": "email"
6989
+ },
6990
+ "phone": {
6991
+ "description": "The phone number of the customer.",
6992
+ "type": "string",
6993
+ "graphqlPath": "phone"
6994
+ },
6995
+ "displayFinancialStatus": {
6996
+ "description": "The financial status of the order.",
6997
+ "type": "string",
6998
+ "graphqlPath": "displayFinancialStatus"
6999
+ },
7000
+ "displayFulfillmentStatus": {
7001
+ "description": "The fulfillment status of the order.",
7002
+ "type": "string",
7003
+ "graphqlPath": "displayFulfillmentStatus"
7004
+ },
7005
+ "confirmed": {
7006
+ "description": "Whether the order is confirmed.",
7007
+ "type": "bool",
7008
+ "graphqlPath": "confirmed"
7009
+ },
7010
+ "closed": {
7011
+ "description": "Whether the order is closed.",
7012
+ "type": "bool",
7013
+ "graphqlPath": "closed"
7014
+ },
7015
+ "cancelledAt": {
7016
+ "description": "The date and time when the order was cancelled.",
7017
+ "type": "timestamp",
7018
+ "graphqlPath": "cancelledAt"
7019
+ },
7020
+ "cancelReason": {
7021
+ "description": "The reason for cancellation.",
7022
+ "type": "string",
7023
+ "graphqlPath": "cancelReason"
7024
+ },
7025
+ "currencyCode": {
7026
+ "description": "The currency of the order.",
7027
+ "type": "string",
7028
+ "graphqlPath": "currencyCode"
7029
+ },
7030
+ "subtotalPrice": {
7031
+ "description": "The subtotal price of the order.",
7032
+ "type": "float",
7033
+ "graphqlPath": "subtotalPriceSet { shopMoney { amount } }"
7034
+ },
7035
+ "totalPrice": {
7036
+ "description": "The total price of the order.",
7037
+ "type": "float",
7038
+ "graphqlPath": "totalPriceSet { shopMoney { amount } }"
7039
+ },
7040
+ "totalTax": {
7041
+ "description": "The total tax of the order.",
7042
+ "type": "float",
7043
+ "graphqlPath": "totalTaxSet { shopMoney { amount } }"
7044
+ },
7045
+ "totalShippingPrice": {
7046
+ "description": "The total shipping price.",
7047
+ "type": "float",
7048
+ "graphqlPath": "totalShippingPriceSet { shopMoney { amount } }"
7049
+ },
7050
+ "totalDiscounts": {
7051
+ "description": "The total discounts applied.",
7052
+ "type": "float",
7053
+ "graphqlPath": "totalDiscountsSet { shopMoney { amount } }"
7054
+ },
7055
+ "totalRefunded": {
7056
+ "description": "The total amount refunded.",
7057
+ "type": "float",
7058
+ "graphqlPath": "totalRefundedSet { shopMoney { amount } }"
7059
+ },
7060
+ "totalWeight": {
7061
+ "description": "The total weight of the order.",
7062
+ "type": "float",
7063
+ "graphqlPath": "totalWeight"
7064
+ },
7065
+ "fullyPaid": {
7066
+ "description": "Whether the order is fully paid.",
7067
+ "type": "bool",
7068
+ "graphqlPath": "fullyPaid"
7069
+ },
7070
+ "taxesIncluded": {
7071
+ "description": "Whether taxes are included in the order subtotal.",
7072
+ "type": "bool",
7073
+ "graphqlPath": "taxesIncluded"
7074
+ },
7075
+ "taxExempt": {
7076
+ "description": "Whether the order is tax exempt.",
7077
+ "type": "bool",
7078
+ "graphqlPath": "taxExempt"
7079
+ },
7080
+ "customerId": {
7081
+ "description": "The ID of the customer.",
7082
+ "type": "string",
7083
+ "graphqlPath": "customer { id }"
7084
+ },
7085
+ "customerEmail": {
7086
+ "description": "The email of the customer.",
7087
+ "type": "string",
7088
+ "graphqlPath": "customer { email }"
7089
+ },
7090
+ "shippingAddressCity": {
7091
+ "description": "City from the shipping address.",
7092
+ "type": "string",
7093
+ "graphqlPath": "shippingAddress { city }"
7094
+ },
7095
+ "shippingAddressCountry": {
7096
+ "description": "Country from the shipping address.",
7097
+ "type": "string",
7098
+ "graphqlPath": "shippingAddress { country }"
7099
+ },
7100
+ "shippingAddressProvince": {
7101
+ "description": "Province from the shipping address.",
7102
+ "type": "string",
7103
+ "graphqlPath": "shippingAddress { province }"
7104
+ },
7105
+ "shippingAddressZip": {
7106
+ "description": "Postal/ZIP code from the shipping address.",
7107
+ "type": "string",
7108
+ "graphqlPath": "shippingAddress { zip }"
7109
+ },
7110
+ "billingAddressCity": {
7111
+ "description": "City from the billing address.",
7112
+ "type": "string",
7113
+ "graphqlPath": "billingAddress { city }"
7114
+ },
7115
+ "billingAddressCountry": {
7116
+ "description": "Country from the billing address.",
7117
+ "type": "string",
7118
+ "graphqlPath": "billingAddress { country }"
7119
+ },
7120
+ "billingAddressProvince": {
7121
+ "description": "Province from the billing address.",
7122
+ "type": "string",
7123
+ "graphqlPath": "billingAddress { province }"
7124
+ },
7125
+ "billingAddressZip": {
7126
+ "description": "Postal/ZIP code from the billing address.",
7127
+ "type": "string",
7128
+ "graphqlPath": "billingAddress { zip }"
7129
+ },
7130
+ "tags": {
7131
+ "description": "A comma-separated list of tags.",
7132
+ "type": "string",
7133
+ "graphqlPath": "tags"
7134
+ },
7135
+ "note": {
7136
+ "description": "The note attached to the order.",
7137
+ "type": "string",
7138
+ "graphqlPath": "note"
7139
+ },
7140
+ "sourceName": {
7141
+ "description": "The source of the order.",
7142
+ "type": "string",
7143
+ "graphqlPath": "sourceName"
7144
+ },
7145
+ "processedAt": {
7146
+ "description": "The date and time when the order was processed.",
7147
+ "type": "timestamp",
7148
+ "graphqlPath": "processedAt"
7149
+ },
7150
+ "closedAt": {
7151
+ "description": "The date and time when the order was closed.",
7152
+ "type": "timestamp",
7153
+ "graphqlPath": "closedAt"
7154
+ },
7155
+ "createdAt": {
7156
+ "description": "The date and time when the order was created.",
7157
+ "type": "timestamp",
7158
+ "graphqlPath": "createdAt"
7159
+ },
7160
+ "updatedAt": {
7161
+ "description": "The date and time when the order was last updated.",
7162
+ "type": "timestamp",
7163
+ "graphqlPath": "updatedAt"
7164
+ }
7165
+ };
7166
+ var metafieldsFields = {
7167
+ "id": {
7168
+ "description": "A globally-unique ID.",
7169
+ "type": "string",
7170
+ "graphqlPath": "id"
7171
+ },
7172
+ "namespace": {
7173
+ "description": "The namespace of the metafield.",
7174
+ "type": "string",
7175
+ "graphqlPath": "namespace"
7176
+ },
7177
+ "key": {
7178
+ "description": "The key of the metafield.",
7179
+ "type": "string",
7180
+ "graphqlPath": "key"
7181
+ },
7182
+ "value": {
7183
+ "description": "The value of the metafield.",
7184
+ "type": "string",
7185
+ "graphqlPath": "value"
7186
+ },
7187
+ "type": {
7188
+ "description": "The type of the metafield.",
7189
+ "type": "string",
7190
+ "graphqlPath": "type"
7191
+ },
7192
+ "ownerId": {
7193
+ "description": "The ID of the owner resource.",
7194
+ "type": "string"
7195
+ },
7196
+ "ownerType": {
7197
+ "description": "The type of the owner resource.",
7198
+ "type": "string",
7199
+ "graphqlPath": "ownerType"
7200
+ },
7201
+ "createdAt": {
7202
+ "description": "The date and time when the metafield was created.",
7203
+ "type": "timestamp",
7204
+ "graphqlPath": "createdAt"
7205
+ },
7206
+ "updatedAt": {
7207
+ "description": "The date and time when the metafield was last updated.",
7208
+ "type": "timestamp",
7209
+ "graphqlPath": "updatedAt"
7210
+ }
7211
+ };
7212
+ var locationsFields = {
7213
+ "id": {
7214
+ "description": "A globally-unique ID.",
7215
+ "type": "string",
7216
+ "graphqlPath": "id"
7217
+ },
7218
+ "name": {
7219
+ "description": "The name of the location.",
7220
+ "type": "string",
7221
+ "graphqlPath": "name"
7222
+ },
7223
+ "isActive": {
7224
+ "description": "Whether the location is active.",
7225
+ "type": "bool",
7226
+ "graphqlPath": "isActive"
7227
+ },
7228
+ "isPrimary": {
7229
+ "description": "Whether the location is the primary location.",
7230
+ "type": "bool",
7231
+ "graphqlPath": "isPrimary"
7232
+ },
7233
+ "isFulfillmentService": {
7234
+ "description": "Whether the location is a fulfillment service location.",
7235
+ "type": "bool",
7236
+ "graphqlPath": "isFulfillmentService"
7237
+ },
7238
+ "fulfillsOnlineOrders": {
7239
+ "description": "Whether the location can fulfill online orders.",
7240
+ "type": "bool",
7241
+ "graphqlPath": "fulfillsOnlineOrders"
7242
+ },
7243
+ "hasActiveInventory": {
7244
+ "description": "Whether the location has active inventory.",
7245
+ "type": "bool",
7246
+ "graphqlPath": "hasActiveInventory"
7247
+ },
7248
+ "shipsInventory": {
7249
+ "description": "Whether the location ships inventory.",
7250
+ "type": "bool",
7251
+ "graphqlPath": "shipsInventory"
7252
+ },
7253
+ "addressLine1": {
7254
+ "description": "The first line of the address.",
7255
+ "type": "string",
7256
+ "graphqlPath": "address { address1 }"
7257
+ },
7258
+ "addressLine2": {
7259
+ "description": "The second line of the address.",
7260
+ "type": "string",
7261
+ "graphqlPath": "address { address2 }"
7262
+ },
7263
+ "city": {
7264
+ "description": "The city of the location.",
7265
+ "type": "string",
7266
+ "graphqlPath": "address { city }"
7267
+ },
7268
+ "province": {
7269
+ "description": "The province or state of the location.",
7270
+ "type": "string",
7271
+ "graphqlPath": "address { province }"
7272
+ },
7273
+ "provinceCode": {
7274
+ "description": "The province or state code.",
7275
+ "type": "string",
7276
+ "graphqlPath": "address { provinceCode }"
7277
+ },
7278
+ "country": {
7279
+ "description": "The country of the location.",
7280
+ "type": "string",
7281
+ "graphqlPath": "address { country }"
7282
+ },
7283
+ "countryCode": {
7284
+ "description": "The country code of the location.",
7285
+ "type": "string",
7286
+ "graphqlPath": "address { countryCode }"
7287
+ },
7288
+ "zip": {
7289
+ "description": "The postal or ZIP code.",
7290
+ "type": "string",
7291
+ "graphqlPath": "address { zip }"
7292
+ },
7293
+ "phone": {
7294
+ "description": "The phone number of the location.",
7295
+ "type": "string",
7296
+ "graphqlPath": "address { phone }"
7297
+ },
7298
+ "createdAt": {
7299
+ "description": "The date and time when the location was created.",
7300
+ "type": "timestamp",
7301
+ "graphqlPath": "createdAt"
7302
+ },
7303
+ "updatedAt": {
7304
+ "description": "The date and time when the location was last updated.",
7305
+ "type": "timestamp",
7306
+ "graphqlPath": "updatedAt"
7307
+ }
7308
+ };
7309
+ var inventoryItemsFields = {
7310
+ "id": {
7311
+ "description": "A globally-unique ID.",
7312
+ "type": "string",
7313
+ "graphqlPath": "id"
7314
+ },
7315
+ "sku": {
7316
+ "description": "The unique SKU (stock keeping unit) of the inventory item.",
7317
+ "type": "string",
7318
+ "graphqlPath": "sku"
7319
+ },
7320
+ "tracked": {
7321
+ "description": "Whether inventory levels are tracked for the item.",
7322
+ "type": "bool",
7323
+ "graphqlPath": "tracked"
7324
+ },
7325
+ "requiresShipping": {
7326
+ "description": "Whether the item requires shipping.",
7327
+ "type": "bool",
7328
+ "graphqlPath": "requiresShipping"
7329
+ },
7330
+ "harmonizedSystemCode": {
7331
+ "description": "The harmonized system code of the item.",
7332
+ "type": "string",
7333
+ "graphqlPath": "harmonizedSystemCode"
7334
+ },
7335
+ "countryCodeOfOrigin": {
7336
+ "description": "The ISO 3166-1 alpha-2 country code of where the item originated from.",
7337
+ "type": "string",
7338
+ "graphqlPath": "countryCodeOfOrigin"
7339
+ },
7340
+ "variantId": {
7341
+ "description": "The ID of the variant associated with this inventory item.",
7342
+ "type": "string",
7343
+ "graphqlPath": "variant { id }"
7344
+ },
7345
+ "createdAt": {
7346
+ "description": "The date and time when the inventory item was created.",
7347
+ "type": "timestamp",
7348
+ "graphqlPath": "createdAt"
7349
+ },
7350
+ "updatedAt": {
7351
+ "description": "The date and time when the inventory item was last updated.",
7352
+ "type": "timestamp",
7353
+ "graphqlPath": "updatedAt"
7354
+ }
7355
+ };
7356
+ var fulfillmentOrdersFields = {
7357
+ "id": {
7358
+ "description": "A globally-unique ID.",
7359
+ "type": "string",
7360
+ "graphqlPath": "id"
7361
+ },
7362
+ "status": {
7363
+ "description": "The status of the fulfillment order.",
7364
+ "type": "string",
7365
+ "graphqlPath": "status"
7366
+ },
7367
+ "requestStatus": {
7368
+ "description": "The request status of the fulfillment order.",
7369
+ "type": "string",
7370
+ "graphqlPath": "requestStatus"
7371
+ },
7372
+ "orderId": {
7373
+ "description": "The ID of the order associated with this fulfillment order.",
7374
+ "type": "string",
7375
+ "graphqlPath": "order { id }"
7376
+ },
7377
+ "orderName": {
7378
+ "description": "The name of the order.",
7379
+ "type": "string",
7380
+ "graphqlPath": "order { name }"
7381
+ },
7382
+ "assignedLocationId": {
7383
+ "description": "The ID of the location assigned to fulfill this order.",
7384
+ "type": "string",
7385
+ "graphqlPath": "assignedLocation { location { id } }"
7386
+ },
7387
+ "assignedLocationName": {
7388
+ "description": "The name of the assigned location.",
7389
+ "type": "string",
7390
+ "graphqlPath": "assignedLocation { location { name } }"
7391
+ },
7392
+ "fulfillAt": {
7393
+ "description": "The date and time at which the fulfillment order will be ready to be fulfilled.",
7394
+ "type": "timestamp",
7395
+ "graphqlPath": "fulfillAt"
7396
+ },
7397
+ "deliveryMethod": {
7398
+ "description": "The delivery method of the fulfillment order.",
7399
+ "type": "string",
7400
+ "graphqlPath": "deliveryMethod { methodType }"
7401
+ },
7402
+ "createdAt": {
7403
+ "description": "The date and time when the fulfillment order was created.",
7404
+ "type": "timestamp",
7405
+ "graphqlPath": "createdAt"
7406
+ },
7407
+ "updatedAt": {
7408
+ "description": "The date and time when the fulfillment order was last updated.",
7409
+ "type": "timestamp",
7410
+ "graphqlPath": "updatedAt"
7411
+ }
7412
+ };
7413
+ var discountCodesFields = {
7414
+ "id": {
7415
+ "description": "A globally-unique ID.",
7416
+ "type": "string",
7417
+ "graphqlPath": "id"
7418
+ },
7419
+ "code": {
7420
+ "description": "The discount code string.",
7421
+ "type": "string",
7422
+ "graphqlPath": "codes(first: 1) { nodes { code } }",
7423
+ "isUnionField": true
7424
+ },
7425
+ "discountType": {
7426
+ "description": "The type of discount (DiscountCodeBasic, DiscountCodeBxgy, DiscountCodeFreeShipping).",
7427
+ "type": "string",
7428
+ "graphqlPath": "__typename",
7429
+ "isUnionField": true
7430
+ },
7431
+ "title": {
7432
+ "description": "The title of the discount.",
7433
+ "type": "string",
7434
+ "graphqlPath": "title",
7435
+ "isUnionField": true
7436
+ },
7437
+ "status": {
7438
+ "description": "The status of the discount.",
7439
+ "type": "string",
7440
+ "graphqlPath": "status",
7441
+ "isUnionField": true
7442
+ },
7443
+ "startsAt": {
7444
+ "description": "The date and time when the discount becomes active.",
7445
+ "type": "timestamp",
7446
+ "graphqlPath": "startsAt",
7447
+ "isUnionField": true
7448
+ },
7449
+ "endsAt": {
7450
+ "description": "The date and time when the discount expires.",
7451
+ "type": "timestamp",
7452
+ "graphqlPath": "endsAt",
7453
+ "isUnionField": true
7454
+ },
7455
+ "usageLimit": {
7456
+ "description": "The maximum number of times the discount can be used.",
7457
+ "type": "int32",
7458
+ "graphqlPath": "usageLimit",
7459
+ "isUnionField": true
7460
+ },
7461
+ "appliesOncePerCustomer": {
7462
+ "description": "Whether the discount can only be used once per customer.",
7463
+ "type": "bool",
7464
+ "graphqlPath": "appliesOncePerCustomer",
7465
+ "isUnionField": true
7466
+ },
7467
+ "asyncUsageCount": {
7468
+ "description": "The number of times the discount has been used.",
7469
+ "type": "int32",
7470
+ "graphqlPath": "asyncUsageCount",
7471
+ "isUnionField": true
7472
+ },
7473
+ "createdAt": {
7474
+ "description": "The date and time when the discount was created.",
7475
+ "type": "timestamp",
7476
+ "graphqlPath": "createdAt",
7477
+ "isUnionField": true
7478
+ },
7479
+ "updatedAt": {
7480
+ "description": "The date and time when the discount was last updated.",
7481
+ "type": "timestamp",
7482
+ "graphqlPath": "updatedAt",
7483
+ "isUnionField": true
7484
+ }
7485
+ };
7486
+ var customersFields = {
7487
+ "id": {
7488
+ "description": "A globally-unique ID.",
7489
+ "type": "string",
7490
+ "graphqlPath": "id"
7491
+ },
7492
+ "firstName": {
7493
+ "description": "The customer first name.",
7494
+ "type": "string",
7495
+ "graphqlPath": "firstName"
7496
+ },
7497
+ "lastName": {
7498
+ "description": "The customer last name.",
7499
+ "type": "string",
7500
+ "graphqlPath": "lastName"
7501
+ },
7502
+ "displayName": {
7503
+ "description": "The full name of the customer.",
7504
+ "type": "string",
7505
+ "graphqlPath": "displayName"
7506
+ },
7507
+ "email": {
7508
+ "description": "The customer email address.",
7509
+ "type": "string",
7510
+ "graphqlPath": "email"
7511
+ },
7512
+ "phone": {
7513
+ "description": "The customer phone number.",
7514
+ "type": "string",
7515
+ "graphqlPath": "phone"
7516
+ },
7517
+ "state": {
7518
+ "description": "The state of the customer account.",
7519
+ "type": "string",
7520
+ "graphqlPath": "state"
7521
+ },
7522
+ "locale": {
7523
+ "description": "The customer locale.",
7524
+ "type": "string",
7525
+ "graphqlPath": "locale"
7526
+ },
7527
+ "taxExempt": {
7528
+ "description": "Whether the customer is exempt from being charged taxes.",
7529
+ "type": "bool",
7530
+ "graphqlPath": "taxExempt"
7531
+ },
7532
+ "verifiedEmail": {
7533
+ "description": "Whether the customer has verified their email.",
7534
+ "type": "bool",
7535
+ "graphqlPath": "verifiedEmail"
7536
+ },
7537
+ "emailMarketingConsentState": {
7538
+ "description": "The current email marketing state for the customer.",
7539
+ "type": "string",
7540
+ "graphqlPath": "emailMarketingConsent { marketingState }"
7541
+ },
7542
+ "smsMarketingConsentState": {
7543
+ "description": "The current SMS marketing state for the customer.",
7544
+ "type": "string",
7545
+ "graphqlPath": "smsMarketingConsent { marketingState }"
7546
+ },
7547
+ "numberOfOrders": {
7548
+ "description": "The number of orders associated with this customer.",
7549
+ "type": "int32",
7550
+ "graphqlPath": "numberOfOrders"
7551
+ },
7552
+ "amountSpent": {
7553
+ "description": "The total amount spent by the customer (JSON string with amount and currencyCode).",
7554
+ "type": "string",
7555
+ "graphqlPath": "amountSpent { amount currencyCode }"
7556
+ },
7557
+ "tags": {
7558
+ "description": "A comma-separated list of tags associated with the customer.",
7559
+ "type": "string",
7560
+ "graphqlPath": "tags"
7561
+ },
7562
+ "note": {
7563
+ "description": "A note about the customer.",
7564
+ "type": "string",
7565
+ "graphqlPath": "note"
7566
+ },
7567
+ "defaultAddressCity": {
7568
+ "description": "City from the default address.",
7569
+ "type": "string",
7570
+ "graphqlPath": "defaultAddress { city }"
7571
+ },
7572
+ "defaultAddressCountry": {
7573
+ "description": "Country from the default address.",
7574
+ "type": "string",
7575
+ "graphqlPath": "defaultAddress { country }"
7576
+ },
7577
+ "defaultAddressProvince": {
7578
+ "description": "Province from the default address.",
7579
+ "type": "string",
7580
+ "graphqlPath": "defaultAddress { province }"
7581
+ },
7582
+ "defaultAddressZip": {
7583
+ "description": "Postal/ZIP code from the default address.",
7584
+ "type": "string",
7585
+ "graphqlPath": "defaultAddress { zip }"
7586
+ },
7587
+ "createdAt": {
7588
+ "description": "The date and time when the customer was created.",
7589
+ "type": "timestamp",
7590
+ "graphqlPath": "createdAt"
7591
+ },
7592
+ "updatedAt": {
7593
+ "description": "The date and time when the customer was last updated.",
7594
+ "type": "timestamp",
7595
+ "graphqlPath": "updatedAt"
7596
+ }
7597
+ };
7598
+ var collectionsFields = {
7599
+ "id": {
7600
+ "description": "A globally-unique ID.",
7601
+ "type": "string",
7602
+ "graphqlPath": "id"
7603
+ },
7604
+ "title": {
7605
+ "description": "The title of the collection.",
7606
+ "type": "string",
7607
+ "graphqlPath": "title"
7608
+ },
7609
+ "handle": {
7610
+ "description": "A unique, human-friendly string for the collection URL.",
7611
+ "type": "string",
7612
+ "graphqlPath": "handle"
7613
+ },
7614
+ "description": {
7615
+ "description": "The description of the collection, including any HTML tags and formatting.",
7616
+ "type": "string",
7617
+ "graphqlPath": "description"
7618
+ },
7619
+ "descriptionHtml": {
7620
+ "description": "The description of the collection in HTML format.",
7621
+ "type": "string",
7622
+ "graphqlPath": "descriptionHtml"
7623
+ },
7624
+ "sortOrder": {
7625
+ "description": "The order in which the products in the collection are displayed.",
7626
+ "type": "string",
7627
+ "graphqlPath": "sortOrder"
7628
+ },
7629
+ "templateSuffix": {
7630
+ "description": "The name of the template the collection is using.",
7631
+ "type": "string",
7632
+ "graphqlPath": "templateSuffix"
7633
+ },
7634
+ "productsCount": {
7635
+ "description": "The number of products in the collection.",
7636
+ "type": "int32",
7637
+ "graphqlPath": "productsCount { count }"
7638
+ },
7639
+ "imageUrl": {
7640
+ "description": "The URL of the image associated with the collection.",
7641
+ "type": "string",
7642
+ "graphqlPath": "image { url }"
7643
+ },
7644
+ "updatedAt": {
7645
+ "description": "The date and time when the collection was last updated.",
7646
+ "type": "timestamp",
7647
+ "graphqlPath": "updatedAt"
7648
+ }
7649
+ };
7650
+ var blogsFields = {
7651
+ "id": {
7652
+ "description": "A globally-unique ID.",
7653
+ "type": "string",
7654
+ "graphqlPath": "id"
7655
+ },
7656
+ "title": {
7657
+ "description": "The title of the blog.",
7658
+ "type": "string",
7659
+ "graphqlPath": "title"
7660
+ },
7661
+ "handle": {
7662
+ "description": "A unique, human-friendly string for the blog URL.",
7663
+ "type": "string",
7664
+ "graphqlPath": "handle"
7665
+ },
7666
+ "templateSuffix": {
7667
+ "description": "The name of the template the blog is using.",
7668
+ "type": "string",
7669
+ "graphqlPath": "templateSuffix"
7670
+ },
7671
+ "createdAt": {
7672
+ "description": "The date and time when the blog was created.",
7673
+ "type": "timestamp",
7674
+ "graphqlPath": "createdAt"
7675
+ },
7676
+ "updatedAt": {
7677
+ "description": "The date and time when the blog was last updated.",
7678
+ "type": "timestamp",
7679
+ "graphqlPath": "updatedAt"
7680
+ }
7681
+ };
7682
+ var articlesFields = {
7683
+ "id": {
7684
+ "description": "A globally-unique ID.",
7685
+ "type": "string",
7686
+ "graphqlPath": "id"
7687
+ },
7688
+ "title": {
7689
+ "description": "The title of the article.",
7690
+ "type": "string",
7691
+ "graphqlPath": "title"
7692
+ },
7693
+ "handle": {
7694
+ "description": "A unique, human-friendly string for the article URL.",
7695
+ "type": "string",
7696
+ "graphqlPath": "handle"
7697
+ },
7698
+ "body": {
7699
+ "description": "The text of the article body, complete with HTML markup.",
7700
+ "type": "string",
7701
+ "graphqlPath": "body"
7702
+ },
7703
+ "summary": {
7704
+ "description": "A summary of the article, which can include HTML markup.",
7705
+ "type": "string",
7706
+ "graphqlPath": "summary"
7707
+ },
7708
+ "authorName": {
7709
+ "description": "The name of the author of the article.",
7710
+ "type": "string",
7711
+ "graphqlPath": "author { name }"
7712
+ },
7713
+ "blogId": {
7714
+ "description": "The ID of the blog containing the article.",
7715
+ "type": "string",
7716
+ "graphqlPath": "blog { id }"
7717
+ },
7718
+ "blogTitle": {
7719
+ "description": "The title of the blog containing the article.",
7720
+ "type": "string",
7721
+ "graphqlPath": "blog { title }"
7722
+ },
7723
+ "isPublished": {
7724
+ "description": "Whether or not the article is visible.",
7725
+ "type": "bool",
7726
+ "graphqlPath": "isPublished"
7727
+ },
7728
+ "publishedAt": {
7729
+ "description": "The date and time when the article became or will become visible.",
7730
+ "type": "timestamp",
7731
+ "graphqlPath": "publishedAt"
7732
+ },
7733
+ "tags": {
7734
+ "description": "A comma-separated list of tags.",
7735
+ "type": "string",
7736
+ "graphqlPath": "tags"
7737
+ },
7738
+ "templateSuffix": {
7739
+ "description": "The name of the template the article is using.",
7740
+ "type": "string",
7741
+ "graphqlPath": "templateSuffix"
7742
+ },
7743
+ "imageUrl": {
7744
+ "description": "The URL of the image associated with the article.",
7745
+ "type": "string",
7746
+ "graphqlPath": "image { url }"
7747
+ },
7748
+ "createdAt": {
7749
+ "description": "The date and time when the article was created.",
7750
+ "type": "timestamp",
7751
+ "graphqlPath": "createdAt"
7752
+ },
7753
+ "updatedAt": {
7754
+ "description": "The date and time when the article was last updated.",
7755
+ "type": "timestamp",
7756
+ "graphqlPath": "updatedAt"
7757
+ }
7758
+ };
7759
+ var abandonedCheckoutsFields = {
7760
+ "id": {
7761
+ "description": "A globally-unique ID for the abandoned checkout.",
7762
+ "type": "string",
7763
+ "graphqlPath": "id"
7764
+ },
7765
+ "abandonedCheckoutUrl": {
7766
+ "description": "The URL for the buyer to recover their checkout.",
7767
+ "type": "string",
7768
+ "graphqlPath": "abandonedCheckoutUrl"
7769
+ },
7770
+ "completedAt": {
7771
+ "description": "The date and time when the checkout was completed.",
7772
+ "type": "timestamp",
7773
+ "graphqlPath": "completedAt"
7774
+ },
7775
+ "createdAt": {
7776
+ "description": "The date and time when the checkout was created.",
7777
+ "type": "timestamp",
7778
+ "graphqlPath": "createdAt"
7779
+ },
7780
+ "updatedAt": {
7781
+ "description": "The date and time when the checkout was last updated.",
7782
+ "type": "timestamp",
7783
+ "graphqlPath": "updatedAt"
7784
+ },
7785
+ "defaultCursor": {
7786
+ "description": "A default cursor that returns the single next record, sorted ascending by ID.",
7787
+ "type": "string",
7788
+ "graphqlPath": "defaultCursor"
7789
+ },
7790
+ "lineItemsQuantity": {
7791
+ "description": "The total number of line items in the checkout.",
7792
+ "type": "int32",
7793
+ "graphqlPath": "lineItemsQuantity"
7794
+ },
7795
+ "totalPriceSet": {
7796
+ "description": "The total price of the checkout including taxes, discounts, and shipping (MoneyBag as JSON string).",
7797
+ "type": "string",
7798
+ "graphqlPath": "totalPriceSet { shopMoney { amount currencyCode } }"
7799
+ },
7800
+ "billingAddressCity": {
7801
+ "description": "City from the billing address.",
7802
+ "type": "string",
7803
+ "graphqlPath": "billingAddress { city }"
7804
+ },
7805
+ "billingAddressCountry": {
7806
+ "description": "Country from the billing address.",
7807
+ "type": "string",
7808
+ "graphqlPath": "billingAddress { country }"
7809
+ },
7810
+ "billingAddressProvince": {
7811
+ "description": "Province or state from the billing address.",
7812
+ "type": "string",
7813
+ "graphqlPath": "billingAddress { province }"
7814
+ },
7815
+ "billingAddressZip": {
7816
+ "description": "Postal/ZIP code from the billing address.",
7817
+ "type": "string",
7818
+ "graphqlPath": "billingAddress { zip }"
7819
+ },
7820
+ "shippingAddressCity": {
7821
+ "description": "City from the shipping address.",
7822
+ "type": "string",
7823
+ "graphqlPath": "shippingAddress { city }"
7824
+ },
7825
+ "shippingAddressCountry": {
7826
+ "description": "Country from the shipping address.",
7827
+ "type": "string",
7828
+ "graphqlPath": "shippingAddress { country }"
7829
+ },
7830
+ "shippingAddressProvince": {
7831
+ "description": "Province or state from the shipping address.",
7832
+ "type": "string",
7833
+ "graphqlPath": "shippingAddress { province }"
7834
+ },
7835
+ "shippingAddressZip": {
7836
+ "description": "Postal/ZIP code from the shipping address.",
7837
+ "type": "string",
7838
+ "graphqlPath": "shippingAddress { zip }"
7839
+ },
7840
+ "customerId": {
7841
+ "description": "Customer globally-unique ID.",
7842
+ "type": "string",
7843
+ "graphqlPath": "customer { id }"
7844
+ },
7845
+ "customerFirstName": {
7846
+ "description": "Customer first name.",
7847
+ "type": "string",
7848
+ "graphqlPath": "customer { firstName }"
7849
+ },
7850
+ "customerLastName": {
7851
+ "description": "Customer last name.",
7852
+ "type": "string",
7853
+ "graphqlPath": "customer { lastName }"
7854
+ },
7855
+ "customerEmail": {
7856
+ "description": "Customer email address.",
7857
+ "type": "string",
7858
+ "graphqlPath": "customer { email }"
7859
+ }
7860
+ };
7861
+ var ShopifyAdsFieldsSchema = {
7862
+ "abandoned-checkouts": {
7863
+ "overview": "Abandoned Checkouts",
7864
+ "description": "Lists checkout sessions that did not convert so you can recover them.",
7865
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/queries/abandonedcheckouts",
7866
+ "fields": abandonedCheckoutsFields,
7867
+ "uniqueKeys": ["id"],
7868
+ "destinationName": "shopify_abandoned_checkouts",
7869
+ "queryName": "abandonedCheckouts",
7870
+ "connectionPath": "abandonedCheckouts",
7871
+ "isTimeSeries": true,
7872
+ "queryFilterTemplate": `query: "updated_at:>='{{startDate}}' AND updated_at:<='{{endDate}}'"`
7873
+ },
7874
+ "articles": {
7875
+ "overview": "Articles",
7876
+ "description": "Articles from the blogging system.",
7877
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Article",
7878
+ "fields": articlesFields,
7879
+ "uniqueKeys": ["id"],
7880
+ "destinationName": "shopify_articles",
7881
+ "queryName": "articles",
7882
+ "connectionPath": "articles",
7883
+ "isTimeSeries": false
7884
+ },
7885
+ "blogs": {
7886
+ "overview": "Blogs",
7887
+ "description": "Blogs in the store.",
7888
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Blog",
7889
+ "fields": blogsFields,
7890
+ "uniqueKeys": ["id"],
7891
+ "destinationName": "shopify_blogs",
7892
+ "queryName": "blogs",
7893
+ "connectionPath": "blogs",
7894
+ "isTimeSeries": false
7895
+ },
7896
+ "collections": {
7897
+ "overview": "Collections",
7898
+ "description": "Product collections in the store.",
7899
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Collection",
7900
+ "fields": collectionsFields,
7901
+ "uniqueKeys": ["id"],
7902
+ "destinationName": "shopify_collections",
7903
+ "queryName": "collections",
7904
+ "connectionPath": "collections",
7905
+ "isTimeSeries": false
7906
+ },
7907
+ "customers": {
7908
+ "overview": "Customers",
7909
+ "description": "Customer accounts in the store.",
7910
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Customer",
7911
+ "fields": customersFields,
7912
+ "uniqueKeys": ["id"],
7913
+ "destinationName": "shopify_customers",
7914
+ "queryName": "customers",
7915
+ "connectionPath": "customers",
7916
+ "isTimeSeries": true,
7917
+ "queryFilterTemplate": `query: "updated_at:>='{{startDate}}' AND updated_at:<='{{endDate}}'"`
7918
+ },
7919
+ "discount-codes": {
7920
+ "overview": "Discount Codes",
7921
+ "description": "Discount codes and their usage.",
7922
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/DiscountCodeNode",
7923
+ "fields": discountCodesFields,
7924
+ "uniqueKeys": ["id"],
7925
+ "destinationName": "shopify_discount_codes",
7926
+ "queryName": "codeDiscountNodes",
7927
+ "connectionPath": "codeDiscountNodes",
7928
+ "isTimeSeries": false,
7929
+ "unionField": "codeDiscount",
7930
+ "unionTypes": ["DiscountCodeBasic", "DiscountCodeBxgy", "DiscountCodeFreeShipping"]
7931
+ },
7932
+ "fulfillment-orders": {
7933
+ "overview": "Fulfillment Orders",
7934
+ "description": "Fulfillment orders representing items to be fulfilled from a location.",
7935
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/FulfillmentOrder",
7936
+ "fields": fulfillmentOrdersFields,
7937
+ "uniqueKeys": ["id"],
7938
+ "destinationName": "shopify_fulfillment_orders",
7939
+ "queryName": "fulfillmentOrders",
7940
+ "connectionPath": "fulfillmentOrders",
7941
+ "isTimeSeries": false
7942
+ },
7943
+ "inventory-items": {
7944
+ "overview": "Inventory Items",
7945
+ "description": "Inventory items representing SKUs.",
7946
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/InventoryItem",
7947
+ "fields": inventoryItemsFields,
7948
+ "uniqueKeys": ["id"],
7949
+ "destinationName": "shopify_inventory_items",
7950
+ "queryName": "inventoryItems",
7951
+ "connectionPath": "inventoryItems",
7952
+ "isTimeSeries": false
7953
+ },
7954
+ "locations": {
7955
+ "overview": "Locations",
7956
+ "description": "Physical or virtual locations for inventory and fulfillment.",
7957
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Location",
7958
+ "fields": locationsFields,
7959
+ "uniqueKeys": ["id"],
7960
+ "destinationName": "shopify_locations",
7961
+ "queryName": "locations",
7962
+ "connectionPath": "locations",
7963
+ "isTimeSeries": false
7964
+ },
7965
+ "orders": {
7966
+ "overview": "Orders",
7967
+ "description": "Orders placed in the store.",
7968
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Order",
7969
+ "fields": ordersFields,
7970
+ "uniqueKeys": ["id"],
7971
+ "destinationName": "shopify_orders",
7972
+ "queryName": "orders",
7973
+ "connectionPath": "orders",
7974
+ "isTimeSeries": true,
7975
+ "queryFilterTemplate": `query: "updated_at:>='{{startDate}}' AND updated_at:<='{{endDate}}'"`
7976
+ },
7977
+ "products": {
7978
+ "overview": "Products",
7979
+ "description": "Products in the store catalog.",
7980
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Product",
7981
+ "fields": productsFields,
7982
+ "uniqueKeys": ["id"],
7983
+ "destinationName": "shopify_products",
7984
+ "queryName": "products",
7985
+ "connectionPath": "products",
7986
+ "isTimeSeries": true,
7987
+ "queryFilterTemplate": `query: "updated_at:>='{{startDate}}' AND updated_at:<='{{endDate}}'"`
7988
+ },
7989
+ "product-variants": {
7990
+ "overview": "Product Variants",
7991
+ "description": "Variants of products.",
7992
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/ProductVariant",
7993
+ "fields": productVariantsFields,
7994
+ "uniqueKeys": ["id"],
7995
+ "destinationName": "shopify_product_variants",
7996
+ "queryName": "productVariants",
7997
+ "connectionPath": "productVariants",
7998
+ "isTimeSeries": false
7999
+ },
8000
+ "pages": {
8001
+ "overview": "Pages",
8002
+ "description": "Static pages in the store.",
8003
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Page",
8004
+ "fields": pagesFields,
8005
+ "uniqueKeys": ["id"],
8006
+ "destinationName": "shopify_pages",
8007
+ "queryName": "pages",
8008
+ "connectionPath": "pages",
8009
+ "isTimeSeries": false
8010
+ },
8011
+ "shop": {
8012
+ "overview": "Shop",
8013
+ "description": "Shop settings and information.",
8014
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Shop",
8015
+ "fields": shopFields,
8016
+ "uniqueKeys": ["id"],
8017
+ "destinationName": "shopify_shop",
8018
+ "queryName": "shop",
8019
+ "connectionPath": "shop",
8020
+ "isSingleton": true,
8021
+ "isTimeSeries": false
8022
+ },
8023
+ "tender-transactions": {
8024
+ "overview": "Tender Transactions",
8025
+ "description": "Tender transactions for payments.",
8026
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/TenderTransaction",
8027
+ "fields": tenderTransactionsFields,
8028
+ "uniqueKeys": ["id"],
8029
+ "destinationName": "shopify_tender_transactions",
8030
+ "queryName": "tenderTransactions",
8031
+ "connectionPath": "tenderTransactions",
8032
+ "isTimeSeries": false
8033
+ },
8034
+ "metafield-articles": {
8035
+ "overview": "Article Metafields",
8036
+ "description": "Custom metafields for articles.",
8037
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8038
+ "fields": metafieldsFields,
8039
+ "uniqueKeys": ["id"],
8040
+ "destinationName": "shopify_metafield_articles",
8041
+ "ownerType": "ARTICLE",
8042
+ "parentQuery": "articles",
8043
+ "isTimeSeries": false
8044
+ },
8045
+ "metafield-blogs": {
8046
+ "overview": "Blog Metafields",
8047
+ "description": "Custom metafields for blogs.",
8048
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8049
+ "fields": metafieldsFields,
8050
+ "uniqueKeys": ["id"],
8051
+ "destinationName": "shopify_metafield_blogs",
8052
+ "ownerType": "BLOG",
8053
+ "parentQuery": "blogs",
8054
+ "isTimeSeries": false
8055
+ },
8056
+ "metafield-collections": {
8057
+ "overview": "Collection Metafields",
8058
+ "description": "Custom metafields for collections.",
8059
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8060
+ "fields": metafieldsFields,
8061
+ "uniqueKeys": ["id"],
8062
+ "destinationName": "shopify_metafield_collections",
8063
+ "ownerType": "COLLECTION",
8064
+ "parentQuery": "collections",
8065
+ "isTimeSeries": false
8066
+ },
8067
+ "metafield-customers": {
8068
+ "overview": "Customer Metafields",
8069
+ "description": "Custom metafields for customers.",
8070
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8071
+ "fields": metafieldsFields,
8072
+ "uniqueKeys": ["id"],
8073
+ "destinationName": "shopify_metafield_customers",
8074
+ "ownerType": "CUSTOMER",
8075
+ "parentQuery": "customers",
8076
+ "isTimeSeries": false
8077
+ },
8078
+ "metafield-locations": {
8079
+ "overview": "Location Metafields",
8080
+ "description": "Custom metafields for locations.",
8081
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8082
+ "fields": metafieldsFields,
8083
+ "uniqueKeys": ["id"],
8084
+ "destinationName": "shopify_metafield_locations",
8085
+ "ownerType": "LOCATION",
8086
+ "parentQuery": "locations",
8087
+ "isTimeSeries": false
8088
+ },
8089
+ "metafield-orders": {
8090
+ "overview": "Order Metafields",
8091
+ "description": "Custom metafields for orders.",
8092
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8093
+ "fields": metafieldsFields,
8094
+ "uniqueKeys": ["id"],
8095
+ "destinationName": "shopify_metafield_orders",
8096
+ "ownerType": "ORDER",
8097
+ "parentQuery": "orders",
8098
+ "isTimeSeries": false
8099
+ },
8100
+ "metafield-pages": {
8101
+ "overview": "Page Metafields",
8102
+ "description": "Custom metafields for pages.",
8103
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8104
+ "fields": metafieldsFields,
8105
+ "uniqueKeys": ["id"],
8106
+ "destinationName": "shopify_metafield_pages",
8107
+ "ownerType": "PAGE",
8108
+ "parentQuery": "pages",
8109
+ "isTimeSeries": false
8110
+ },
8111
+ "metafield-product-variants": {
8112
+ "overview": "Product Variant Metafields",
8113
+ "description": "Custom metafields for product variants.",
8114
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8115
+ "fields": metafieldsFields,
8116
+ "uniqueKeys": ["id"],
8117
+ "destinationName": "shopify_metafield_product_variants",
8118
+ "ownerType": "PRODUCTVARIANT",
8119
+ "parentQuery": "productVariants",
8120
+ "isTimeSeries": false
8121
+ },
8122
+ "metafield-products": {
8123
+ "overview": "Product Metafields",
8124
+ "description": "Custom metafields for products.",
8125
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8126
+ "fields": metafieldsFields,
8127
+ "uniqueKeys": ["id"],
8128
+ "destinationName": "shopify_metafield_products",
8129
+ "ownerType": "PRODUCT",
8130
+ "parentQuery": "products",
8131
+ "isTimeSeries": false
8132
+ },
8133
+ "metafield-shops": {
8134
+ "overview": "Shop Metafields",
8135
+ "description": "Custom metafields for the shop.",
8136
+ "documentation": "https://shopify.dev/docs/api/admin-graphql/2025-01/objects/Metafield",
8137
+ "fields": metafieldsFields,
8138
+ "uniqueKeys": ["id"],
8139
+ "destinationName": "shopify_metafield_shops",
8140
+ "ownerType": "SHOP",
8141
+ "parentQuery": null,
8142
+ "isTimeSeries": false
8143
+ }
8144
+ };
8145
+ var ShopifyAdsSource = class ShopifyAdsSource extends AbstractSource3 {
8146
+ constructor(config) {
8147
+ super(config.mergeParameters({
8148
+ ShopDomain: {
8149
+ isRequired: true,
8150
+ requiredType: "string",
8151
+ label: "Shop Domain",
8152
+ description: "Shopify shop domain, e.g. example-store.myshopify.com"
8153
+ },
8154
+ AccessToken: {
8155
+ isRequired: true,
8156
+ requiredType: "string",
8157
+ label: "Admin API Access Token",
8158
+ description: "Private or custom app Admin API access token",
8159
+ attributes: [CONFIG_ATTRIBUTES2.SECRET]
8160
+ },
8161
+ Fields: {
8162
+ isRequired: true,
8163
+ requiredType: "string",
8164
+ label: "Fields",
8165
+ description: "Comma separated list in format 'node field'. Example: orders id, orders totalPrice"
8166
+ },
8167
+ ReimportLookbackWindow: {
8168
+ requiredType: "number",
8169
+ isRequired: true,
8170
+ default: 2,
8171
+ label: "Reimport Lookback Window",
8172
+ description: "Number of days to look back when reimporting data",
8173
+ attributes: [CONFIG_ATTRIBUTES2.ADVANCED]
8174
+ },
8175
+ CreateEmptyTables: {
8176
+ requiredType: "boolean",
8177
+ default: true,
8178
+ label: "Create Empty Tables",
8179
+ description: "Create tables with all schema columns even when API returned zero rows",
8180
+ attributes: [CONFIG_ATTRIBUTES2.ADVANCED]
8181
+ },
8182
+ StartDate: {
8183
+ requiredType: "date",
8184
+ label: "Start Date",
8185
+ description: "Start date for data import",
8186
+ attributes: [CONFIG_ATTRIBUTES2.MANUAL_BACKFILL, CONFIG_ATTRIBUTES2.HIDE_IN_CONFIG_FORM]
8187
+ },
8188
+ EndDate: {
8189
+ requiredType: "date",
8190
+ label: "End Date",
8191
+ description: "End date for data import",
8192
+ attributes: [CONFIG_ATTRIBUTES2.MANUAL_BACKFILL, CONFIG_ATTRIBUTES2.HIDE_IN_CONFIG_FORM]
8193
+ }
8194
+ }));
8195
+ this.fieldsSchema = ShopifyAdsFieldsSchema;
8196
+ }
8197
+ /**
8198
+ * Entry point to fetch Shopify data.
8199
+ */
8200
+ async fetchData({ nodeName, fields = [], startDate = null, endDate = null }) {
8201
+ const schema = this.fieldsSchema[nodeName];
8202
+ if (nodeName.startsWith("metafield-")) {
8203
+ return this._fetchMetafields({ nodeName, schema, fields });
8204
+ }
8205
+ if (schema.isSingleton) {
8206
+ return this._fetchSingleton({ nodeName, schema, fields });
8207
+ }
8208
+ return this._fetchPaginated({
8209
+ nodeName,
8210
+ schema,
8211
+ fields,
8212
+ startDate,
8213
+ endDate,
8214
+ buildQuery: (afterClause, filterClause, graphqlFields) => `query { ${schema.queryName}(first: 250${afterClause}${filterClause}) { nodes { ${graphqlFields} } pageInfo { hasNextPage endCursor } } }`,
8215
+ extractNodes: (connection) => connection.nodes || []
8216
+ });
8217
+ }
8218
+ /**
8219
+ * Generic paginated fetch with customizable query and node extraction.
8220
+ */
8221
+ async _fetchPaginated({ nodeName, schema, fields, startDate, endDate, buildQuery, extractNodes }) {
8222
+ var _a, _b, _c;
8223
+ const queryFields = this._buildQueryFields(schema, fields);
8224
+ const dateFilter = this._buildDateFilter(schema, startDate, endDate);
8225
+ const results = [];
8226
+ let cursor = null;
8227
+ let hasNextPage = true;
8228
+ while (hasNextPage) {
8229
+ const afterClause = cursor ? `, after: "${cursor}"` : "";
8230
+ const query = buildQuery(afterClause, dateFilter, queryFields);
8231
+ const payload = await this._graphqlRequest(query);
8232
+ const connection = (_a = payload == null ? void 0 : payload.data) == null ? void 0 : _a[schema.connectionPath];
8233
+ if (!connection) {
8234
+ break;
8235
+ }
8236
+ for (const node of extractNodes(connection)) {
8237
+ const normalized = nodeName === "discount-codes" ? this._normalizeDiscountCode(node, fields) : this._normalizeFromSchema({ node, schema, fields });
8238
+ results.push(normalized);
8239
+ }
8240
+ hasNextPage = ((_b = connection.pageInfo) == null ? void 0 : _b.hasNextPage) || false;
8241
+ cursor = ((_c = connection.pageInfo) == null ? void 0 : _c.endCursor) || null;
8242
+ }
8243
+ console.log(`[Shopify] Fetched ${results.length} records for ${nodeName}`);
8244
+ return results;
8245
+ }
8246
+ /**
8247
+ * Fetch singleton (shop).
8248
+ */
8249
+ async _fetchSingleton({ nodeName, schema, fields }) {
8250
+ var _a;
8251
+ const queryFields = this._buildQueryFields(schema, fields);
8252
+ const query = `query { ${schema.queryName} { ${queryFields} } }`;
8253
+ const payload = await this._graphqlRequest(query);
8254
+ const node = (_a = payload == null ? void 0 : payload.data) == null ? void 0 : _a[schema.queryName];
8255
+ console.log(`[Shopify] Fetched ${node ? 1 : 0} records for ${nodeName}`);
8256
+ return node ? [this._normalizeFromSchema({ node, schema, fields })] : [];
8257
+ }
8258
+ /**
8259
+ * Fetch metafields for various owner types.
8260
+ * Shop metafields: single query (shop is singleton)
8261
+ * Other metafields: paginate through parent entities (products, orders, etc.)
8262
+ */
8263
+ async _fetchMetafields({ nodeName, schema, fields }) {
8264
+ var _a, _b, _c, _d, _e, _f, _g, _h;
8265
+ const queryFields = this._buildQueryFields(schema, fields);
8266
+ const isShopMetafields = schema.parentQuery === null;
8267
+ const includeOwnerId = fields.includes("ownerId");
8268
+ if (isShopMetafields) {
8269
+ const query = `query { shop { id metafields(first: 250) { nodes { ${queryFields} } } } }`;
8270
+ const payload = await this._graphqlRequest(query);
8271
+ const shopId = ((_b = (_a = payload == null ? void 0 : payload.data) == null ? void 0 : _a.shop) == null ? void 0 : _b.id) || null;
8272
+ const metafields2 = ((_e = (_d = (_c = payload == null ? void 0 : payload.data) == null ? void 0 : _c.shop) == null ? void 0 : _d.metafields) == null ? void 0 : _e.nodes) || [];
8273
+ console.log(`[Shopify] Fetched ${metafields2.length} records for ${nodeName}`);
8274
+ return metafields2.map((mf) => {
8275
+ const normalized = this._normalizeFromSchema({ node: mf, schema, fields });
8276
+ if (includeOwnerId) {
8277
+ normalized.ownerId = shopId;
8278
+ }
8279
+ return normalized;
8280
+ });
8281
+ }
8282
+ const metafields = [];
8283
+ let cursor = null;
8284
+ do {
8285
+ const afterClause = cursor ? `, after: "${cursor}"` : "";
8286
+ const query = `query { ${schema.parentQuery}(first: 250${afterClause}) { nodes { id metafields(first: 250) { nodes { ${queryFields} } } } pageInfo { hasNextPage endCursor } } }`;
8287
+ const payload = await this._graphqlRequest(query);
8288
+ const connection = (_f = payload == null ? void 0 : payload.data) == null ? void 0 : _f[schema.parentQuery];
8289
+ if (!connection) {
8290
+ break;
8291
+ }
8292
+ for (const owner of connection.nodes || []) {
8293
+ for (const metafield of ((_g = owner.metafields) == null ? void 0 : _g.nodes) || []) {
8294
+ const normalized = this._normalizeFromSchema({ node: metafield, schema, fields });
8295
+ if (includeOwnerId) {
8296
+ normalized.ownerId = owner.id;
8297
+ }
8298
+ metafields.push(normalized);
8299
+ }
8300
+ }
8301
+ cursor = ((_h = connection.pageInfo) == null ? void 0 : _h.hasNextPage) ? connection.pageInfo.endCursor : null;
8302
+ } while (cursor);
8303
+ console.log(`[Shopify] Fetched ${metafields.length} records for ${nodeName}`);
8304
+ return metafields;
8305
+ }
8306
+ // ========== Data Processing ==========
8307
+ _normalizeFromSchema({ node, schema, fields }) {
8308
+ if (!node) {
8309
+ return {};
8310
+ }
8311
+ const result = {};
8312
+ for (const field of fields) {
8313
+ const fieldDefinition = schema.fields[field];
8314
+ if (!(fieldDefinition == null ? void 0 : fieldDefinition.graphqlPath)) {
8315
+ result[field] = null;
8316
+ continue;
8317
+ }
8318
+ const rawValue = this._extractValue(node, fieldDefinition.graphqlPath);
8319
+ result[field] = this._formatValue(rawValue);
8320
+ }
8321
+ return result;
8322
+ }
8323
+ _normalizeDiscountCode(node, fields) {
8324
+ var _a, _b, _c;
8325
+ const d = node.codeDiscount || {};
8326
+ const all = {
8327
+ id: node.id,
8328
+ code: ((_c = (_b = (_a = d.codes) == null ? void 0 : _a.nodes) == null ? void 0 : _b[0]) == null ? void 0 : _c.code) || null,
8329
+ discountType: d.__typename || null,
8330
+ title: d.title || null,
8331
+ status: d.status || null,
8332
+ startsAt: d.startsAt || null,
8333
+ endsAt: d.endsAt || null,
8334
+ usageLimit: d.usageLimit || null,
8335
+ appliesOncePerCustomer: d.appliesOncePerCustomer || null,
8336
+ asyncUsageCount: d.asyncUsageCount || null,
8337
+ createdAt: d.createdAt || null,
8338
+ updatedAt: d.updatedAt || null
8339
+ };
8340
+ const result = {};
8341
+ for (const field of fields) {
8342
+ result[field] = all[field] ?? null;
8343
+ }
8344
+ return result;
8345
+ }
8346
+ _extractValue(node, graphqlPath) {
8347
+ const match = graphqlPath.match(/^(\w+)\s*\{\s*(.+)\s*\}$/);
8348
+ if (match) {
8349
+ const [, parent, inner] = match;
8350
+ return node[parent] ? this._extractValue(node[parent], inner.trim()) : null;
8351
+ }
8352
+ return node[graphqlPath.split(/\s+/)[0]];
8353
+ }
8354
+ /**
8355
+ * Converts arrays and objects to strings for storage compatibility.
8356
+ */
8357
+ _formatValue(value) {
8358
+ if (value == null) {
8359
+ return null;
8360
+ }
8361
+ if (Array.isArray(value)) {
8362
+ return value.join(", ");
8363
+ }
8364
+ if (typeof value === "object") {
8365
+ return JSON.stringify(value);
8366
+ }
8367
+ return value;
8368
+ }
8369
+ // ========== Query Builders ==========
8370
+ /**
8371
+ * Builds GraphQL fields string from requested fields.
8372
+ * Handles union types (like discount-codes) with inline fragments.
8373
+ */
8374
+ _buildQueryFields(schema, fields) {
8375
+ const regularFields = [];
8376
+ const unionTypeFields = [];
8377
+ for (const field of fields) {
8378
+ const fieldDefinition = schema.fields[field];
8379
+ if (!(fieldDefinition == null ? void 0 : fieldDefinition.graphqlPath)) {
8380
+ continue;
8381
+ }
8382
+ if (fieldDefinition.isUnionField) {
8383
+ unionTypeFields.push(fieldDefinition.graphqlPath);
8384
+ } else {
8385
+ regularFields.push(fieldDefinition.graphqlPath);
8386
+ }
8387
+ }
8388
+ let queryFields = regularFields.join(" ");
8389
+ if (schema.unionField && unionTypeFields.length) {
8390
+ const unionFieldsString = unionTypeFields.join(" ");
8391
+ const inlineFragments = schema.unionTypes.map((typeName) => `... on ${typeName} { ${unionFieldsString} }`).join(" ");
8392
+ queryFields += ` ${schema.unionField} { __typename ${inlineFragments} }`;
8393
+ }
8394
+ return queryFields;
8395
+ }
8396
+ _buildDateFilter(schema, startDate, endDate) {
8397
+ if (schema.queryFilterTemplate && startDate && endDate) {
8398
+ return `, ${schema.queryFilterTemplate.replace("{{startDate}}", startDate).replace("{{endDate}}", endDate)}`;
8399
+ }
8400
+ return "";
8401
+ }
8402
+ // ========== HTTP ==========
8403
+ async _graphqlRequest(query) {
8404
+ var _a;
8405
+ const url = this._buildGraphqlUrl();
8406
+ console.log(`[Shopify] Query: ${query}`);
8407
+ const response = await this.urlFetchWithRetry(url, {
8408
+ method: "post",
8409
+ headers: this._buildHeaders(),
8410
+ body: JSON.stringify({ query }),
8411
+ payload: JSON.stringify({ query }),
8412
+ muteHttpExceptions: true
8413
+ });
8414
+ const result = JSON.parse(await response.getContentText());
8415
+ if ((_a = result.errors) == null ? void 0 : _a.length) {
8416
+ const errorMessages = result.errors.map((e) => e.message).join("; ");
8417
+ throw new Error(`[Shopify] GraphQL errors: ${errorMessages}`);
8418
+ }
8419
+ return result;
8420
+ }
8421
+ _buildGraphqlUrl() {
8422
+ const domain = String(this.config.ShopDomain.value).replace(/^https?:\/\//, "").replace(/\/$/, "");
8423
+ return `https://${domain}/admin/api/2025-01/graphql.json`;
8424
+ }
8425
+ _buildHeaders() {
8426
+ return {
8427
+ "Accept": "application/json",
8428
+ "Content-Type": "application/json",
8429
+ "X-Shopify-Access-Token": this.config.AccessToken.value
8430
+ };
8431
+ }
8432
+ isValidToRetry(error) {
8433
+ return !(error == null ? void 0 : error.statusCode) || error.statusCode >= HTTP_STATUS2.SERVER_ERROR_MIN || [HTTP_STATUS2.TOO_MANY_REQUESTS, HTTP_STATUS2.SERVICE_UNAVAILABLE, HTTP_STATUS2.GATEWAY_TIMEOUT].includes(error.statusCode);
8434
+ }
8435
+ };
8436
+ var ShopifyAdsConnector = class ShopifyAdsConnector extends AbstractConnector3 {
8437
+ constructor(config, source, storageName = "GoogleBigQueryStorage", runConfig = null) {
8438
+ super(config, source, null, runConfig);
8439
+ this.storageName = storageName;
8440
+ }
8441
+ /**
8442
+ * Import entry point for Shopify Ads.
8443
+ */
8444
+ async startImportProcess() {
8445
+ const fields = ConnectorUtils.parseFields(this.config.Fields.value);
8446
+ for (const nodeName in fields) {
8447
+ const schema = this.source.fieldsSchema[nodeName];
8448
+ const isTimeSeries = (schema == null ? void 0 : schema.isTimeSeries) || false;
8449
+ if (isTimeSeries) {
8450
+ await this._processTimeSeriesNode({
8451
+ nodeName,
8452
+ fields: fields[nodeName] || []
8453
+ });
8454
+ } else {
8455
+ await this._processCatalogNode({
8456
+ nodeName,
8457
+ fields: fields[nodeName] || []
8458
+ });
8459
+ }
8460
+ }
8461
+ }
8462
+ /**
8463
+ * Process time series node (orders, customers, products, etc.).
8464
+ * Fetches data incrementally based on date range.
8465
+ * @param {Object} options
8466
+ * @param {string} options.nodeName
8467
+ * @param {Array<string>} options.fields
8468
+ * @returns {Promise<void>}
8469
+ * @private
8470
+ */
8471
+ async _processTimeSeriesNode({ nodeName, fields }) {
8472
+ var _a;
8473
+ const [startDate, daysToFetch] = this.getStartDateAndDaysToFetch();
8474
+ if (daysToFetch <= 0) {
8475
+ this.config.logMessage(`No days to fetch for ${nodeName}`);
8476
+ return;
8477
+ }
8478
+ for (let i = 0; i < daysToFetch; i++) {
8479
+ const currentDate = new Date(startDate);
8480
+ currentDate.setDate(currentDate.getDate() + i);
8481
+ const dateStr = DateUtils3.formatDate(currentDate);
8482
+ const formattedStartDate = `${dateStr}T00:00:00Z`;
8483
+ const formattedEndDate = `${dateStr}T23:59:59Z`;
8484
+ const data = await this.source.fetchData({
8485
+ nodeName,
8486
+ fields,
8487
+ startDate: formattedStartDate,
8488
+ endDate: formattedEndDate
8489
+ });
8490
+ this.config.logMessage(
8491
+ data.length ? `${data.length} rows of ${nodeName} were fetched on ${dateStr}` : `ℹ️ No records have been fetched`
8492
+ );
8493
+ if (data.length || ((_a = this.config.CreateEmptyTables) == null ? void 0 : _a.value)) {
8494
+ const preparedData = data.length ? this.addMissingFieldsToData(data, fields) : data;
8495
+ const storage = await this.getStorageByNode(nodeName);
8496
+ await storage.saveData(preparedData);
8497
+ }
8498
+ if (this.runConfig.type === RUN_CONFIG_TYPE2.INCREMENTAL) {
8499
+ this.config.updateLastRequstedDate(currentDate);
8500
+ }
8501
+ }
8502
+ }
8503
+ /**
8504
+ * Process catalog node (static data like shop, blogs, etc.).
8505
+ * @param {Object} options
8506
+ * @param {string} options.nodeName
8507
+ * @param {Array<string>} options.fields
8508
+ * @returns {Promise<void>}
8509
+ * @private
8510
+ */
8511
+ async _processCatalogNode({ nodeName, fields }) {
8512
+ var _a;
8513
+ const data = await this.source.fetchData({
8514
+ nodeName,
8515
+ fields
8516
+ });
8517
+ const storage = await this.getStorageByNode(nodeName);
8518
+ if (data.length || ((_a = this.config.CreateEmptyTables) == null ? void 0 : _a.value)) {
8519
+ const preparedData = data.length ? this.addMissingFieldsToData(data, fields) : data;
8520
+ await storage.saveData(preparedData);
8521
+ }
8522
+ this.config.logMessage(
8523
+ data.length ? `${data.length} rows of ${nodeName} were fetched` : `No records have been fetched`
8524
+ );
8525
+ }
8526
+ /**
8527
+ * Lazy storage init per node.
8528
+ * @param {string} nodeName
8529
+ * @returns {Promise<AbstractStorage>}
8530
+ */
8531
+ async getStorageByNode(nodeName) {
8532
+ if (!("storages" in this)) {
8533
+ this.storages = {};
8534
+ }
8535
+ if (!(nodeName in this.storages)) {
8536
+ if (!("uniqueKeys" in this.source.fieldsSchema[nodeName])) {
8537
+ throw new Error(`Unique keys for '${nodeName}' are not defined in the fields schema`);
8538
+ }
8539
+ const uniqueFields = this.source.fieldsSchema[nodeName].uniqueKeys;
8540
+ this.storages[nodeName] = new globalThis[this.storageName](
8541
+ this.config.mergeParameters({
8542
+ DestinationSheetName: { value: this.source.fieldsSchema[nodeName].destinationName },
8543
+ DestinationTableName: { value: this.getDestinationName(nodeName, this.config, this.source.fieldsSchema[nodeName].destinationName) }
8544
+ }),
8545
+ uniqueFields,
8546
+ this.source.fieldsSchema[nodeName].fields,
8547
+ `${this.source.fieldsSchema[nodeName].description} ${this.source.fieldsSchema[nodeName].documentation}`
8548
+ );
8549
+ await this.storages[nodeName].init();
8550
+ }
8551
+ return this.storages[nodeName];
8552
+ }
8553
+ };
8554
+ const manifest = {
8555
+ "title": "Shopify Ads",
8556
+ "logo": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDEwOS41IDEyNC41Ij4KICA8cGF0aCBmaWxsPSIjOTVCRjQ3IiBkPSJNOTUuOSAyMy45Yy0uMS0uNi0uNi0xLTEuMS0xLS41IDAtOS4zLS4yLTkuMy0uMnMtNy40LTcuMi04LjEtNy45Yy0uNy0uNy0yLjItLjUtMi43LS4zIDAgMC0xLjQuNC0zLjcgMS4xLS40LTEuMy0xLTIuOC0xLjgtNC40LTIuNi01LTYuNS03LjctMTEuMS03LjcgMCAwIDAgMCAwIDAtLjMgMC0uNiAwLTEgLjEtLjEtLjItLjMtLjMtLjQtLjUtMi0yLjItNC42LTMuMi03LjctMy4xLTYgLjItMTIgNC41LTE2LjggMTIuMi0zLjQgNS40LTYgMTIuMi02LjcgMTcuNS02LjkgMi4xLTExLjcgMy42LTExLjggMy43LTMuNSAxLjEtMy42IDEuMi00IDQuNS0uMyAyLjUtOS41IDczLjEtOS41IDczLjFsNzUuNiAxMy4xVjIzLjljLS4yIDAtLjMgMC0uMyAwem0tMjguMy02LjNjLTEuNy41LTMuNyAxLjEtNS44IDEuOCAwLTMtLjQtNy4zLTEuOC0xMC45IDQuNS45IDYuNyA1LjkgNy42IDkuMXptLTkuOCAzYy0zLjkgMS4yLTguMiAyLjUtMTIuNSAzLjkgMS4yLTQuNyAzLjUtOS40IDYuMy0xMi41IDEuMS0xLjEgMi42LTIuNCA0LjMtMy4xIDEuNyAzLjUgMiA4LjUgMS45IDExLjd6bS03LjktMTUuNmMxLjQgMCAyLjYuMyAzLjYuOS0xLjYuOC0zLjIgMi4xLTQuNyAzLjYtMy43IDQtNi41IDEwLjItNy42IDE2LjItMy42IDEuMS03LjEgMi4yLTEwLjIgMy4yIDItOS45IDkuOC0yMy4zIDE4LjktMjMuOXoiLz4KICA8cGF0aCBmaWxsPSIjNUU4RTNFIiBkPSJNOTQuOCAyMi45Yy0uNSAwLTkuMy0uMi05LjMtLjJzLTcuNC03LjItOC4xLTcuOWMtLjMtLjMtLjYtLjQtMS0uNXYxMDguMmwzOC40LTkuNFM5NS45IDIzLjkgOTUuOSAyMy45Yy0uMS0uNi0uNi0xLTEuMS0xeiIvPgogIDxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik01OCAzOS45bC0zLjggMTQuNHMtNC4yLTItOS4yLTEuN2MtNy4zLjUtNy40IDUuMS03LjMgNi4yLjQgNi41IDE3LjUgNy45IDE4LjUgMjMuMS43IDEyLTYuNCAyMC4yLTE2LjYgMjAuOC0xMi4zLjgtMTktNi41LTE5LTYuNWwyLjYtMTFzNi42IDUgMTEuOSA0LjdjMy41LS4yIDQuOC0zLjEgNC42LTUuMS0uNS04LjQtMTQuNC03LjktMTUuMy0yMS45LS44LTExLjggNy0yMy44IDI0LjEtMjQuOSA2LjctLjQgMTAuMSAxLjMgMTAuNSAxLjl6Ii8+Cjwvc3ZnPgoK",
8557
+ "docUrl": null
8558
+ };
8559
+ return {
8560
+ ShopifyAdsSource,
8561
+ ShopifyAdsConnector,
8562
+ manifest
8563
+ };
8564
+ })();
6582
8565
  const RedditAds = (function() {
6583
8566
  const { AbstractException: AbstractException2, HttpRequestException: HttpRequestException2, OauthFlowException: OauthFlowException2, AbstractStorage: AbstractStorage2, AbstractSource: AbstractSource3, AbstractRunConfig: AbstractRunConfig3, AbstractConnector: AbstractConnector3, AbstractConfig: AbstractConfig2, HttpUtils: HttpUtils3, FileUtils: FileUtils3, DateUtils: DateUtils3, CryptoUtils: CryptoUtils3, AsyncUtils: AsyncUtils3, RunConfigDto: RunConfigDto2, OauthCredentialsDto: OauthCredentialsDto2, OauthCredentialsDtoBuilder: OauthCredentialsDtoBuilder2, SourceConfigDto: SourceConfigDto2, StorageConfigDto: StorageConfigDto2, ConfigDto: ConfigDto2, HTTP_STATUS: HTTP_STATUS2, EXECUTION_STATUS: EXECUTION_STATUS2, RUN_CONFIG_TYPE: RUN_CONFIG_TYPE2, CONFIG_ATTRIBUTES: CONFIG_ATTRIBUTES2, OAUTH_CONSTANTS: OAUTH_CONSTANTS2, OAUTH_SOURCE_CREDENTIALS_KEY: OAUTH_SOURCE_CREDENTIALS_KEY2 } = Core;
6584
8567
  const RedditAdsHelper = {
@@ -22564,6 +24547,7 @@ const BankOfCanada = (function() {
22564
24547
  const Connectors = {
22565
24548
  XAds,
22566
24549
  TikTokAds,
24550
+ ShopifyAds,
22567
24551
  RedditAds,
22568
24552
  OpenHolidays,
22569
24553
  OpenExchangeRates,
@@ -22579,6 +24563,7 @@ const Connectors = {
22579
24563
  const AvailableConnectors = [
22580
24564
  "XAds",
22581
24565
  "TikTokAds",
24566
+ "ShopifyAds",
22582
24567
  "RedditAds",
22583
24568
  "OpenHolidays",
22584
24569
  "OpenExchangeRates",
@@ -22605,6 +24590,7 @@ const OWOX = {
22605
24590
  // Individual connectors
22606
24591
  XAds,
22607
24592
  TikTokAds,
24593
+ ShopifyAds,
22608
24594
  RedditAds,
22609
24595
  OpenHolidays,
22610
24596
  OpenExchangeRates,