Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds 2025-01 Admin REST resources #1926

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dull-cups-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/shopify-api': minor
---

Adds 2025-01 Admin REST resources
1 change: 1 addition & 0 deletions packages/apps/shopify-api/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum LogSeverity {
}

export enum ApiVersion {
January25 = '2025-01',
October22 = '2022-10',
January23 = '2023-01',
April23 = '2023-04',
Expand Down
112 changes: 112 additions & 0 deletions packages/apps/shopify-api/rest/admin/2025-01/abandoned_checkout.ts
Original file line number Diff line number Diff line change
@@ -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.January25;

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<unknown> {
const response = await this.request<AbandonedCheckout>({
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;
}
48 changes: 48 additions & 0 deletions packages/apps/shopify-api/rest/admin/2025-01/access_scope.ts
Original file line number Diff line number Diff line change
@@ -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.January25;

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<FindAllResponse<AccessScope>> {
const response = await this.baseFind<AccessScope>({
session: session,
urlIds: {},
params: {...otherArgs},
});

return response;
}

public handle: string | null;
public access_scopes: {[key: string]: unknown}[] | null;
}
Original file line number Diff line number Diff line change
@@ -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.January25;

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/<id>.json"},
{"http_method": "get", "operation": "csr", "ids": ["id"], "path": "apple_pay_certificates/<id>/csr.json"},
{"http_method": "get", "operation": "get", "ids": ["id"], "path": "apple_pay_certificates/<id>.json"},
{"http_method": "post", "operation": "post", "ids": [], "path": "apple_pay_certificates.json"},
{"http_method": "put", "operation": "put", "ids": ["id"], "path": "apple_pay_certificates/<id>.json"}
];
protected static resourceNames: ResourceNames[] = [
{
"singular": "apple_pay_certificate",
"plural": "apple_pay_certificates"
}
];

public static async find(
{
session,
id
}: FindArgs
): Promise<ApplePayCertificate | null> {
const result = await this.baseFind<ApplePayCertificate>({
session: session,
urlIds: {"id": id},
params: {},
});
return result.data ? result.data[0] : null;
}

public static async delete(
{
session,
id
}: DeleteArgs
): Promise<unknown> {
const response = await this.request<ApplePayCertificate>({
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<unknown> {
const response = await this.request<ApplePayCertificate>({
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;
}
Original file line number Diff line number Diff line change
@@ -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.January25;

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/<id>.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<ApplicationCharge | null> {
const result = await this.baseFind<ApplicationCharge>({
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<FindAllResponse<ApplicationCharge>> {
const response = await this.baseFind<ApplicationCharge>({
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;
}
Loading
Loading