From d035a3a6ef6fce254a8b67de0d8d6e54583bfe71 Mon Sep 17 00:00:00 2001 From: Elizabeth Kenyon Date: Wed, 3 Apr 2024 11:45:35 -0500 Subject: [PATCH] Rest resources --- .../rest/admin/2024-04/abandoned_checkout.ts | 112 ++++++ .../rest/admin/2024-04/access_scope.ts | 48 +++ .../admin/2024-04/apple_pay_certificate.ts | 97 +++++ .../rest/admin/2024-04/application_charge.ts | 85 +++++ .../rest/admin/2024-04/application_credit.ts | 77 ++++ .../shopify-api/rest/admin/2024-04/article.ts | 237 +++++++++++++ .../shopify-api/rest/admin/2024-04/asset.ts | 88 +++++ .../2024-04/assigned_fulfillment_order.ts | 57 +++ .../shopify-api/rest/admin/2024-04/balance.ts | 46 +++ .../shopify-api/rest/admin/2024-04/blog.ts | 138 ++++++++ .../admin/2024-04/cancellation_request.ts | 78 ++++ .../rest/admin/2024-04/carrier_service.ts | 96 +++++ .../rest/admin/2024-04/checkout.ts | 139 ++++++++ .../shopify-api/rest/admin/2024-04/collect.ts | 126 +++++++ .../rest/admin/2024-04/collection.ts | 88 +++++ .../rest/admin/2024-04/collection_listing.ts | 131 +++++++ .../shopify-api/rest/admin/2024-04/comment.ts | 263 ++++++++++++++ .../shopify-api/rest/admin/2024-04/country.ts | 127 +++++++ .../rest/admin/2024-04/currency.ts | 47 +++ .../rest/admin/2024-04/custom_collection.ts | 163 +++++++++ .../rest/admin/2024-04/customer.ts | 281 +++++++++++++++ .../rest/admin/2024-04/customer_address.ts | 171 +++++++++ .../rest/admin/2024-04/deprecated_api_call.ts | 47 +++ .../rest/admin/2024-04/discount_code.ts | 212 +++++++++++ .../shopify-api/rest/admin/2024-04/dispute.ts | 83 +++++ .../rest/admin/2024-04/dispute_evidence.ts | 69 ++++ .../rest/admin/2024-04/dispute_file_upload.ts | 59 ++++ .../rest/admin/2024-04/draft_order.ts | 221 ++++++++++++ .../shopify-api/rest/admin/2024-04/event.ts | 124 +++++++ .../rest/admin/2024-04/fulfillment.ts | 193 ++++++++++ .../rest/admin/2024-04/fulfillment_event.ts | 129 +++++++ .../rest/admin/2024-04/fulfillment_order.ts | 296 ++++++++++++++++ .../rest/admin/2024-04/fulfillment_request.ts | 86 +++++ .../rest/admin/2024-04/fulfillment_service.ts | 102 ++++++ .../rest/admin/2024-04/gift_card.ts | 183 ++++++++++ .../admin/2024-04/gift_card_adjustment.ts | 86 +++++ .../shopify-api/rest/admin/2024-04/image.ts | 137 ++++++++ .../shopify-api/rest/admin/2024-04/index.ts | 231 ++++++++++++ .../rest/admin/2024-04/inventory_item.ts | 80 +++++ .../rest/admin/2024-04/inventory_level.ts | 173 +++++++++ .../rest/admin/2024-04/location.ts | 131 +++++++ .../rest/admin/2024-04/locations_for_move.ts | 48 +++ .../rest/admin/2024-04/marketing_event.ts | 175 +++++++++ .../rest/admin/2024-04/metafield.ts | 302 ++++++++++++++++ .../2024-04/mobile_platform_application.ts | 94 +++++ .../shopify-api/rest/admin/2024-04/order.ts | 332 ++++++++++++++++++ .../rest/admin/2024-04/order_risk.ts | 109 ++++++ .../shopify-api/rest/admin/2024-04/page.ts | 170 +++++++++ .../shopify-api/rest/admin/2024-04/payment.ts | 108 ++++++ .../rest/admin/2024-04/payment_gateway.ts | 105 ++++++ .../rest/admin/2024-04/payment_transaction.ts | 78 ++++ .../shopify-api/rest/admin/2024-04/payout.ts | 81 +++++ .../shopify-api/rest/admin/2024-04/policy.ts | 51 +++ .../rest/admin/2024-04/price_rule.ts | 163 +++++++++ .../shopify-api/rest/admin/2024-04/product.ts | 192 ++++++++++ .../rest/admin/2024-04/product_listing.ts | 167 +++++++++ .../2024-04/product_resource_feedback.ts | 62 ++++ .../rest/admin/2024-04/province.ts | 110 ++++++ .../2024-04/recurring_application_charge.ts | 138 ++++++++ .../rest/admin/2024-04/redirect.ts | 131 +++++++ .../shopify-api/rest/admin/2024-04/refund.ts | 125 +++++++ .../rest/admin/2024-04/resource_feedback.ts | 53 +++ .../rest/admin/2024-04/script_tag.ts | 139 ++++++++ .../rest/admin/2024-04/shipping_zone.ts | 62 ++++ .../shopify-api/rest/admin/2024-04/shop.ts | 119 +++++++ .../rest/admin/2024-04/smart_collection.ts | 192 ++++++++++ .../admin/2024-04/storefront_access_token.ts | 73 ++++ .../rest/admin/2024-04/tender_transaction.ts | 67 ++++ .../shopify-api/rest/admin/2024-04/theme.ts | 101 ++++++ .../rest/admin/2024-04/transaction.ts | 130 +++++++ .../rest/admin/2024-04/usage_charge.ts | 84 +++++ .../shopify-api/rest/admin/2024-04/user.ts | 106 ++++++ .../shopify-api/rest/admin/2024-04/variant.ts | 156 ++++++++ .../shopify-api/rest/admin/2024-04/webhook.ts | 146 ++++++++ 74 files changed, 9506 insertions(+) create mode 100644 packages/shopify-api/rest/admin/2024-04/abandoned_checkout.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/access_scope.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/apple_pay_certificate.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/application_charge.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/application_credit.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/article.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/asset.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/assigned_fulfillment_order.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/balance.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/blog.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/cancellation_request.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/carrier_service.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/checkout.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/collect.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/collection.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/collection_listing.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/comment.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/country.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/currency.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/custom_collection.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/customer.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/customer_address.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/deprecated_api_call.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/discount_code.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/dispute.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/dispute_evidence.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/dispute_file_upload.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/draft_order.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/event.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/fulfillment.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/fulfillment_event.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/fulfillment_order.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/fulfillment_request.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/fulfillment_service.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/gift_card.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/gift_card_adjustment.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/image.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/index.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/inventory_item.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/inventory_level.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/location.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/locations_for_move.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/marketing_event.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/metafield.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/mobile_platform_application.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/order.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/order_risk.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/page.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/payment.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/payment_gateway.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/payment_transaction.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/payout.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/policy.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/price_rule.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/product.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/product_listing.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/product_resource_feedback.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/province.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/recurring_application_charge.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/redirect.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/refund.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/resource_feedback.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/script_tag.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/shipping_zone.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/shop.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/smart_collection.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/storefront_access_token.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/tender_transaction.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/theme.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/transaction.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/usage_charge.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/user.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/variant.ts create mode 100644 packages/shopify-api/rest/admin/2024-04/webhook.ts diff --git a/packages/shopify-api/rest/admin/2024-04/abandoned_checkout.ts b/packages/shopify-api/rest/admin/2024-04/abandoned_checkout.ts new file mode 100644 index 000000000..ae527fba1 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/abandoned_checkout.ts @@ -0,0 +1,112 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; +import {Customer} from './customer'; +import {DiscountCode} from './discount_code'; + +interface CheckoutsArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + status?: unknown; + limit?: unknown; +} + +export class AbandonedCheckout extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency, + "customer": Customer + }; + protected static hasMany: {[key: string]: typeof Base} = { + "discount_codes": DiscountCode + }; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "checkouts", "ids": [], "path": "checkouts.json"}, + {"http_method": "get", "operation": "checkouts", "ids": [], "path": "checkouts.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "abandoned_checkout", + "plural": "abandoned_checkouts" + } + ]; + + public static async checkouts( + { + session, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + status = null, + limit = null, + ...otherArgs + }: CheckoutsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "checkouts", + session: session, + urlIds: {}, + params: {"since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "status": status, "limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public abandoned_checkout_url: string | null; + public billing_address: {[key: string]: unknown} | null; + public buyer_accepts_marketing: boolean | null; + public buyer_accepts_sms_marketing: boolean | null; + public cart_token: string | null; + public closed_at: string | null; + public completed_at: string | null; + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + public customer: Customer | null | {[key: string]: any}; + public customer_locale: string | null; + public device_id: number | null; + public discount_codes: DiscountCode[] | null | {[key: string]: any}; + public email: string | null; + public gateway: string | null; + public id: number | null; + public landing_site: string | null; + public line_items: {[key: string]: unknown} | null; + public location_id: number | null; + public note: string | null; + public phone: string | null; + public presentment_currency: string | null; + public referring_site: string | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_lines: {[key: string]: unknown} | null; + public sms_marketing_phone: string | null; + public source_name: string | null; + public subtotal_price: string | null; + public tax_lines: {[key: string]: unknown} | null; + public taxes_included: boolean | null; + public token: string | null; + public total_discounts: string | null; + public total_duties: string | null; + public total_line_items_price: string | null; + public total_price: string | null; + public total_tax: string | null; + public total_weight: number | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/access_scope.ts b/packages/shopify-api/rest/admin/2024-04/access_scope.ts new file mode 100644 index 000000000..1da4b7648 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/access_scope.ts @@ -0,0 +1,48 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class AccessScope extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static customPrefix: string | null = "/admin/oauth"; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "access_scopes.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "access_scope", + "plural": "access_scopes" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public handle: string | null; + public access_scopes: {[key: string]: unknown}[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/apple_pay_certificate.ts b/packages/shopify-api/rest/admin/2024-04/apple_pay_certificate.ts new file mode 100644 index 000000000..57c89fa65 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/apple_pay_certificate.ts @@ -0,0 +1,97 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface CsrArgs { + [key: string]: unknown; + session: Session; + id: number | string; +} + +export class ApplePayCertificate extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "apple_pay_certificates/.json"}, + {"http_method": "get", "operation": "csr", "ids": ["id"], "path": "apple_pay_certificates//csr.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "apple_pay_certificates/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "apple_pay_certificates.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "apple_pay_certificates/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "apple_pay_certificate", + "plural": "apple_pay_certificates" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async csr( + { + session, + id, + ...otherArgs + }: CsrArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "csr", + session: session, + urlIds: {"id": id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public id: number | null; + public merchant_id: string | null; + public status: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/application_charge.ts b/packages/shopify-api/rest/admin/2024-04/application_charge.ts new file mode 100644 index 000000000..b5a5e920e --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/application_charge.ts @@ -0,0 +1,85 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} + +export class ApplicationCharge extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "application_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "application_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "application_charges.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "application_charge", + "plural": "application_charges" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public confirmation_url: string | null; + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + public id: number | null; + public name: string | null; + public price: string | number | null; + public return_url: string | null; + public status: string | null; + public test: boolean | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/application_credit.ts b/packages/shopify-api/rest/admin/2024-04/application_credit.ts new file mode 100644 index 000000000..b48c79a76 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/application_credit.ts @@ -0,0 +1,77 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class ApplicationCredit extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "application_credits.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "application_credits/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "application_credit", + "plural": "application_credits" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: Currency | null | {[key: string]: any}; + public description: string | null; + public id: number | null; + public test: boolean | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/article.ts b/packages/shopify-api/rest/admin/2024-04/article.ts new file mode 100644 index 000000000..7797545af --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/article.ts @@ -0,0 +1,237 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + blog_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + blog_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + handle?: unknown; + tag?: unknown; + author?: unknown; + fields?: unknown; +} +interface AuthorsArgs { + [key: string]: unknown; + session: Session; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} +interface TagsArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + limit?: unknown; + popular?: unknown; +} + +export class Article extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "metafields": Metafield + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"}, + {"http_method": "get", "operation": "authors", "ids": [], "path": "articles/authors.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//articles/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//articles.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"}, + {"http_method": "get", "operation": "tags", "ids": [], "path": "articles/tags.json"}, + {"http_method": "get", "operation": "tags", "ids": ["blog_id"], "path": "blogs//articles/tags.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//articles.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "article", + "plural": "articles" + } + ]; + + public static async find( + { + session, + id, + blog_id = null, + fields = null + }: FindArgs + ): Promise
{ + const result = await this.baseFind
({ + session: session, + urlIds: {"id": id, "blog_id": blog_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + blog_id = null + }: DeleteArgs + ): Promise { + const response = await this.request
({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "blog_id": blog_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + blog_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + handle = null, + tag = null, + author = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind
({ + session: session, + urlIds: {"blog_id": blog_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "handle": handle, "tag": tag, "author": author, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async authors( + { + session, + ...otherArgs + }: AuthorsArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "authors", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async count( + { + session, + blog_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"blog_id": blog_id}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async tags( + { + session, + blog_id = null, + limit = null, + popular = null, + ...otherArgs + }: TagsArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "tags", + session: session, + urlIds: {"blog_id": blog_id}, + params: {"limit": limit, "popular": popular, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public author: string | null; + public blog_id: number | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public metafields: Metafield[] | null | {[key: string]: any}; + public published: boolean | null; + public published_at: string | null; + public summary_html: string | null; + public tags: string | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/asset.ts b/packages/shopify-api/rest/admin/2024-04/asset.ts new file mode 100644 index 000000000..9a6b9c0de --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/asset.ts @@ -0,0 +1,88 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + theme_id?: number | string | null; + asset?: {[key: string]: unknown} | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + theme_id?: number | string | null; + fields?: unknown; + asset?: {[key: string]: unknown} | null; +} + +export class Asset extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "get", "operation": "get", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "get", "operation": "get", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "put", "operation": "put", "ids": ["theme_id"], "path": "themes//assets.json"} + ]; + protected static primaryKey: string = "key"; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "asset", + "plural": "assets" + } + ]; + + public static async delete( + { + session, + theme_id = null, + asset = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"theme_id": theme_id}, + params: {"asset": asset}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + theme_id = null, + fields = null, + asset = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"theme_id": theme_id}, + params: {"fields": fields, "asset": asset, ...otherArgs}, + }); + + return response; + } + + public attachment: string | null; + public checksum: string | null; + public content_type: string | null; + public created_at: string | null; + public key: string | null; + public public_url: string | null; + public size: number | null; + public theme_id: number | null; + public updated_at: string | null; + public value: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/assigned_fulfillment_order.ts b/packages/shopify-api/rest/admin/2024-04/assigned_fulfillment_order.ts new file mode 100644 index 000000000..a6dcf8a8a --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/assigned_fulfillment_order.ts @@ -0,0 +1,57 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + assignment_status?: unknown; + location_ids?: unknown[] | number | string | null; +} + +export class AssignedFulfillmentOrder extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "assigned_fulfillment_orders.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "fulfillment_order", + "plural": "fulfillment_orders" + } + ]; + + public static async all( + { + session, + assignment_status = null, + location_ids = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"assignment_status": assignment_status, "location_ids": location_ids, ...otherArgs}, + }); + + return response; + } + + public assigned_location_id: number | null; + public destination: {[key: string]: unknown} | null; + public id: number | null; + public line_items: {[key: string]: unknown}[] | null; + public order_id: number | null; + public request_status: string | null; + public shop_id: number | null; + public status: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/balance.ts b/packages/shopify-api/rest/admin/2024-04/balance.ts new file mode 100644 index 000000000..f650b0af1 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/balance.ts @@ -0,0 +1,46 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Balance extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/balance.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "balance", + "plural": "balances" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public balance: {[key: string]: unknown}[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/blog.ts b/packages/shopify-api/rest/admin/2024-04/blog.ts new file mode 100644 index 000000000..715e4375f --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/blog.ts @@ -0,0 +1,138 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + handle?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Blog extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "metafields": Metafield + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "blogs/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "blogs/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "blogs.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "blogs/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "blogs.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "blogs/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "blog", + "plural": "blogs" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + handle = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "handle": handle, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public admin_graphql_api_id: string | null; + public commentable: string | null; + public created_at: string | null; + public feedburner: string | null; + public feedburner_location: string | null; + public handle: string | null; + public id: number | null; + public metafields: Metafield[] | null | {[key: string]: any}; + public tags: string | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/cancellation_request.ts b/packages/shopify-api/rest/admin/2024-04/cancellation_request.ts new file mode 100644 index 000000000..c3f03dae1 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/cancellation_request.ts @@ -0,0 +1,78 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {ApiVersion} from '../../../lib/types'; + +interface AcceptArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface RejectArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class CancellationRequest extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "post", "operation": "accept", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request/accept.json"}, + {"http_method": "post", "operation": "post", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request.json"}, + {"http_method": "post", "operation": "reject", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request/reject.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "cancellation_request", + "plural": "cancellation_requests" + } + ]; + + public async accept( + { + message = null, + body = null, + ...otherArgs + }: AcceptArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "accept", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reject( + { + message = null, + body = null, + ...otherArgs + }: RejectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reject", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public fulfillment_order_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/carrier_service.ts b/packages/shopify-api/rest/admin/2024-04/carrier_service.ts new file mode 100644 index 000000000..d9ecbbaf7 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/carrier_service.ts @@ -0,0 +1,96 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class CarrierService extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "carrier_services/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "carrier_services.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "carrier_services/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "carrier_services.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "carrier_services/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "carrier_service", + "plural": "carrier_services" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public active: boolean | null; + public admin_graphql_api_id: string | null; + public callback_url: string | null; + public carrier_service_type: string | null; + public format: string | null; + public id: number | null; + public name: string | null; + public service_discovery: boolean | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/checkout.ts b/packages/shopify-api/rest/admin/2024-04/checkout.ts new file mode 100644 index 000000000..96b796f27 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/checkout.ts @@ -0,0 +1,139 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {DiscountCode} from './discount_code'; +import {Order} from './order'; +import {GiftCard} from './gift_card'; + +interface FindArgs { + session: Session; + token: number | string; +} +interface ShippingRatesArgs { + [key: string]: unknown; + session: Session; + token: number | string; +} +interface CompleteArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Checkout extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "discount_code": DiscountCode, + "order": Order + }; + protected static hasMany: {[key: string]: typeof Base} = { + "gift_cards": GiftCard + }; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["token"], "path": "checkouts/.json"}, + {"http_method": "get", "operation": "shipping_rates", "ids": ["token"], "path": "checkouts//shipping_rates.json"}, + {"http_method": "post", "operation": "complete", "ids": ["token"], "path": "checkouts//complete.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "checkouts.json"}, + {"http_method": "put", "operation": "put", "ids": ["token"], "path": "checkouts/.json"} + ]; + protected static primaryKey: string = "token"; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "checkout", + "plural": "checkouts" + } + ]; + + public static async find( + { + session, + token + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"token": token}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async shipping_rates( + { + session, + token, + ...otherArgs + }: ShippingRatesArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "shipping_rates", + session: session, + urlIds: {"token": token}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async complete( + { + body = null, + ...otherArgs + }: CompleteArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "complete", + session: this.session, + urlIds: {"token": this.token}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public billing_address: {[key: string]: unknown} | null; + public line_items: {[key: string]: unknown}[] | null; + public applied_discount: {[key: string]: unknown} | null; + public buyer_accepts_marketing: boolean | null; + public created_at: string | null; + public currency: string | null; + public customer_id: number | null; + public discount_code: DiscountCode | null | {[key: string]: any}; + public email: string | null; + public gift_cards: GiftCard[] | null | {[key: string]: any}; + public order: Order | null | {[key: string]: any}; + public payment_due: string | null; + public payment_url: string | null; + public phone: string | null; + public presentment_currency: string | null; + public requires_shipping: boolean | null; + public reservation_time: string | null; + public reservation_time_left: number | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_line: {[key: string]: unknown} | null; + public shipping_rate: {[key: string]: unknown} | null; + public source_identifier: string | null; + public source_name: string | null; + public source_url: string | null; + public subtotal_price: string | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public token: string | null; + public total_price: string | null; + public total_tax: string | null; + public updated_at: string | null; + public user_id: number | null; + public web_url: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/collect.ts b/packages/shopify-api/rest/admin/2024-04/collect.ts new file mode 100644 index 000000000..682796769 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/collect.ts @@ -0,0 +1,126 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Collect extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "collects/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "collects/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "collects.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "collects/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "collects.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "collect", + "plural": "collects" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public collection_id: number | null; + public created_at: string | null; + public id: number | null; + public position: number | null; + public product_id: number | null; + public sort_value: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/collection.ts b/packages/shopify-api/rest/admin/2024-04/collection.ts new file mode 100644 index 000000000..9b348efe2 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/collection.ts @@ -0,0 +1,88 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface ProductsArgs { + [key: string]: unknown; + session: Session; + id: number | string; + limit?: unknown; +} + +export class Collection extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "image": Image + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "collections/.json"}, + {"http_method": "get", "operation": "products", "ids": ["id"], "path": "collections//products.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "collection", + "plural": "collections" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async products( + { + session, + id, + limit = null, + ...otherArgs + }: ProductsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "products", + session: session, + urlIds: {"id": id}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public handle: string | null; + public id: number | null; + public image: Image | null | {[key: string]: any}; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/collection_listing.ts b/packages/shopify-api/rest/admin/2024-04/collection_listing.ts new file mode 100644 index 000000000..590a11d60 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/collection_listing.ts @@ -0,0 +1,131 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; + +interface FindArgs { + session: Session; + collection_id: number | string; +} +interface DeleteArgs { + session: Session; + collection_id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; +} +interface ProductIdsArgs { + [key: string]: unknown; + session: Session; + collection_id: number | string; + limit?: unknown; +} + +export class CollectionListing extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "image": Image + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["collection_id"], "path": "collection_listings/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "collection_listings.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collection_listings/.json"}, + {"http_method": "get", "operation": "product_ids", "ids": ["collection_id"], "path": "collection_listings//product_ids.json"}, + {"http_method": "put", "operation": "put", "ids": ["collection_id"], "path": "collection_listings/.json"} + ]; + protected static primaryKey: string = "collection_id"; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "collection_listing", + "plural": "collection_listings" + } + ]; + + public static async find( + { + session, + collection_id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"collection_id": collection_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + collection_id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"collection_id": collection_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, ...otherArgs}, + }); + + return response; + } + + public static async product_ids( + { + session, + collection_id, + limit = null, + ...otherArgs + }: ProductIdsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "product_ids", + session: session, + urlIds: {"collection_id": collection_id}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public body_html: string | null; + public collection_id: number | null; + public default_product_image: {[key: string]: unknown}[] | null; + public handle: string | null; + public image: Image | null | {[key: string]: any}; + public published_at: string | null; + public sort_order: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/comment.ts b/packages/shopify-api/rest/admin/2024-04/comment.ts new file mode 100644 index 000000000..d297151c7 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/comment.ts @@ -0,0 +1,263 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + fields?: unknown; + published_status?: unknown; + status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + status?: unknown; +} +interface ApproveArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface NotSpamArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RemoveArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RestoreArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SpamArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Comment extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "comments/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "comments.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "comments/.json"}, + {"http_method": "post", "operation": "approve", "ids": ["id"], "path": "comments//approve.json"}, + {"http_method": "post", "operation": "not_spam", "ids": ["id"], "path": "comments//not_spam.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "comments.json"}, + {"http_method": "post", "operation": "remove", "ids": ["id"], "path": "comments//remove.json"}, + {"http_method": "post", "operation": "restore", "ids": ["id"], "path": "comments//restore.json"}, + {"http_method": "post", "operation": "spam", "ids": ["id"], "path": "comments//spam.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "comments/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "comment", + "plural": "comments" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + fields = null, + published_status = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "fields": fields, "published_status": published_status, "status": status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async approve( + { + body = null, + ...otherArgs + }: ApproveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "approve", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async not_spam( + { + body = null, + ...otherArgs + }: NotSpamArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "not_spam", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async remove( + { + body = null, + ...otherArgs + }: RemoveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "remove", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async restore( + { + body = null, + ...otherArgs + }: RestoreArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "restore", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async spam( + { + body = null, + ...otherArgs + }: SpamArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "spam", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public article_id: number | null; + public author: string | null; + public blog_id: number | null; + public body: string | null; + public body_html: string | null; + public created_at: string | null; + public email: string | null; + public id: number | null; + public ip: string | null; + public published_at: string | null; + public status: string | null; + public updated_at: string | null; + public user_agent: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/country.ts b/packages/shopify-api/rest/admin/2024-04/country.ts new file mode 100644 index 000000000..3fa1a1ca8 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/country.ts @@ -0,0 +1,127 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Province} from './province'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Country extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "provinces": Province + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "countries/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "countries/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "countries.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "countries/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "countries.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "countries/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "country", + "plural": "countries" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public code: string | null; + public id: number | null; + public name: string | null; + public provinces: Province[] | null | {[key: string]: any}; + public tax: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/currency.ts b/packages/shopify-api/rest/admin/2024-04/currency.ts new file mode 100644 index 000000000..2929bd8fe --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/currency.ts @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Currency extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "currencies.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "currency", + "plural": "currencies" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public currency: string | null; + public rate_updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/custom_collection.ts b/packages/shopify-api/rest/admin/2024-04/custom_collection.ts new file mode 100644 index 000000000..1e0a0f399 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/custom_collection.ts @@ -0,0 +1,163 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + ids?: unknown; + since_id?: unknown; + title?: unknown; + product_id?: unknown; + handle?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + product_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class CustomCollection extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "custom_collections/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "custom_collections/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "custom_collections.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "custom_collections/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "custom_collections.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "custom_collections/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "custom_collection", + "plural": "custom_collections" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ids = null, + since_id = null, + title = null, + product_id = null, + handle = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "ids": ids, "since_id": since_id, "title": title, "product_id": product_id, "handle": handle, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + product_id = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "product_id": product_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public published: boolean | null; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/customer.ts b/packages/shopify-api/rest/admin/2024-04/customer.ts new file mode 100644 index 000000000..7dc9d36dc --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/customer.ts @@ -0,0 +1,281 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + limit?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface OrdersArgs { + [key: string]: unknown; + session: Session; + id: number | string; + status?: unknown; +} +interface SearchArgs { + [key: string]: unknown; + session: Session; + order?: unknown; + query?: unknown; + limit?: unknown; + fields?: unknown; + returnFullResponse?: boolean; +} +interface AccountActivationUrlArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SendInviteArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Customer extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "metafield": Metafield + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "customers/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "customers/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "customers.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "customers/.json"}, + {"http_method": "get", "operation": "orders", "ids": ["id"], "path": "customers//orders.json"}, + {"http_method": "get", "operation": "search", "ids": [], "path": "customers/search.json"}, + {"http_method": "post", "operation": "account_activation_url", "ids": ["id"], "path": "customers//account_activation_url.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "customers.json"}, + {"http_method": "post", "operation": "send_invite", "ids": ["id"], "path": "customers//send_invite.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "customers/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "customer", + "plural": "customers" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + limit = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "limit": limit, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async orders( + { + session, + id, + status = null, + ...otherArgs + }: OrdersArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "orders", + session: session, + urlIds: {"id": id}, + params: {"status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async search( + { + session, + order = null, + query = null, + limit = null, + fields = null, + returnFullResponse = false, + ...otherArgs + }: SearchArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "search", + session: session, + urlIds: {}, + params: {"order": order, "query": query, "limit": limit, "fields": fields, ...otherArgs}, + body: {}, + entity: null, + }); + + return returnFullResponse ? response : response?.body; + } + + public async account_activation_url( + { + body = null, + ...otherArgs + }: AccountActivationUrlArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "account_activation_url", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async send_invite( + { + body = null, + ...otherArgs + }: SendInviteArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "send_invite", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public accepts_marketing: boolean | null; + public accepts_marketing_updated_at: string | null; + public addresses: {[key: string]: unknown}[] | null; + public created_at: string | null; + public currency: string | null; + public default_address: {[key: string]: unknown} | null; + public email: string | null; + public email_marketing_consent: {[key: string]: unknown} | null; + public first_name: string | null; + public id: number | null; + public last_name: string | null; + public last_order_id: number | null; + public last_order_name: string | null; + public marketing_opt_in_level: string | null; + public metafield: Metafield | null | {[key: string]: any}; + public multipass_identifier: string | null; + public note: string | null; + public orders_count: number | null; + public password: string | null; + public password_confirmation: string | null; + public phone: string | null; + public sms_marketing_consent: {[key: string]: unknown} | null; + public state: string | null; + public tags: string | null; + public tax_exempt: boolean | null; + public tax_exemptions: string[] | null; + public total_spent: string | null; + public updated_at: string | null; + public verified_email: boolean | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/customer_address.ts b/packages/shopify-api/rest/admin/2024-04/customer_address.ts new file mode 100644 index 000000000..9c2705a45 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/customer_address.ts @@ -0,0 +1,171 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + customer_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + customer_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + customer_id?: number | string | null; +} +interface DefaultArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetArgs { + [key: string]: unknown; + address_ids?: unknown[] | number | string | null; + operation?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class CustomerAddress extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//addresses.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//addresses.json"}, + {"http_method": "put", "operation": "default", "ids": ["customer_id", "id"], "path": "customers//addresses//default.json"}, + {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "put", "operation": "set", "ids": ["customer_id"], "path": "customers//addresses/set.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "customer_address", + "plural": "customer_addresses" + }, + { + "singular": "address", + "plural": "addresses" + } + ]; + + protected static getJsonBodyName(): string + { + return "address"; + } + + public static async find( + { + session, + id, + customer_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "customer_id": customer_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + customer_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "customer_id": customer_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + customer_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"customer_id": customer_id}, + params: {...otherArgs}, + }); + + return response; + } + + public async default( + { + body = null, + ...otherArgs + }: DefaultArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "default", + session: this.session, + urlIds: {"id": this.id, "customer_id": this.customer_id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set( + { + address_ids = null, + operation = null, + body = null, + ...otherArgs + }: SetArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "set", + session: this.session, + urlIds: {"customer_id": this.customer_id}, + params: {"address_ids": address_ids, "operation": operation, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public address1: string | null; + public address2: string | null; + public city: string | null; + public company: string | null; + public country: string | null; + public country_code: string | null; + public country_name: string | null; + public customer_id: number | null; + public first_name: string | null; + public id: number | null; + public last_name: string | null; + public name: string | null; + public phone: string | null; + public province: string | null; + public province_code: string | null; + public zip: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/deprecated_api_call.ts b/packages/shopify-api/rest/admin/2024-04/deprecated_api_call.ts new file mode 100644 index 000000000..baa72d52c --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/deprecated_api_call.ts @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class DeprecatedApiCall extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "deprecated_api_calls.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "deprecated_api_call", + "plural": "deprecated_api_calls" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public data_updated_at: string | null; + public deprecated_api_calls: {[key: string]: unknown}[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/discount_code.ts b/packages/shopify-api/rest/admin/2024-04/discount_code.ts new file mode 100644 index 000000000..f0ff236af --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/discount_code.ts @@ -0,0 +1,212 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + price_rule_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + price_rule_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + price_rule_id?: number | string | null; + batch_id?: number | string | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + times_used?: unknown; + times_used_min?: unknown; + times_used_max?: unknown; +} +interface GetAllArgs { + [key: string]: unknown; + session: Session; + price_rule_id?: number | string | null; + batch_id?: number | string | null; +} +interface LookupArgs { + [key: string]: unknown; + session: Session; + code?: unknown; +} +interface BatchArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class DiscountCode extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "discount_codes/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id", "batch_id"], "path": "price_rules//batch//discount_codes.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id"], "path": "price_rules//discount_codes.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"}, + {"http_method": "get", "operation": "get_all", "ids": ["price_rule_id", "batch_id"], "path": "price_rules//batch/.json"}, + {"http_method": "get", "operation": "lookup", "ids": [], "path": "discount_codes/lookup.json"}, + {"http_method": "post", "operation": "batch", "ids": ["price_rule_id"], "path": "price_rules//batch.json"}, + {"http_method": "post", "operation": "post", "ids": ["price_rule_id"], "path": "price_rules//discount_codes.json"}, + {"http_method": "put", "operation": "put", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "discount_code", + "plural": "discount_codes" + } + ]; + + public static async find( + { + session, + id, + price_rule_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "price_rule_id": price_rule_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + price_rule_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "price_rule_id": price_rule_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + price_rule_id = null, + batch_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"price_rule_id": price_rule_id, "batch_id": batch_id}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + times_used = null, + times_used_min = null, + times_used_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"times_used": times_used, "times_used_min": times_used_min, "times_used_max": times_used_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async get_all( + { + session, + price_rule_id = null, + batch_id = null, + ...otherArgs + }: GetAllArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "get_all", + session: session, + urlIds: {"price_rule_id": price_rule_id, "batch_id": batch_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async lookup( + { + session, + code = null, + ...otherArgs + }: LookupArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "lookup", + session: session, + urlIds: {}, + params: {"code": code, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async batch( + { + body = null, + ...otherArgs + }: BatchArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "batch", + session: this.session, + urlIds: {"price_rule_id": this.price_rule_id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public code: string | null; + public created_at: string | null; + public errors: {[key: string]: unknown} | null; + public id: number | null; + public price_rule_id: number | null; + public updated_at: string | null; + public usage_count: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/dispute.ts b/packages/shopify-api/rest/admin/2024-04/dispute.ts new file mode 100644 index 000000000..42d390bef --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/dispute.ts @@ -0,0 +1,83 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + status?: unknown; + initiated_at?: unknown; +} + +export class Dispute extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/disputes.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "shopify_payments/disputes/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "dispute", + "plural": "disputes" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + since_id = null, + last_id = null, + status = null, + initiated_at = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "status": status, "initiated_at": initiated_at, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public evidence_due_by: string | null; + public evidence_sent_on: string | null; + public finalized_on: string | null; + public id: number | null; + public network_reason_code: string | null; + public order_id: number | null; + public reason: string | null; + public status: string | null; + public type: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/dispute_evidence.ts b/packages/shopify-api/rest/admin/2024-04/dispute_evidence.ts new file mode 100644 index 000000000..ef2144f22 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/dispute_evidence.ts @@ -0,0 +1,69 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Fulfillment} from './fulfillment'; + +interface FindArgs { + session: Session; + dispute_id: number | string; +} + +export class DisputeEvidence extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "fulfillments": Fulfillment + }; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["dispute_id"], "path": "shopify_payments/disputes//dispute_evidences.json"}, + {"http_method": "put", "operation": "put", "ids": ["dispute_id"], "path": "shopify_payments/disputes//dispute_evidences.json"} + ]; + protected static primaryKey: string = "dispute_id"; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "dispute_evidence", + "plural": "dispute_evidences" + } + ]; + + public static async find( + { + session, + dispute_id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"dispute_id": dispute_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public access_activity_log: string | null; + public billing_address: {[key: string]: unknown} | null; + public cancellation_policy_disclosure: string | null; + public cancellation_rebuttal: string | null; + public created_at: string | null; + public customer_email_address: string | null; + public customer_first_name: string | null; + public customer_last_name: string | null; + public dispute_evidence_files: {[key: string]: unknown} | null; + public fulfillments: Fulfillment[] | null | {[key: string]: any}; + public id: number | null; + public payments_dispute_id: number | null; + public product_description: {[key: string]: unknown} | null; + public refund_policy_disclosure: string | null; + public refund_refusal_explanation: string | null; + public shipping_address: {[key: string]: unknown} | null; + public submitted: boolean | null; + public uncategorized_text: string | null; + public updated_on: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/dispute_file_upload.ts b/packages/shopify-api/rest/admin/2024-04/dispute_file_upload.ts new file mode 100644 index 000000000..a55d5566d --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/dispute_file_upload.ts @@ -0,0 +1,59 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + id: number | string; + dispute_id?: number | string | null; +} + +export class DisputeFileUpload extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["dispute_id", "id"], "path": "shopify_payments/disputes//dispute_file_uploads/.json"}, + {"http_method": "post", "operation": "post", "ids": ["dispute_id"], "path": "shopify_payments/disputes//dispute_file_uploads.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "dispute_file_upload", + "plural": "dispute_file_uploads" + } + ]; + + public static async delete( + { + session, + id, + dispute_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "dispute_id": dispute_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public dispute_evidence_id: number | null; + public dispute_evidence_type: string | null; + public file_size: number | null; + public file_type: string | null; + public filename: string | null; + public id: number | null; + public original_filename: string | null; + public shop_id: number | null; + public url: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/draft_order.ts b/packages/shopify-api/rest/admin/2024-04/draft_order.ts new file mode 100644 index 000000000..b73d9e666 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/draft_order.ts @@ -0,0 +1,221 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Customer} from './customer'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + ids?: unknown; + status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + status?: unknown; + updated_at_max?: unknown; + updated_at_min?: unknown; +} +interface SendInvoiceArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface CompleteArgs { + [key: string]: unknown; + payment_gateway_id?: unknown; + payment_pending?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class DraftOrder extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "customer": Customer + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "draft_orders/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "draft_orders/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "draft_orders.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "draft_orders/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "draft_orders.json"}, + {"http_method": "post", "operation": "send_invoice", "ids": ["id"], "path": "draft_orders//send_invoice.json"}, + {"http_method": "put", "operation": "complete", "ids": ["id"], "path": "draft_orders//complete.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "draft_orders/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "draft_order", + "plural": "draft_orders" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + fields = null, + limit = null, + since_id = null, + updated_at_min = null, + updated_at_max = null, + ids = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, "limit": limit, "since_id": since_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "ids": ids, "status": status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + since_id = null, + status = null, + updated_at_max = null, + updated_at_min = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"since_id": since_id, "status": status, "updated_at_max": updated_at_max, "updated_at_min": updated_at_min, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async send_invoice( + { + body = null, + ...otherArgs + }: SendInvoiceArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "send_invoice", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async complete( + { + payment_gateway_id = null, + payment_pending = null, + body = null, + ...otherArgs + }: CompleteArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "complete", + session: this.session, + urlIds: {"id": this.id}, + params: {"payment_gateway_id": payment_gateway_id, "payment_pending": payment_pending, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public applied_discount: {[key: string]: unknown} | null; + public billing_address: {[key: string]: unknown} | null; + public completed_at: string | null; + public created_at: string | null; + public currency: string | null; + public customer: Customer | null | {[key: string]: any}; + public email: string | null; + public id: number | null; + public invoice_sent_at: string | null; + public invoice_url: string | null; + public line_items: {[key: string]: unknown}[] | null; + public name: string | null; + public note: string | null; + public note_attributes: {[key: string]: unknown}[] | null; + public order_id: number | null; + public payment_terms: {[key: string]: unknown} | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_line: {[key: string]: unknown} | null; + public source_name: string | null; + public status: string | null; + public subtotal_price: string | null; + public tags: string | null; + public tax_exempt: boolean | null; + public tax_exemptions: string[] | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public total_price: string | null; + public total_tax: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/event.ts b/packages/shopify-api/rest/admin/2024-04/event.ts new file mode 100644 index 000000000..7f90dae10 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/event.ts @@ -0,0 +1,124 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + product_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + filter?: unknown; + verb?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; +} + +export class Event extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "events/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "events.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "events/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//events.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//events.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "event", + "plural": "events" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + order_id = null, + product_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + filter = null, + verb = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id, "product_id": product_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "filter": filter, "verb": verb, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public arguments: string[] | null; + public body: string | null; + public created_at: string | null; + public description: string | null; + public id: number | null; + public message: string | null; + public path: string | null; + public subject_id: number | null; + public subject_type: string | null; + public verb: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/fulfillment.ts b/packages/shopify-api/rest/admin/2024-04/fulfillment.ts new file mode 100644 index 000000000..b2b277d4c --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/fulfillment.ts @@ -0,0 +1,193 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fulfillment_order_id?: number | string | null; + order_id?: number | string | null; + created_at_max?: unknown; + created_at_min?: unknown; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + updated_at_max?: unknown; + updated_at_min?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface CancelArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface UpdateTrackingArgs { + [key: string]: unknown; + notify_customer?: unknown; + tracking_info?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Fulfillment extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//fulfillments/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillments.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//fulfillments.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//fulfillments/.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "fulfillments//cancel.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "fulfillments.json"}, + {"http_method": "post", "operation": "update_tracking", "ids": ["id"], "path": "fulfillments//update_tracking.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "fulfillment", + "plural": "fulfillments" + } + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + fulfillment_order_id = null, + order_id = null, + created_at_max = null, + created_at_min = null, + fields = null, + limit = null, + since_id = null, + updated_at_max = null, + updated_at_min = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"fulfillment_order_id": fulfillment_order_id, "order_id": order_id}, + params: {"created_at_max": created_at_max, "created_at_min": created_at_min, "fields": fields, "limit": limit, "since_id": since_id, "updated_at_max": updated_at_max, "updated_at_min": updated_at_min, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + order_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"order_id": order_id}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async cancel( + { + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async update_tracking( + { + notify_customer = null, + tracking_info = null, + body = null, + ...otherArgs + }: UpdateTrackingArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "update_tracking", + session: this.session, + urlIds: {"id": this.id}, + params: {"notify_customer": notify_customer, "tracking_info": tracking_info, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public id: number | null; + public line_items: {[key: string]: unknown}[] | null; + public location_id: number | null; + public name: string | null; + public notify_customer: boolean | null; + public order_id: number | null; + public origin_address: {[key: string]: unknown}[] | null; + public receipt: {[key: string]: unknown} | null; + public service: string | null; + public shipment_status: string | null; + public status: string | null; + public tracking_company: string | null; + public tracking_number: string | null; + public tracking_numbers: string[] | null; + public tracking_url: string | null; + public tracking_urls: string[] | null; + public updated_at: string | null; + public variant_inventory_management: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/fulfillment_event.ts b/packages/shopify-api/rest/admin/2024-04/fulfillment_event.ts new file mode 100644 index 000000000..c43f6fafa --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/fulfillment_event.ts @@ -0,0 +1,129 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Country} from './country'; +import {Province} from './province'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fulfillment_id?: number | string | null; + event_id?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fulfillment_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + fulfillment_id?: number | string | null; +} + +export class FulfillmentEvent extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "country": Country, + "province": Province + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "fulfillment_id", "id"], "path": "orders//fulfillments//events/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "fulfillment_id"], "path": "orders//fulfillments//events.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "fulfillment_id", "id"], "path": "orders//fulfillments//events/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id", "fulfillment_id"], "path": "orders//fulfillments//events.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "fulfillment_event", + "plural": "fulfillment_events" + } + ]; + + protected static getJsonBodyName(): string + { + return "event"; + } + + public static async find( + { + session, + id, + order_id = null, + fulfillment_id = null, + event_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {"event_id": event_id}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + order_id = null, + fulfillment_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + order_id = null, + fulfillment_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {...otherArgs}, + }); + + return response; + } + + public address1: string | null; + public city: string | null; + public country: Country | null | {[key: string]: any}; + public created_at: string | null; + public estimated_delivery_at: string | null; + public fulfillment_id: number | null; + public happened_at: string | null; + public id: number | null; + public latitude: number | null; + public longitude: number | null; + public message: string | null; + public order_id: number | null; + public province: Province | null | {[key: string]: any}; + public shop_id: number | null; + public status: string | null; + public updated_at: string | null; + public zip: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/fulfillment_order.ts b/packages/shopify-api/rest/admin/2024-04/fulfillment_order.ts new file mode 100644 index 000000000..8ccc08365 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/fulfillment_order.ts @@ -0,0 +1,296 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + include_financial_summaries?: unknown; + include_order_reference_fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + include_financial_summaries?: unknown; + include_order_reference_fields?: unknown; +} +interface CancelArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface CloseArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface HoldArgs { + [key: string]: unknown; + fulfillment_hold?: unknown; + body?: {[key: string]: unknown} | null; +} +interface MoveArgs { + [key: string]: unknown; + fulfillment_order?: unknown; + body?: {[key: string]: unknown} | null; +} +interface OpenArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface ReleaseHoldArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RescheduleArgs { + [key: string]: unknown; + new_fulfill_at?: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetFulfillmentOrdersDeadlineArgs { + [key: string]: unknown; + fulfillment_order_ids?: unknown; + fulfillment_deadline?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class FulfillmentOrder extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "fulfillment_orders/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//fulfillment_orders.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "fulfillment_orders//cancel.json"}, + {"http_method": "post", "operation": "close", "ids": ["id"], "path": "fulfillment_orders//close.json"}, + {"http_method": "post", "operation": "hold", "ids": ["id"], "path": "fulfillment_orders//hold.json"}, + {"http_method": "post", "operation": "move", "ids": ["id"], "path": "fulfillment_orders//move.json"}, + {"http_method": "post", "operation": "open", "ids": ["id"], "path": "fulfillment_orders//open.json"}, + {"http_method": "post", "operation": "release_hold", "ids": ["id"], "path": "fulfillment_orders//release_hold.json"}, + {"http_method": "post", "operation": "reschedule", "ids": ["id"], "path": "fulfillment_orders//reschedule.json"}, + {"http_method": "post", "operation": "set_fulfillment_orders_deadline", "ids": [], "path": "fulfillment_orders/set_fulfillment_orders_deadline.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "fulfillment_order", + "plural": "fulfillment_orders" + } + ]; + + public static async find( + { + session, + id, + include_financial_summaries = null, + include_order_reference_fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"include_financial_summaries": include_financial_summaries, "include_order_reference_fields": include_order_reference_fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + order_id = null, + include_financial_summaries = null, + include_order_reference_fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {"include_financial_summaries": include_financial_summaries, "include_order_reference_fields": include_order_reference_fields, ...otherArgs}, + }); + + return response; + } + + public async cancel( + { + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async close( + { + message = null, + body = null, + ...otherArgs + }: CloseArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "close", + session: this.session, + urlIds: {"id": this.id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async hold( + { + fulfillment_hold = null, + body = null, + ...otherArgs + }: HoldArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "hold", + session: this.session, + urlIds: {"id": this.id}, + params: {"fulfillment_hold": fulfillment_hold, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async move( + { + fulfillment_order = null, + body = null, + ...otherArgs + }: MoveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "move", + session: this.session, + urlIds: {"id": this.id}, + params: {"fulfillment_order": fulfillment_order, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async open( + { + body = null, + ...otherArgs + }: OpenArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "open", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async release_hold( + { + body = null, + ...otherArgs + }: ReleaseHoldArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "release_hold", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reschedule( + { + new_fulfill_at = null, + body = null, + ...otherArgs + }: RescheduleArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reschedule", + session: this.session, + urlIds: {"id": this.id}, + params: {"new_fulfill_at": new_fulfill_at, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set_fulfillment_orders_deadline( + { + fulfillment_order_ids = null, + fulfillment_deadline = null, + body = null, + ...otherArgs + }: SetFulfillmentOrdersDeadlineArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "set_fulfillment_orders_deadline", + session: this.session, + urlIds: {}, + params: {"fulfillment_order_ids": fulfillment_order_ids, "fulfillment_deadline": fulfillment_deadline, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public assigned_location: {[key: string]: unknown} | null; + public assigned_location_id: number | null; + public created_at: string | null; + public delivery_method: {[key: string]: unknown} | null; + public destination: {[key: string]: unknown} | null; + public fulfill_at: string | null; + public fulfill_by: string | null; + public fulfillment_holds: {[key: string]: unknown}[] | null; + public id: number | null; + public international_duties: {[key: string]: unknown} | null; + public line_items: {[key: string]: unknown}[] | null; + public merchant_requests: {[key: string]: unknown}[] | null; + public order_id: number | null; + public request_status: string | null; + public shop_id: number | null; + public status: string | null; + public supported_actions: string[] | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/fulfillment_request.ts b/packages/shopify-api/rest/admin/2024-04/fulfillment_request.ts new file mode 100644 index 000000000..66740d705 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/fulfillment_request.ts @@ -0,0 +1,86 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {ApiVersion} from '../../../lib/types'; + +interface AcceptArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface RejectArgs { + [key: string]: unknown; + message?: unknown; + reason?: unknown; + line_items?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class FulfillmentRequest extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "post", "operation": "accept", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request/accept.json"}, + {"http_method": "post", "operation": "post", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request.json"}, + {"http_method": "post", "operation": "reject", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request/reject.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "submitted_fulfillment_order", + "plural": "submitted_fulfillment_orders" + }, + { + "singular": "fulfillment_order", + "plural": "fulfillment_orders" + } + ]; + + public async accept( + { + message = null, + body = null, + ...otherArgs + }: AcceptArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "accept", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reject( + { + message = null, + reason = null, + line_items = null, + body = null, + ...otherArgs + }: RejectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reject", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, "reason": reason, "line_items": line_items, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public fulfillment_order_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/fulfillment_service.ts b/packages/shopify-api/rest/admin/2024-04/fulfillment_service.ts new file mode 100644 index 000000000..52ac30391 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/fulfillment_service.ts @@ -0,0 +1,102 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + scope?: unknown; +} + +export class FulfillmentService extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "fulfillment_services/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "fulfillment_services.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "fulfillment_services/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "fulfillment_services.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "fulfillment_services/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "fulfillment_service", + "plural": "fulfillment_services" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + scope = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"scope": scope, ...otherArgs}, + }); + + return response; + } + + public admin_graphql_api_id: string | null; + public callback_url: string | null; + public fulfillment_orders_opt_in: boolean | null; + public handle: string | null; + public id: number | null; + public inventory_management: boolean | null; + public location_id: number | null; + public name: string | null; + public permits_sku_sharing: boolean | null; + public provider_id: string | null; + public requires_shipping_method: boolean | null; + public tracking_support: boolean | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/gift_card.ts b/packages/shopify-api/rest/admin/2024-04/gift_card.ts new file mode 100644 index 000000000..ea9e87115 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/gift_card.ts @@ -0,0 +1,183 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + status?: unknown; + limit?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + status?: unknown; +} +interface SearchArgs { + [key: string]: unknown; + session: Session; + order?: unknown; + query?: unknown; + limit?: unknown; + fields?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + returnFullResponse?: boolean; +} +interface DisableArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class GiftCard extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "gift_cards.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "gift_cards/.json"}, + {"http_method": "get", "operation": "search", "ids": [], "path": "gift_cards/search.json"}, + {"http_method": "post", "operation": "disable", "ids": ["id"], "path": "gift_cards//disable.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "gift_cards.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "gift_cards/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "gift_card", + "plural": "gift_cards" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + status = null, + limit = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"status": status, "limit": limit, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async search( + { + session, + order = null, + query = null, + limit = null, + fields = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + returnFullResponse = false, + ...otherArgs + }: SearchArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "search", + session: session, + urlIds: {}, + params: {"order": order, "query": query, "limit": limit, "fields": fields, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return returnFullResponse ? response : response?.body; + } + + public async disable( + { + body = null, + ...otherArgs + }: DisableArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "disable", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public api_client_id: number | null; + public balance: string | null; + public code: string | null; + public created_at: string | null; + public currency: string | null; + public customer_id: number | null; + public disabled_at: string | null; + public expires_on: string | null; + public id: number | null; + public initial_value: string | null; + public last_characters: string | null; + public line_item_id: number | null; + public note: string | null; + public order_id: number | null; + public template_suffix: string | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/gift_card_adjustment.ts b/packages/shopify-api/rest/admin/2024-04/gift_card_adjustment.ts new file mode 100644 index 000000000..ed1e57424 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/gift_card_adjustment.ts @@ -0,0 +1,86 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + gift_card_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + gift_card_id?: number | string | null; +} + +export class GiftCardAdjustment extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["gift_card_id"], "path": "gift_cards//adjustments.json"}, + {"http_method": "get", "operation": "get", "ids": ["gift_card_id", "id"], "path": "gift_cards//adjustments/.json"}, + {"http_method": "post", "operation": "post", "ids": ["gift_card_id"], "path": "gift_cards//adjustments.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "gift_card_adjustment", + "plural": "gift_card_adjustments" + } + ]; + + protected static getJsonBodyName(): string + { + return "adjustment"; + } + + public static async find( + { + session, + id, + gift_card_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "gift_card_id": gift_card_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + gift_card_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"gift_card_id": gift_card_id}, + params: {...otherArgs}, + }); + + return response; + } + + public amount: number | null; + public api_client_id: number | null; + public created_at: string | null; + public gift_card_id: number | null; + public id: number | null; + public note: string | null; + public number: number | null; + public order_transaction_id: number | null; + public processed_at: string | null; + public remote_transaction_ref: string | null; + public remote_transaction_url: string | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/image.ts b/packages/shopify-api/rest/admin/2024-04/image.ts new file mode 100644 index 000000000..0c8e39deb --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/image.ts @@ -0,0 +1,137 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + product_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + product_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + since_id?: unknown; +} + +export class Image extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//images/.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//images/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//images.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//images/.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//images.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id", "id"], "path": "products//images/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "image", + "plural": "images" + } + ]; + + public static async find( + { + session, + id, + product_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + product_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_id = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + product_id = null, + since_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"product_id": product_id}, + params: {"since_id": since_id, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public height: number | null; + public id: number | null; + public position: number | null; + public product_id: number | null; + public src: string | null; + public updated_at: string | null; + public variant_ids: number[] | null; + public width: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/index.ts b/packages/shopify-api/rest/admin/2024-04/index.ts new file mode 100644 index 000000000..727301a9f --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/index.ts @@ -0,0 +1,231 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {ShopifyRestResources} from '../../types'; + +import {AbandonedCheckout} from './abandoned_checkout'; +import {AccessScope} from './access_scope'; +import {ApplePayCertificate} from './apple_pay_certificate'; +import {ApplicationCharge} from './application_charge'; +import {ApplicationCredit} from './application_credit'; +import {Article} from './article'; +import {Asset} from './asset'; +import {AssignedFulfillmentOrder} from './assigned_fulfillment_order'; +import {Balance} from './balance'; +import {Blog} from './blog'; +import {CancellationRequest} from './cancellation_request'; +import {CarrierService} from './carrier_service'; +import {Checkout} from './checkout'; +import {Collect} from './collect'; +import {Collection} from './collection'; +import {CollectionListing} from './collection_listing'; +import {Comment} from './comment'; +import {Country} from './country'; +import {Currency} from './currency'; +import {CustomCollection} from './custom_collection'; +import {Customer} from './customer'; +import {CustomerAddress} from './customer_address'; +import {DeprecatedApiCall} from './deprecated_api_call'; +import {DiscountCode} from './discount_code'; +import {Dispute} from './dispute'; +import {DisputeEvidence} from './dispute_evidence'; +import {DisputeFileUpload} from './dispute_file_upload'; +import {DraftOrder} from './draft_order'; +import {Event} from './event'; +import {Fulfillment} from './fulfillment'; +import {FulfillmentEvent} from './fulfillment_event'; +import {FulfillmentOrder} from './fulfillment_order'; +import {FulfillmentRequest} from './fulfillment_request'; +import {FulfillmentService} from './fulfillment_service'; +import {GiftCard} from './gift_card'; +import {GiftCardAdjustment} from './gift_card_adjustment'; +import {Image} from './image'; +import {InventoryItem} from './inventory_item'; +import {InventoryLevel} from './inventory_level'; +import {Location} from './location'; +import {LocationsForMove} from './locations_for_move'; +import {MarketingEvent} from './marketing_event'; +import {Metafield} from './metafield'; +import {MobilePlatformApplication} from './mobile_platform_application'; +import {Order} from './order'; +import {OrderRisk} from './order_risk'; +import {Page} from './page'; +import {Payment} from './payment'; +import {PaymentGateway} from './payment_gateway'; +import {PaymentTransaction} from './payment_transaction'; +import {Payout} from './payout'; +import {Policy} from './policy'; +import {PriceRule} from './price_rule'; +import {Product} from './product'; +import {ProductListing} from './product_listing'; +import {ProductResourceFeedback} from './product_resource_feedback'; +import {Province} from './province'; +import {RecurringApplicationCharge} from './recurring_application_charge'; +import {Redirect} from './redirect'; +import {Refund} from './refund'; +import {ResourceFeedback} from './resource_feedback'; +import {ScriptTag} from './script_tag'; +import {ShippingZone} from './shipping_zone'; +import {Shop} from './shop'; +import {SmartCollection} from './smart_collection'; +import {StorefrontAccessToken} from './storefront_access_token'; +import {TenderTransaction} from './tender_transaction'; +import {Theme} from './theme'; +import {Transaction} from './transaction'; +import {UsageCharge} from './usage_charge'; +import {User} from './user'; +import {Variant} from './variant'; +import {Webhook} from './webhook'; + +export interface RestResources extends ShopifyRestResources { + AbandonedCheckout: typeof AbandonedCheckout; + AccessScope: typeof AccessScope; + ApplePayCertificate: typeof ApplePayCertificate; + ApplicationCharge: typeof ApplicationCharge; + ApplicationCredit: typeof ApplicationCredit; + Article: typeof Article; + Asset: typeof Asset; + AssignedFulfillmentOrder: typeof AssignedFulfillmentOrder; + Balance: typeof Balance; + Blog: typeof Blog; + CancellationRequest: typeof CancellationRequest; + CarrierService: typeof CarrierService; + Checkout: typeof Checkout; + Collect: typeof Collect; + Collection: typeof Collection; + CollectionListing: typeof CollectionListing; + Comment: typeof Comment; + Country: typeof Country; + Currency: typeof Currency; + CustomCollection: typeof CustomCollection; + Customer: typeof Customer; + CustomerAddress: typeof CustomerAddress; + DeprecatedApiCall: typeof DeprecatedApiCall; + DiscountCode: typeof DiscountCode; + Dispute: typeof Dispute; + DisputeEvidence: typeof DisputeEvidence; + DisputeFileUpload: typeof DisputeFileUpload; + DraftOrder: typeof DraftOrder; + Event: typeof Event; + Fulfillment: typeof Fulfillment; + FulfillmentEvent: typeof FulfillmentEvent; + FulfillmentOrder: typeof FulfillmentOrder; + FulfillmentRequest: typeof FulfillmentRequest; + FulfillmentService: typeof FulfillmentService; + GiftCard: typeof GiftCard; + GiftCardAdjustment: typeof GiftCardAdjustment; + Image: typeof Image; + InventoryItem: typeof InventoryItem; + InventoryLevel: typeof InventoryLevel; + Location: typeof Location; + LocationsForMove: typeof LocationsForMove; + MarketingEvent: typeof MarketingEvent; + Metafield: typeof Metafield; + MobilePlatformApplication: typeof MobilePlatformApplication; + Order: typeof Order; + OrderRisk: typeof OrderRisk; + Page: typeof Page; + Payment: typeof Payment; + PaymentGateway: typeof PaymentGateway; + PaymentTransaction: typeof PaymentTransaction; + Payout: typeof Payout; + Policy: typeof Policy; + PriceRule: typeof PriceRule; + Product: typeof Product; + ProductListing: typeof ProductListing; + ProductResourceFeedback: typeof ProductResourceFeedback; + Province: typeof Province; + RecurringApplicationCharge: typeof RecurringApplicationCharge; + Redirect: typeof Redirect; + Refund: typeof Refund; + ResourceFeedback: typeof ResourceFeedback; + ScriptTag: typeof ScriptTag; + ShippingZone: typeof ShippingZone; + Shop: typeof Shop; + SmartCollection: typeof SmartCollection; + StorefrontAccessToken: typeof StorefrontAccessToken; + TenderTransaction: typeof TenderTransaction; + Theme: typeof Theme; + Transaction: typeof Transaction; + UsageCharge: typeof UsageCharge; + User: typeof User; + Variant: typeof Variant; + Webhook: typeof Webhook; +} + +export const restResources: RestResources = { + AbandonedCheckout, + AccessScope, + ApplePayCertificate, + ApplicationCharge, + ApplicationCredit, + Article, + Asset, + AssignedFulfillmentOrder, + Balance, + Blog, + CancellationRequest, + CarrierService, + Checkout, + Collect, + Collection, + CollectionListing, + Comment, + Country, + Currency, + CustomCollection, + Customer, + CustomerAddress, + DeprecatedApiCall, + DiscountCode, + Dispute, + DisputeEvidence, + DisputeFileUpload, + DraftOrder, + Event, + Fulfillment, + FulfillmentEvent, + FulfillmentOrder, + FulfillmentRequest, + FulfillmentService, + GiftCard, + GiftCardAdjustment, + Image, + InventoryItem, + InventoryLevel, + Location, + LocationsForMove, + MarketingEvent, + Metafield, + MobilePlatformApplication, + Order, + OrderRisk, + Page, + Payment, + PaymentGateway, + PaymentTransaction, + Payout, + Policy, + PriceRule, + Product, + ProductListing, + ProductResourceFeedback, + Province, + RecurringApplicationCharge, + Redirect, + Refund, + ResourceFeedback, + ScriptTag, + ShippingZone, + Shop, + SmartCollection, + StorefrontAccessToken, + TenderTransaction, + Theme, + Transaction, + UsageCharge, + User, + Variant, + Webhook, +}; diff --git a/packages/shopify-api/rest/admin/2024-04/inventory_item.ts b/packages/shopify-api/rest/admin/2024-04/inventory_item.ts new file mode 100644 index 000000000..2bd0ab312 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/inventory_item.ts @@ -0,0 +1,80 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; +} + +export class InventoryItem extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "inventory_items.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "inventory_items/.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "inventory_items/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "inventory_item", + "plural": "inventory_items" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, ...otherArgs}, + }); + + return response; + } + + public cost: string | null; + public country_code_of_origin: string | null; + public country_harmonized_system_codes: {[key: string]: unknown}[] | null; + public created_at: string | null; + public harmonized_system_code: number | null; + public id: number | null; + public province_code_of_origin: string | null; + public requires_shipping: boolean | null; + public sku: string | null; + public tracked: boolean | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/inventory_level.ts b/packages/shopify-api/rest/admin/2024-04/inventory_level.ts new file mode 100644 index 000000000..18a86fbb5 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/inventory_level.ts @@ -0,0 +1,173 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + inventory_item_id?: unknown; + location_id?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + inventory_item_ids?: unknown; + location_ids?: unknown; + limit?: unknown; + updated_at_min?: unknown; +} +interface AdjustArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + available_adjustment?: unknown; + body?: {[key: string]: unknown} | null; +} +interface ConnectArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + relocate_if_necessary?: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + available?: unknown; + disconnect_if_necessary?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class InventoryLevel extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": [], "path": "inventory_levels.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "inventory_levels.json"}, + {"http_method": "post", "operation": "adjust", "ids": [], "path": "inventory_levels/adjust.json"}, + {"http_method": "post", "operation": "connect", "ids": [], "path": "inventory_levels/connect.json"}, + {"http_method": "post", "operation": "set", "ids": [], "path": "inventory_levels/set.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "inventory_level", + "plural": "inventory_levels" + } + ]; + + public static async delete( + { + session, + inventory_item_id = null, + location_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + inventory_item_ids = null, + location_ids = null, + limit = null, + updated_at_min = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"inventory_item_ids": inventory_item_ids, "location_ids": location_ids, "limit": limit, "updated_at_min": updated_at_min, ...otherArgs}, + }); + + return response; + } + + public async adjust( + { + inventory_item_id = null, + location_id = null, + available_adjustment = null, + body = null, + ...otherArgs + }: AdjustArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "adjust", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "available_adjustment": available_adjustment, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async connect( + { + inventory_item_id = null, + location_id = null, + relocate_if_necessary = null, + body = null, + ...otherArgs + }: ConnectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "connect", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "relocate_if_necessary": relocate_if_necessary, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set( + { + inventory_item_id = null, + location_id = null, + available = null, + disconnect_if_necessary = null, + body = null, + ...otherArgs + }: SetArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "set", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "available": available, "disconnect_if_necessary": disconnect_if_necessary, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public available: number | null; + public inventory_item_id: number | null; + public location_id: number | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/location.ts b/packages/shopify-api/rest/admin/2024-04/location.ts new file mode 100644 index 000000000..e26f6a48b --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/location.ts @@ -0,0 +1,131 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface InventoryLevelsArgs { + [key: string]: unknown; + session: Session; + id: number | string; +} + +export class Location extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "locations/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "locations.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "locations/.json"}, + {"http_method": "get", "operation": "inventory_levels", "ids": ["id"], "path": "locations//inventory_levels.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "location", + "plural": "locations" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async inventory_levels( + { + session, + id, + ...otherArgs + }: InventoryLevelsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "inventory_levels", + session: session, + urlIds: {"id": id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public active: boolean | null; + public address1: string | null; + public address2: string | null; + public city: string | null; + public country: string | null; + public country_code: string | null; + public created_at: string | null; + public id: number | null; + public legacy: boolean | null; + public localized_country_name: string | null; + public localized_province_name: string | null; + public name: string | null; + public phone: string | null; + public province: string | null; + public province_code: string | null; + public updated_at: string | null; + public zip: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/locations_for_move.ts b/packages/shopify-api/rest/admin/2024-04/locations_for_move.ts new file mode 100644 index 000000000..05bbeca05 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/locations_for_move.ts @@ -0,0 +1,48 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fulfillment_order_id?: number | string | null; +} + +export class LocationsForMove extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//locations_for_move.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "locations_for_move", + "plural": "locations_for_moves" + } + ]; + + public static async all( + { + session, + fulfillment_order_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"fulfillment_order_id": fulfillment_order_id}, + params: {...otherArgs}, + }); + + return response; + } + + public locations_for_move: {[key: string]: unknown}[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/marketing_event.ts b/packages/shopify-api/rest/admin/2024-04/marketing_event.ts new file mode 100644 index 000000000..ed7ce8d63 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/marketing_event.ts @@ -0,0 +1,175 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + offset?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface EngagementsArgs { + [key: string]: unknown; + occurred_on?: unknown; + impressions_count?: unknown; + views_count?: unknown; + clicks_count?: unknown; + shares_count?: unknown; + favorites_count?: unknown; + comments_count?: unknown; + ad_spend?: unknown; + is_cumulative?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class MarketingEvent extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "marketing_events/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "marketing_events/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "marketing_events.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "marketing_events/.json"}, + {"http_method": "post", "operation": "engagements", "ids": ["id"], "path": "marketing_events//engagements.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "marketing_events.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "marketing_events/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "marketing_event", + "plural": "marketing_events" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + offset = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "offset": offset, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async engagements( + { + occurred_on = null, + impressions_count = null, + views_count = null, + clicks_count = null, + shares_count = null, + favorites_count = null, + comments_count = null, + ad_spend = null, + is_cumulative = null, + body = null, + ...otherArgs + }: EngagementsArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "engagements", + session: this.session, + urlIds: {"id": this.id}, + params: {"occurred_on": occurred_on, "impressions_count": impressions_count, "views_count": views_count, "clicks_count": clicks_count, "shares_count": shares_count, "favorites_count": favorites_count, "comments_count": comments_count, "ad_spend": ad_spend, "is_cumulative": is_cumulative, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public event_type: string | null; + public marketing_channel: string | null; + public paid: boolean | null; + public started_at: string | null; + public UTM_parameters: {[key: string]: unknown} | null; + public budget: string | null; + public budget_type: string | null; + public currency: string | null; + public description: string | null; + public ended_at: string | null; + public id: number | null; + public manage_url: string | null; + public marketed_resources: {[key: string]: unknown}[] | null; + public preview_url: string | null; + public referring_domain: string | null; + public remote_id: string | null; + public scheduled_to_end_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/metafield.ts b/packages/shopify-api/rest/admin/2024-04/metafield.ts new file mode 100644 index 000000000..cfc896506 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/metafield.ts @@ -0,0 +1,302 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + namespace?: unknown; + key?: unknown; + type?: unknown; + fields?: unknown; + metafield?: {[key: string]: unknown} | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; +} + +export class Metafield extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, + {"http_method": "get", "operation": "count", "ids": ["article_id"], "path": "articles//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["collection_id"], "path": "collections//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["customer_id"], "path": "customers//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["draft_order_id"], "path": "draft_orders//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_image_id"], "path": "product_images//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["variant_id"], "path": "variants//metafields/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["article_id"], "path": "articles//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collections//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["page_id"], "path": "pages//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_image_id"], "path": "product_images//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["variant_id"], "path": "variants//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, + {"http_method": "post", "operation": "post", "ids": ["article_id"], "path": "articles//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["collection_id"], "path": "collections//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["page_id"], "path": "pages//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_image_id"], "path": "product_images//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["variant_id"], "path": "variants//metafields.json"}, + {"http_method": "put", "operation": "put", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "metafield", + "plural": "metafields" + } + ]; + + public static async find( + { + session, + id, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + namespace = null, + key = null, + type = null, + fields = null, + metafield = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "namespace": namespace, "key": key, "type": type, "fields": fields, "metafield": metafield, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public key: string | null; + public namespace: string | null; + public value: string | number | number | boolean | string | null; + public article_id: number | null; + public blog_id: number | null; + public collection_id: number | null; + public created_at: string | null; + public customer_id: number | null; + public description: string | null; + public draft_order_id: number | null; + public id: number | null; + public order_id: number | null; + public owner_id: number | null; + public owner_resource: string | null; + public page_id: number | null; + public product_id: number | null; + public product_image_id: number | null; + public type: string | null; + public updated_at: string | null; + public variant_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/mobile_platform_application.ts b/packages/shopify-api/rest/admin/2024-04/mobile_platform_application.ts new file mode 100644 index 000000000..0795dbf3c --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/mobile_platform_application.ts @@ -0,0 +1,94 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class MobilePlatformApplication extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "mobile_platform_applications/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "mobile_platform_applications.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "mobile_platform_applications/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "mobile_platform_applications.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "mobile_platform_applications/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "mobile_platform_application", + "plural": "mobile_platform_applications" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public application_id: string | null; + public enabled_shared_webcredentials: boolean | null; + public enabled_universal_or_app_links: boolean | null; + public id: number | null; + public platform: string | null; + public sha256_cert_fingerprints: string[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/order.ts b/packages/shopify-api/rest/admin/2024-04/order.ts new file mode 100644 index 000000000..7481ae738 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/order.ts @@ -0,0 +1,332 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Customer} from './customer'; +import {DiscountCode} from './discount_code'; +import {Fulfillment} from './fulfillment'; +import {Refund} from './refund'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + processed_at_min?: unknown; + processed_at_max?: unknown; + attribution_app_id?: unknown; + status?: unknown; + financial_status?: unknown; + fulfillment_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + status?: unknown; + financial_status?: unknown; + fulfillment_status?: unknown; +} +interface CancelArgs { + [key: string]: unknown; + amount?: unknown; + currency?: unknown; + restock?: unknown; + reason?: unknown; + email?: unknown; + refund?: unknown; + body?: {[key: string]: unknown} | null; +} +interface CloseArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface OpenArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Order extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "customer": Customer + }; + protected static hasMany: {[key: string]: typeof Base} = { + "discount_codes": DiscountCode, + "fulfillments": Fulfillment, + "refunds": Refund + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "orders/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "orders/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "orders.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "orders/.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "orders//cancel.json"}, + {"http_method": "post", "operation": "close", "ids": ["id"], "path": "orders//close.json"}, + {"http_method": "post", "operation": "open", "ids": ["id"], "path": "orders//open.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "orders.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "orders/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "order", + "plural": "orders" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + processed_at_min = null, + processed_at_max = null, + attribution_app_id = null, + status = null, + financial_status = null, + fulfillment_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "processed_at_min": processed_at_min, "processed_at_max": processed_at_max, "attribution_app_id": attribution_app_id, "status": status, "financial_status": financial_status, "fulfillment_status": fulfillment_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + status = null, + financial_status = null, + fulfillment_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "status": status, "financial_status": financial_status, "fulfillment_status": fulfillment_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async cancel( + { + amount = null, + currency = null, + restock = null, + reason = null, + email = null, + refund = null, + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {"amount": amount, "currency": currency, "restock": restock, "reason": reason, "email": email, "refund": refund, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async close( + { + body = null, + ...otherArgs + }: CloseArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "close", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async open( + { + body = null, + ...otherArgs + }: OpenArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "open", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public line_items: {[key: string]: unknown}[] | null; + public app_id: number | null; + public billing_address: {[key: string]: unknown} | null; + public browser_ip: string | null; + public buyer_accepts_marketing: boolean | null; + public cancel_reason: string | null; + public cancelled_at: string | null; + public cart_token: string | null; + public checkout_token: string | null; + public client_details: {[key: string]: unknown} | null; + public closed_at: string | null; + public company: {[key: string]: unknown} | null; + public confirmation_number: string | null; + public created_at: string | null; + public currency: string | null; + public current_subtotal_price: string | null; + public current_subtotal_price_set: {[key: string]: unknown} | null; + public current_total_additional_fees_set: {[key: string]: unknown} | null; + public current_total_discounts: string | null; + public current_total_discounts_set: {[key: string]: unknown} | null; + public current_total_duties_set: {[key: string]: unknown} | null; + public current_total_price: string | null; + public current_total_price_set: {[key: string]: unknown} | null; + public current_total_tax: string | null; + public current_total_tax_set: {[key: string]: unknown} | null; + public customer: Customer | null | {[key: string]: any}; + public customer_locale: string | null; + public discount_applications: {[key: string]: unknown}[] | null; + public discount_codes: DiscountCode[] | null | {[key: string]: any}; + public email: string | null; + public estimated_taxes: boolean | null; + public financial_status: string | null; + public fulfillment_status: string | null; + public fulfillments: Fulfillment[] | null | {[key: string]: any}; + public gateway: string | null; + public id: number | null; + public landing_site: string | null; + public location_id: number | null; + public merchant_of_record_app_id: number | null; + public name: string | null; + public note: string | null; + public note_attributes: {[key: string]: unknown}[] | null; + public number: number | null; + public order_number: number | null; + public order_status_url: string | null; + public original_total_additional_fees_set: {[key: string]: unknown} | null; + public original_total_duties_set: {[key: string]: unknown} | null; + public payment_gateway_names: string[] | null; + public payment_terms: {[key: string]: unknown} | null; + public phone: string | null; + public po_number: string | null; + public presentment_currency: string | null; + public processed_at: string | null; + public referring_site: string | null; + public refunds: Refund[] | null | {[key: string]: any}; + public shipping_address: {[key: string]: unknown} | null; + public shipping_lines: {[key: string]: unknown}[] | null; + public source_identifier: string | null; + public source_name: string | null; + public source_url: string | null; + public subtotal_price: string | null; + public subtotal_price_set: {[key: string]: unknown} | null; + public tags: string | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public test: boolean | null; + public token: string | null; + public total_discounts: string | null; + public total_discounts_set: {[key: string]: unknown} | null; + public total_line_items_price: string | null; + public total_line_items_price_set: {[key: string]: unknown} | null; + public total_outstanding: string | null; + public total_price: string | null; + public total_price_set: {[key: string]: unknown} | null; + public total_shipping_price_set: {[key: string]: unknown} | null; + public total_tax: string | number | null; + public total_tax_set: {[key: string]: unknown} | null; + public total_tip_received: string | null; + public total_weight: number | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/order_risk.ts b/packages/shopify-api/rest/admin/2024-04/order_risk.ts new file mode 100644 index 000000000..7cc6c17f8 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/order_risk.ts @@ -0,0 +1,109 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + order_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; +} + +export class OrderRisk extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//risks/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//risks.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//risks/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//risks.json"}, + {"http_method": "put", "operation": "put", "ids": ["order_id", "id"], "path": "orders//risks/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "risk", + "plural": "risks" + } + ]; + + protected static getJsonBodyName(): string + { + return "risk"; + } + + public static async find( + { + session, + id, + order_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + order_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + order_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {...otherArgs}, + }); + + return response; + } + + public cause_cancel: boolean | null; + public checkout_id: number | null; + public display: boolean | null; + public id: number | null; + public merchant_message: string | null; + public message: string | null; + public order_id: number | null; + public recommendation: string | null; + public score: string | null; + public source: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/page.ts b/packages/shopify-api/rest/admin/2024-04/page.ts new file mode 100644 index 000000000..217ae250c --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/page.ts @@ -0,0 +1,170 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + title?: unknown; + handle?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + fields?: unknown; + published_status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class Page extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "metafield": Metafield + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "pages/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "pages/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "pages.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "pages/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "pages.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "pages/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "page", + "plural": "pages" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + title = null, + handle = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + fields = null, + published_status = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "title": title, "handle": handle, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "fields": fields, "published_status": published_status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public admin_graphql_api_id: string | null; + public author: string | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public metafield: Metafield | null | {[key: string]: any}; + public published_at: string | null; + public shop_id: number | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/payment.ts b/packages/shopify-api/rest/admin/2024-04/payment.ts new file mode 100644 index 000000000..27d881e93 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/payment.ts @@ -0,0 +1,108 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Transaction} from './transaction'; +import {Checkout} from './checkout'; + +interface FindArgs { + session: Session; + id: number | string; + checkout_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + checkout_id?: number | string | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + checkout_id?: number | string | null; +} + +export class Payment extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "transaction": Transaction, + "checkout": Checkout + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["checkout_id"], "path": "checkouts//payments/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["checkout_id"], "path": "checkouts//payments.json"}, + {"http_method": "get", "operation": "get", "ids": ["checkout_id", "id"], "path": "checkouts//payments/.json"}, + {"http_method": "post", "operation": "post", "ids": ["checkout_id"], "path": "checkouts//payments.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "payment", + "plural": "payments" + } + ]; + + public static async find( + { + session, + id, + checkout_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "checkout_id": checkout_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + checkout_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"checkout_id": checkout_id}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + checkout_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"checkout_id": checkout_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public checkout: Checkout | null | {[key: string]: any}; + public credit_card: {[key: string]: unknown} | null; + public id: number | null; + public next_action: {[key: string]: unknown} | null; + public payment_processing_error_message: string | null; + public transaction: Transaction | null | {[key: string]: any}; + public unique_token: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/payment_gateway.ts b/packages/shopify-api/rest/admin/2024-04/payment_gateway.ts new file mode 100644 index 000000000..c4b4adf52 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/payment_gateway.ts @@ -0,0 +1,105 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class PaymentGateway extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "payment_gateways/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "payment_gateways.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "payment_gateways/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "payment_gateways.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "payment_gateways/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "payment_gateway", + "plural": "payment_gateways" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public attachment: string | null; + public created_at: string | null; + public credential1: string | null; + public credential2: string | null; + public credential3: string | null; + public credential4: string | null; + public disabled: boolean | null; + public enabled_card_brands: string[] | null; + public id: number | null; + public name: string | null; + public processing_method: string | null; + public provider_id: number | null; + public sandbox: boolean | null; + public service_name: string | null; + public supports_network_tokenization: boolean | null; + public type: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/payment_transaction.ts b/packages/shopify-api/rest/admin/2024-04/payment_transaction.ts new file mode 100644 index 000000000..810e1450a --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/payment_transaction.ts @@ -0,0 +1,78 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface TransactionsArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + test?: unknown; + payout_id?: unknown; + payout_status?: unknown; +} + +export class PaymentTransaction extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "transactions", "ids": [], "path": "shopify_payments/balance/transactions.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "payment_transaction", + "plural": "payment_transactions" + } + ]; + + public static async transactions( + { + session, + since_id = null, + last_id = null, + test = null, + payout_id = null, + payout_status = null, + ...otherArgs + }: TransactionsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "transactions", + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "test": test, "payout_id": payout_id, "payout_status": payout_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public adjustment_order_transactions: {[key: string]: unknown}[] | null; + public amount: string | null; + public currency: Currency | null | {[key: string]: any}; + public fee: string | null; + public id: number | null; + public net: string | null; + public payout_id: number | null; + public payout_status: string | null; + public processed_at: string | null; + public source_id: number | null; + public source_order_id: number | null; + public source_order_transaction_id: string | null; + public source_type: string | null; + public test: boolean | null; + public type: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/payout.ts b/packages/shopify-api/rest/admin/2024-04/payout.ts new file mode 100644 index 000000000..b024fd9da --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/payout.ts @@ -0,0 +1,81 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + date_min?: unknown; + date_max?: unknown; + date?: unknown; + status?: unknown; +} + +export class Payout extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/payouts.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "shopify_payments/payouts/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "payout", + "plural": "payouts" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + since_id = null, + last_id = null, + date_min = null, + date_max = null, + date = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "date_min": date_min, "date_max": date_max, "date": date, "status": status, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public date: string | null; + public id: number | null; + public status: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/policy.ts b/packages/shopify-api/rest/admin/2024-04/policy.ts new file mode 100644 index 000000000..35d088cfb --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/policy.ts @@ -0,0 +1,51 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Policy extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "policies.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "policy", + "plural": "policies" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public body: string | null; + public created_at: string | null; + public handle: string | null; + public title: string | null; + public updated_at: string | null; + public url: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/price_rule.ts b/packages/shopify-api/rest/admin/2024-04/price_rule.ts new file mode 100644 index 000000000..81c8eca2e --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/price_rule.ts @@ -0,0 +1,163 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + starts_at_min?: unknown; + starts_at_max?: unknown; + ends_at_min?: unknown; + ends_at_max?: unknown; + times_used?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class PriceRule extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "price_rules/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "price_rules/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "price_rules.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "price_rules/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "price_rules.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "price_rules/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "price_rule", + "plural": "price_rules" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + starts_at_min = null, + starts_at_max = null, + ends_at_min = null, + ends_at_max = null, + times_used = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "starts_at_min": starts_at_min, "starts_at_max": starts_at_max, "ends_at_min": ends_at_min, "ends_at_max": ends_at_max, "times_used": times_used, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public allocation_limit: number | null; + public allocation_method: string | null; + public created_at: string | null; + public customer_segment_prerequisite_ids: number[] | null; + public customer_selection: string | null; + public ends_at: string | null; + public entitled_collection_ids: number[] | null; + public entitled_country_ids: number[] | null; + public entitled_product_ids: number[] | null; + public entitled_variant_ids: number[] | null; + public id: number | null; + public once_per_customer: boolean | null; + public prerequisite_collection_ids: number[] | null; + public prerequisite_customer_ids: number[] | null; + public prerequisite_product_ids: number[] | null; + public prerequisite_quantity_range: {[key: string]: unknown} | null; + public prerequisite_shipping_price_range: {[key: string]: unknown} | null; + public prerequisite_subtotal_range: {[key: string]: unknown} | null; + public prerequisite_to_entitlement_purchase: {[key: string]: unknown} | null; + public prerequisite_to_entitlement_quantity_ratio: {[key: string]: unknown} | null; + public prerequisite_variant_ids: number[] | null; + public starts_at: string | null; + public target_selection: string | null; + public target_type: string | null; + public title: string | null; + public updated_at: string | null; + public usage_limit: number | null; + public value: string | null; + public value_type: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/product.ts b/packages/shopify-api/rest/admin/2024-04/product.ts new file mode 100644 index 000000000..d5a0e7f1f --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/product.ts @@ -0,0 +1,192 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; +import {Variant} from './variant'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; + since_id?: unknown; + title?: unknown; + vendor?: unknown; + handle?: unknown; + product_type?: unknown; + status?: unknown; + collection_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; + presentment_currencies?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + vendor?: unknown; + product_type?: unknown; + collection_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class Product extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "images": Image, + "variants": Variant + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "products/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "products/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "products.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "products/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "products.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "products/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "product", + "plural": "products" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + since_id = null, + title = null, + vendor = null, + handle = null, + product_type = null, + status = null, + collection_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + presentment_currencies = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, "since_id": since_id, "title": title, "vendor": vendor, "handle": handle, "product_type": product_type, "status": status, "collection_id": collection_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, "presentment_currencies": presentment_currencies, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + vendor = null, + product_type = null, + collection_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"vendor": vendor, "product_type": product_type, "collection_id": collection_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public images: Image[] | null | {[key: string]: any}; + public options: {[key: string]: unknown} | {[key: string]: unknown}[] | null; + public product_type: string | null; + public published_at: string | null; + public published_scope: string | null; + public status: string | null; + public tags: string | string[] | null; + public template_suffix: string | null; + public updated_at: string | null; + public variants: Variant[] | null | {[key: string]: any}; + public vendor: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/product_listing.ts b/packages/shopify-api/rest/admin/2024-04/product_listing.ts new file mode 100644 index 000000000..61a6743fe --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/product_listing.ts @@ -0,0 +1,167 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; +import {Variant} from './variant'; + +interface FindArgs { + session: Session; + product_id: number | string; +} +interface DeleteArgs { + session: Session; + product_id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_ids?: unknown; + limit?: unknown; + collection_id?: unknown; + updated_at_min?: unknown; + handle?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface ProductIdsArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; +} + +export class ProductListing extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "images": Image, + "variants": Variant + }; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id"], "path": "product_listings/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "product_listings/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "product_listings.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "product_listings/.json"}, + {"http_method": "get", "operation": "product_ids", "ids": [], "path": "product_listings/product_ids.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id"], "path": "product_listings/.json"} + ]; + protected static primaryKey: string = "product_id"; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "product_listing", + "plural": "product_listings" + } + ]; + + public static async find( + { + session, + product_id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + product_id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_ids = null, + limit = null, + collection_id = null, + updated_at_min = null, + handle = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"product_ids": product_ids, "limit": limit, "collection_id": collection_id, "updated_at_min": updated_at_min, "handle": handle, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async product_ids( + { + session, + limit = null, + ...otherArgs + }: ProductIdsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "product_ids", + session: session, + urlIds: {}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public images: Image[] | null | {[key: string]: any}; + public options: {[key: string]: unknown}[] | null; + public product_id: number | null; + public product_type: string | null; + public published_at: string | null; + public tags: string | null; + public title: string | null; + public updated_at: string | null; + public variants: Variant[] | null | {[key: string]: any}; + public vendor: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/product_resource_feedback.ts b/packages/shopify-api/rest/admin/2024-04/product_resource_feedback.ts new file mode 100644 index 000000000..d5070b836 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/product_resource_feedback.ts @@ -0,0 +1,62 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; +} + +export class ProductResourceFeedback extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//resource_feedback.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//resource_feedback.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "product_resource_feedback", + "plural": "product_resource_feedbacks" + } + ]; + + protected static getJsonBodyName(): string + { + return "resource_feedback"; + } + + public static async all( + { + session, + product_id = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public feedback_generated_at: string | null; + public messages: string[] | null; + public product_id: number | null; + public resource_id: number | null; + public resource_type: string | null; + public resource_updated_at: string | null; + public state: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/province.ts b/packages/shopify-api/rest/admin/2024-04/province.ts new file mode 100644 index 000000000..ea1b6bdee --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/province.ts @@ -0,0 +1,110 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + country_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + country_id?: number | string | null; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + country_id?: number | string | null; +} + +export class Province extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["country_id"], "path": "countries//provinces/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["country_id"], "path": "countries//provinces.json"}, + {"http_method": "get", "operation": "get", "ids": ["country_id", "id"], "path": "countries//provinces/.json"}, + {"http_method": "put", "operation": "put", "ids": ["country_id", "id"], "path": "countries//provinces/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "province", + "plural": "provinces" + } + ]; + + public static async find( + { + session, + id, + country_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "country_id": country_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + country_id = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"country_id": country_id}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + country_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"country_id": country_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public code: string | null; + public country_id: number | null; + public id: number | null; + public name: string | null; + public shipping_zone_id: number | null; + public tax: number | null; + public tax_name: string | null; + public tax_percentage: number | null; + public tax_type: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/recurring_application_charge.ts b/packages/shopify-api/rest/admin/2024-04/recurring_application_charge.ts new file mode 100644 index 000000000..770bff0c8 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/recurring_application_charge.ts @@ -0,0 +1,138 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} +interface CustomizeArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class RecurringApplicationCharge extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "recurring_application_charges/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "recurring_application_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "recurring_application_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "recurring_application_charges.json"}, + {"http_method": "put", "operation": "customize", "ids": ["id"], "path": "recurring_application_charges//customize.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "recurring_application_charge", + "plural": "recurring_application_charges" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public async customize( + { + body = null, + ...otherArgs + }: CustomizeArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "customize", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public activated_on: string | null; + public billing_on: string | null; + public cancelled_on: string | null; + public capped_amount: string | number | null; + public confirmation_url: string | null; + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + public id: number | null; + public name: string | null; + public price: string | number | null; + public return_url: string | null; + public status: string | null; + public terms: string | null; + public test: boolean | null; + public trial_days: number | null; + public trial_ends_on: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/redirect.ts b/packages/shopify-api/rest/admin/2024-04/redirect.ts new file mode 100644 index 000000000..578af7cfe --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/redirect.ts @@ -0,0 +1,131 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + path?: unknown; + target?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + path?: unknown; + target?: unknown; +} + +export class Redirect extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "redirects/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "redirects/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "redirects.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "redirects/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "redirects.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "redirects/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "redirect", + "plural": "redirects" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + path = null, + target = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "path": path, "target": target, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + path = null, + target = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"path": path, "target": target, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public id: number | null; + public path: string | null; + public target: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/refund.ts b/packages/shopify-api/rest/admin/2024-04/refund.ts new file mode 100644 index 000000000..24163e558 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/refund.ts @@ -0,0 +1,125 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Transaction} from './transaction'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; + in_shop_currency?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + limit?: unknown; + fields?: unknown; + in_shop_currency?: unknown; +} +interface CalculateArgs { + [key: string]: unknown; + shipping?: unknown; + refund_line_items?: unknown; + currency?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Refund extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "transactions": Transaction + }; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//refunds.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//refunds/.json"}, + {"http_method": "post", "operation": "calculate", "ids": ["order_id"], "path": "orders//refunds/calculate.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//refunds.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "refund", + "plural": "refunds" + } + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null, + in_shop_currency = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields, "in_shop_currency": in_shop_currency}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + order_id = null, + limit = null, + fields = null, + in_shop_currency = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {"limit": limit, "fields": fields, "in_shop_currency": in_shop_currency, ...otherArgs}, + }); + + return response; + } + + public async calculate( + { + shipping = null, + refund_line_items = null, + currency = null, + body = null, + ...otherArgs + }: CalculateArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "calculate", + session: this.session, + urlIds: {"order_id": this.order_id}, + params: {"shipping": shipping, "refund_line_items": refund_line_items, "currency": currency, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public duties: {[key: string]: unknown}[] | null; + public id: number | null; + public note: string | null; + public order_adjustments: {[key: string]: unknown}[] | null; + public order_id: number | null; + public processed_at: string | null; + public refund_duties: {[key: string]: unknown}[] | null; + public refund_line_items: {[key: string]: unknown}[] | null; + public restock: boolean | null; + public transactions: Transaction[] | null | {[key: string]: any}; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/resource_feedback.ts b/packages/shopify-api/rest/admin/2024-04/resource_feedback.ts new file mode 100644 index 000000000..671ecdb6d --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/resource_feedback.ts @@ -0,0 +1,53 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class ResourceFeedback extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "resource_feedback.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "resource_feedback.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "resource_feedback", + "plural": "resource_feedbacks" + } + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public feedback_generated_at: string | null; + public messages: string[] | null; + public resource_id: number | null; + public resource_type: string | null; + public state: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/script_tag.ts b/packages/shopify-api/rest/admin/2024-04/script_tag.ts new file mode 100644 index 000000000..538a41b54 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/script_tag.ts @@ -0,0 +1,139 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + src?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + src?: unknown; +} + +export class ScriptTag extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "script_tags/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "script_tags/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "script_tags.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "script_tags/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "script_tags.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "script_tags/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "script_tag", + "plural": "script_tags" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + src = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "src": src, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + src = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"src": src, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public event: string | null; + public src: string | null; + public cache: boolean | null; + public created_at: string | null; + public display_scope: string | null; + public id: number | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/shipping_zone.ts b/packages/shopify-api/rest/admin/2024-04/shipping_zone.ts new file mode 100644 index 000000000..e29317a1d --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/shipping_zone.ts @@ -0,0 +1,62 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Country} from './country'; +import {Province} from './province'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class ShippingZone extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = { + "countries": Country, + "provinces": Province + }; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shipping_zones.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "shipping_zone", + "plural": "shipping_zones" + } + ]; + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public carrier_shipping_rate_providers: unknown | null; + public countries: Country[] | null | {[key: string]: any}; + public id: number | null; + public location_group_id: string | null; + public name: string | null; + public price_based_shipping_rates: {[key: string]: unknown}[] | null; + public profile_id: string | null; + public provinces: Province[] | null | {[key: string]: any}; + public weight_based_shipping_rates: {[key: string]: unknown}[] | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/shop.ts b/packages/shopify-api/rest/admin/2024-04/shop.ts new file mode 100644 index 000000000..3dd3ea1a4 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/shop.ts @@ -0,0 +1,119 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class Shop extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shop.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "shop", + "plural": "shops" + } + ]; + + public static async current( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return result.data ? result.data[0] : null; + } + + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public address1: string | null; + public address2: string | null; + public checkout_api_supported: boolean | null; + public city: string | null; + public country: string | null; + public country_code: string | null; + public country_name: string | null; + public county_taxes: boolean | null; + public created_at: string | null; + public currency: string | null; + public customer_email: string | null; + public domain: string | null; + public eligible_for_card_reader_giveaway: boolean | null; + public eligible_for_payments: boolean | null; + public email: string | null; + public enabled_presentment_currencies: string[] | null; + public finances: boolean | null; + public force_ssl: boolean | null; + public google_apps_domain: string | null; + public google_apps_login_enabled: string | null; + public has_discounts: boolean | null; + public has_gift_cards: boolean | null; + public has_storefront: boolean | null; + public iana_timezone: string | null; + public id: number | null; + public latitude: number | null; + public longitude: number | null; + public marketing_sms_consent_enabled_at_checkout: boolean | null; + public money_format: string | null; + public money_in_emails_format: string | null; + public money_with_currency_format: string | null; + public money_with_currency_in_emails_format: string | null; + public multi_location_enabled: boolean | null; + public myshopify_domain: string | null; + public name: string | null; + public password_enabled: boolean | null; + public phone: string | null; + public plan_display_name: string | null; + public plan_name: string | null; + public pre_launch_enabled: boolean | null; + public primary_locale: string | null; + public primary_location_id: number | null; + public province: string | null; + public province_code: string | null; + public requires_extra_payments_agreement: boolean | null; + public setup_required: boolean | null; + public shop_owner: string | null; + public source: string | null; + public tax_shipping: string | null; + public taxes_included: boolean | null; + public timezone: string | null; + public transactional_sms_disabled: boolean | null; + public updated_at: string | null; + public weight_unit: string | null; + public zip: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/smart_collection.ts b/packages/shopify-api/rest/admin/2024-04/smart_collection.ts new file mode 100644 index 000000000..a13e3267e --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/smart_collection.ts @@ -0,0 +1,192 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + ids?: unknown; + since_id?: unknown; + title?: unknown; + product_id?: unknown; + handle?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + product_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} +interface OrderArgs { + [key: string]: unknown; + products?: unknown; + sort_order?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class SmartCollection extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "smart_collections/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "smart_collections/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "smart_collections.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "smart_collections/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "smart_collections.json"}, + {"http_method": "put", "operation": "order", "ids": ["id"], "path": "smart_collections//order.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "smart_collections/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "smart_collection", + "plural": "smart_collections" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ids = null, + since_id = null, + title = null, + product_id = null, + handle = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "ids": ids, "since_id": since_id, "title": title, "product_id": product_id, "handle": handle, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + product_id = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "product_id": product_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async order( + { + products = null, + sort_order = null, + body = null, + ...otherArgs + }: OrderArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "order", + session: this.session, + urlIds: {"id": this.id}, + params: {"products": products, "sort_order": sort_order, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public rules: {[key: string]: unknown} | {[key: string]: unknown}[] | null; + public title: string | null; + public body_html: string | null; + public disjunctive: boolean | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/storefront_access_token.ts b/packages/shopify-api/rest/admin/2024-04/storefront_access_token.ts new file mode 100644 index 000000000..1100d3c31 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/storefront_access_token.ts @@ -0,0 +1,73 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class StorefrontAccessToken extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "storefront_access_tokens/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "storefront_access_tokens.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "storefront_access_tokens.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "storefront_access_token", + "plural": "storefront_access_tokens" + } + ]; + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public title: string | null; + public access_scope: string | null; + public access_token: string | null; + public created_at: string | null; + public id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/tender_transaction.ts b/packages/shopify-api/rest/admin/2024-04/tender_transaction.ts new file mode 100644 index 000000000..0602ebe71 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/tender_transaction.ts @@ -0,0 +1,67 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + processed_at_min?: unknown; + processed_at_max?: unknown; + processed_at?: unknown; + order?: unknown; +} + +export class TenderTransaction extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "tender_transactions.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "tender_transaction", + "plural": "tender_transactions" + } + ]; + + public static async all( + { + session, + limit = null, + since_id = null, + processed_at_min = null, + processed_at_max = null, + processed_at = null, + order = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "processed_at_min": processed_at_min, "processed_at_max": processed_at_max, "processed_at": processed_at, "order": order, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public id: number | null; + public order_id: number | null; + public payment_details: {[key: string]: unknown} | null; + public payment_method: string | null; + public processed_at: string | null; + public remote_reference: string | null; + public test: boolean | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/theme.ts b/packages/shopify-api/rest/admin/2024-04/theme.ts new file mode 100644 index 000000000..beb403198 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/theme.ts @@ -0,0 +1,101 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class Theme extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "themes/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "themes.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "themes/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "themes.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "themes/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "theme", + "plural": "themes" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public id: number | null; + public name: string | null; + public previewable: boolean | null; + public processing: boolean | null; + public role: string | null; + public src: string | null; + public theme_store_id: number | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/transaction.ts b/packages/shopify-api/rest/admin/2024-04/transaction.ts new file mode 100644 index 000000000..3ffc274a6 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/transaction.ts @@ -0,0 +1,130 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; + in_shop_currency?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + since_id?: unknown; + fields?: unknown; + in_shop_currency?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; +} + +export class Transaction extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//transactions/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//transactions.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//transactions/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//transactions.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "transaction", + "plural": "transactions" + } + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null, + in_shop_currency = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields, "in_shop_currency": in_shop_currency}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + order_id = null, + since_id = null, + fields = null, + in_shop_currency = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {"since_id": since_id, "fields": fields, "in_shop_currency": in_shop_currency, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + order_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"order_id": order_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public kind: string | null; + public amount: string | null; + public authorization: string | null; + public authorization_expires_at: string | null; + public created_at: string | null; + public currency: string | null; + public currency_exchange_adjustment: {[key: string]: unknown} | null; + public device_id: number | null; + public error_code: string | null; + public extended_authorization_attributes: {[key: string]: unknown} | null; + public gateway: string | null; + public id: number | null; + public location_id: number | null; + public message: string | null; + public order_id: number | null; + public parent_id: number | null; + public payment_details: {[key: string]: unknown} | null; + public payments_refund_attributes: {[key: string]: unknown} | null; + public processed_at: string | null; + public receipt: {[key: string]: unknown} | null; + public source_name: string | null; + public status: string | null; + public test: boolean | null; + public total_unsettled_set: {[key: string]: unknown} | null; + public user_id: number | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/usage_charge.ts b/packages/shopify-api/rest/admin/2024-04/usage_charge.ts new file mode 100644 index 000000000..460697c7e --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/usage_charge.ts @@ -0,0 +1,84 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface FindArgs { + session: Session; + id: number | string; + recurring_application_charge_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + recurring_application_charge_id?: number | string | null; + fields?: unknown; +} + +export class UsageCharge extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["recurring_application_charge_id"], "path": "recurring_application_charges//usage_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["recurring_application_charge_id", "id"], "path": "recurring_application_charges//usage_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": ["recurring_application_charge_id"], "path": "recurring_application_charges//usage_charges.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "usage_charge", + "plural": "usage_charges" + } + ]; + + public static async find( + { + session, + id, + recurring_application_charge_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "recurring_application_charge_id": recurring_application_charge_id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + recurring_application_charge_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"recurring_application_charge_id": recurring_application_charge_id}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + public description: string | null; + public id: number | null; + public price: string | null; + public recurring_application_charge_id: number | null; + public updated_at: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/user.ts b/packages/shopify-api/rest/admin/2024-04/user.ts new file mode 100644 index 000000000..05b77d910 --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/user.ts @@ -0,0 +1,106 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + page_info?: unknown; +} +interface CurrentArgs { + [key: string]: unknown; + session: Session; +} + +export class User extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "get", "operation": "current", "ids": [], "path": "users/current.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "users.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "users/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "user", + "plural": "users" + } + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result.data ? result.data[0] : null; + } + + public static async all( + { + session, + limit = null, + page_info = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "page_info": page_info, ...otherArgs}, + }); + + return response; + } + + public static async current( + { + session, + ...otherArgs + }: CurrentArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "current", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public account_owner: boolean | null; + public bio: string | null; + public email: string | null; + public first_name: string | null; + public id: number | null; + public im: string | null; + public last_name: string | null; + public locale: string | null; + public permissions: string[] | null; + public phone: string | null; + public receive_announcements: number | null; + public screen_name: string | null; + public url: string | null; + public user_type: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/variant.ts b/packages/shopify-api/rest/admin/2024-04/variant.ts new file mode 100644 index 000000000..1c2bb1b6e --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/variant.ts @@ -0,0 +1,156 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + product_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + limit?: unknown; + presentment_currencies?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; +} + +export class Variant extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//variants/.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//variants/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//variants.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "variants/.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//variants.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "variants/.json"} + ]; + protected static readOnlyAttributes: string[] = [ + "inventory_quantity" + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "variant", + "plural": "variants" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id, + product_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_id = null, + limit = null, + presentment_currencies = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {"limit": limit, "presentment_currencies": presentment_currencies, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + product_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"product_id": product_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public barcode: string | null; + public compare_at_price: string | null; + public created_at: string | null; + public fulfillment_service: string | null; + public grams: number | null; + public id: number | null; + public image_id: number | null; + public inventory_item_id: number | null; + public inventory_management: string | null; + public inventory_policy: string | null; + public inventory_quantity: number | null; + public old_inventory_quantity: number | null; + public option: {[key: string]: unknown} | null; + public position: number | null; + public presentment_prices: {[key: string]: unknown}[] | null; + public price: string | null; + public product_id: number | null; + public requires_shipping: boolean | null; + public sku: string | null; + public tax_code: string | null; + public taxable: boolean | null; + public title: string | null; + public updated_at: string | null; + public weight: number | null; + public weight_unit: string | null; +} diff --git a/packages/shopify-api/rest/admin/2024-04/webhook.ts b/packages/shopify-api/rest/admin/2024-04/webhook.ts new file mode 100644 index 000000000..3ee245ffa --- /dev/null +++ b/packages/shopify-api/rest/admin/2024-04/webhook.ts @@ -0,0 +1,146 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + address?: unknown; + created_at_max?: unknown; + created_at_min?: unknown; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + topic?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + address?: unknown; + topic?: unknown; +} + +export class Webhook extends Base { + public static apiVersion = ApiVersion.January24; + + protected static hasOne: {[key: string]: typeof Base} = {}; + protected static hasMany: {[key: string]: typeof Base} = {}; + protected static paths: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "webhooks/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "webhooks/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "webhooks.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "webhooks/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "webhooks.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "webhooks/.json"} + ]; + protected static resourceNames: ResourceNames[] = [ + { + "singular": "webhook", + "plural": "webhooks" + } + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result.data ? result.data[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + address = null, + created_at_max = null, + created_at_min = null, + fields = null, + limit = null, + since_id = null, + topic = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"address": address, "created_at_max": created_at_max, "created_at_min": created_at_min, "fields": fields, "limit": limit, "since_id": since_id, "topic": topic, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + address = null, + topic = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"address": address, "topic": topic, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public address: string | null; + public topic: string | null; + public api_version: string | null; + public created_at: string | null; + public fields: string[] | null; + public format: string | null; + public id: number | null; + public metafield_namespaces: string[] | null; + public private_metafield_namespaces: string[] | null; + public updated_at: string | null; +}