diff --git a/.changeset/dependabot-1792.md b/.changeset/dependabot-1792.md deleted file mode 100644 index 867596c1b1..0000000000 --- a/.changeset/dependabot-1792.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/api-codegen-preset': patch ---- - -Updated `@graphql-codegen/typescript` dependencies diff --git a/.changeset/dependabot-1835.md b/.changeset/dependabot-1835.md deleted file mode 100644 index f3ecf038ae..0000000000 --- a/.changeset/dependabot-1835.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@shopify/shopify-api': patch -'@shopify/shopify-app-express': patch ---- - -Updated `express` dependencies diff --git a/.changeset/dependabot-1856.md b/.changeset/dependabot-1856.md deleted file mode 100644 index 50b02f6484..0000000000 --- a/.changeset/dependabot-1856.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/shopify-app-session-storage-mongodb': patch ---- - -Updated `mongodb` dependencies diff --git a/.changeset/dependabot-1870.md b/.changeset/dependabot-1870.md deleted file mode 100644 index 3874468d2a..0000000000 --- a/.changeset/dependabot-1870.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/api-codegen-preset': patch ---- - -Updated `graphql` dependencies diff --git a/.changeset/dependabot-1904.md b/.changeset/dependabot-1904.md new file mode 100644 index 0000000000..edd9961e92 --- /dev/null +++ b/.changeset/dependabot-1904.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-app-remix': patch +--- + +Updated `@remix-run/server-runtime` dependencies diff --git a/.changeset/dependabot-1811.md b/.changeset/dependabot-1905.md similarity index 100% rename from .changeset/dependabot-1811.md rename to .changeset/dependabot-1905.md diff --git a/.changeset/dependabot-1876.md b/.changeset/dependabot-1923.md similarity index 100% rename from .changeset/dependabot-1876.md rename to .changeset/dependabot-1923.md diff --git a/.changeset/dependabot-1888.md b/.changeset/dependabot-1936.md similarity index 100% rename from .changeset/dependabot-1888.md rename to .changeset/dependabot-1936.md diff --git a/.changeset/dependabot-1887.md b/.changeset/dependabot-1937.md similarity index 100% rename from .changeset/dependabot-1887.md rename to .changeset/dependabot-1937.md diff --git a/.changeset/dependabot-1947.md b/.changeset/dependabot-1947.md new file mode 100644 index 0000000000..366db62bfd --- /dev/null +++ b/.changeset/dependabot-1947.md @@ -0,0 +1,6 @@ +--- +'@shopify/shopify-api': patch +'@shopify/shopify-app-remix': patch +--- + +Updated `isbot` dependencies diff --git a/.changeset/dependabot-1953.md b/.changeset/dependabot-1953.md new file mode 100644 index 0000000000..3989823e17 --- /dev/null +++ b/.changeset/dependabot-1953.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-api': patch +--- + +Updated `uuid` dependencies diff --git a/.changeset/dependabot-1985.md b/.changeset/dependabot-1985.md new file mode 100644 index 0000000000..127d43309a --- /dev/null +++ b/.changeset/dependabot-1985.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-app-session-storage-dynamodb': patch +--- + +Updated `@aws-sdk/client-dynamodb`, ` @aws-sdk/util-dynamodb` dependencies diff --git a/.changeset/tiny-jeans-boil.md b/.changeset/tiny-jeans-boil.md new file mode 100644 index 0000000000..dd46861783 --- /dev/null +++ b/.changeset/tiny-jeans-boil.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-app-express': patch +--- + +Change common logs from info level to debug diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5dd8386e67..e1c7f54b27 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,28 @@ version: 2 updates: # Enable version updates for npm - - package-ecosystem: "npm" + - package-ecosystem: 'npm' # Look for `package.json` and `lock` files in the `root` directory - directory: "/" + directory: '/' # Check the npm registry for updates every day (weekdays) schedule: - interval: "daily" + interval: 'daily' # Dependabot defaults to 5 open pull requests at a time open-pull-requests-limit: 100 + + # Group together PRs of interdependant packages + groups: + aws-sdk: + patterns: + - '@aws-sdk/client-dynamodb' + - '@aws-sdk/util-dynamodb' + remix-run: + patterns: + - '@remix-run/node' + - '@remix-run/react' + - '@remix-run/testing' + - '@remix-run/server-runtime' + prisma: + patterns: + - 'prisma' + - '@prisma/client' diff --git a/package.json b/package.json index 514f678d73..3c62876b93 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@babel/plugin-transform-runtime": "^7.25.9", "@babel/preset-env": "^7.26.0", "@changesets/cli": "^2.27.11", - "@cloudflare/workers-types": "^4.20241218.0", + "@cloudflare/workers-types": "^4.20250109.0", "@jest/types": "^29.6.3", "@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-commonjs": "^28.0.2", @@ -34,18 +34,18 @@ "@shopify/prettier-config": "^1.1.2", "@shopify/typescript-configs": "^5.1.0", "@types/jest": "^29.5.14", - "@types/node": "^22.10.2", + "@types/node": "^22.10.7", "@types/supertest": "^6.0.2", "eslint": "^8.57.1", - "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-prettier": "^5.2.3", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "jest-fetch-mock": "^3.0.3", "jest-runner-eslint": "^2.2.1", "prettier": "^3.4.1", "rimraf": "^5.0.7", - "rollup": "^4.28.1", + "rollup": "^4.31.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23", "supertest": "^7.0.0", @@ -53,7 +53,7 @@ "ts-node": "^10.9.2", "tslib": "^2.8.1", "turbo": "^2.3.3", - "typescript": "5.7.2" + "typescript": "5.7.3" }, "dependencies": {}, "resolutions": { diff --git a/packages/api-clients/api-codegen-preset/CHANGELOG.md b/packages/api-clients/api-codegen-preset/CHANGELOG.md index 795d11df6d..d8b823a390 100644 --- a/packages/api-clients/api-codegen-preset/CHANGELOG.md +++ b/packages/api-clients/api-codegen-preset/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.1.4 + +### Patch Changes + +- 694092c: Updated `@graphql-codegen/typescript` dependencies +- 12ab42a: Updated `graphql` dependencies + ## 1.1.3 ### Patch Changes diff --git a/packages/api-clients/api-codegen-preset/package.json b/packages/api-clients/api-codegen-preset/package.json index 261424a860..1ca9454765 100644 --- a/packages/api-clients/api-codegen-preset/package.json +++ b/packages/api-clients/api-codegen-preset/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/api-codegen-preset", - "version": "1.1.3", + "version": "1.1.4", "description": "Preset for graphql-codegen to parse and type queries to Shopify APIs", "author": "Shopify", "license": "MIT", diff --git a/packages/api-clients/graphql-client/package.json b/packages/api-clients/graphql-client/package.json index 867ab394aa..697a3213c4 100644 --- a/packages/api-clients/graphql-client/package.json +++ b/packages/api-clients/graphql-client/package.json @@ -89,7 +89,7 @@ "jest-environment-jsdom": "^29.5.0", "jest-fetch-mock": "^3.0.3", "regenerator-runtime": "^0.14.1", - "web-streams-polyfill": "^4.0.0" + "web-streams-polyfill": "^4.1.0" }, "bugs": { "url": "https://github.com/Shopify/shopify-app-js/issues" diff --git a/packages/apps/session-storage/shopify-app-session-storage-drizzle/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-drizzle/CHANGELOG.md index 3a7f1ab3e6..9106388493 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-drizzle/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-drizzle/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/shopify-app-session-storage-drizzle +## 2.0.10 + +### Patch Changes + +- 8fbff4d: Updated `mysql2` dependencies + ## 2.0.9 ### Patch Changes diff --git a/packages/apps/session-storage/shopify-app-session-storage-drizzle/package.json b/packages/apps/session-storage/shopify-app-session-storage-drizzle/package.json index 1b87f02143..29f9cc49d8 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-drizzle/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-drizzle/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-drizzle", - "version": "2.0.9", + "version": "2.0.10", "description": "Shopify App Session Storage for Drizzle", "repository": { "type": "git", @@ -52,13 +52,13 @@ }, "devDependencies": { "@libsql/client": "^0.14.0", - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9", + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10", "@types/better-sqlite3": "^7.6.12", "@types/pg": "^8.11.6", - "better-sqlite3": "^11.7.0", - "drizzle-kit": "^0.30.1", - "drizzle-orm": "^0.38.2", - "mysql2": "^3.11.5", + "better-sqlite3": "^11.8.1", + "drizzle-kit": "^0.30.2", + "drizzle-orm": "^0.38.4", + "mysql2": "^3.12.0", "pg": "^8.12.0" }, "files": [ diff --git a/packages/apps/session-storage/shopify-app-session-storage-dynamodb/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-dynamodb/CHANGELOG.md index 891ddccfbd..6b2388421e 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-dynamodb/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-dynamodb/CHANGELOG.md @@ -1,5 +1,12 @@ # @shopify/shopify-app-session-storage-dynamodb +## 4.0.10 + +### Patch Changes + +- 3e88e3f: Updated `@aws-sdk/client-dynamodb` dependencies +- d0196a7: Updated `@aws-sdk/util-dynamodb` dependencies + ## 4.0.9 ### Patch Changes diff --git a/packages/apps/session-storage/shopify-app-session-storage-dynamodb/package.json b/packages/apps/session-storage/shopify-app-session-storage-dynamodb/package.json index 1f15caab4d..85dc05b037 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-dynamodb/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-dynamodb", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for DynamoDB", "repository": { "type": "git", @@ -44,15 +44,15 @@ "AWS" ], "dependencies": { - "@aws-sdk/client-dynamodb": "^3.714.0", - "@aws-sdk/util-dynamodb": "^3.714.0" + "@aws-sdk/client-dynamodb": "^3.731.1", + "@aws-sdk/util-dynamodb": "^3.731.1" }, "peerDependencies": { "@shopify/shopify-api": "^11.0.0", "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9" + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-kv/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-kv/CHANGELOG.md index 574c92fd0f..56ca46145e 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-kv/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-kv/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-kv +## 4.0.10 + ## 4.0.9 ## 4.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-kv/package.json b/packages/apps/session-storage/shopify-app-session-storage-kv/package.json index 2ecead637f..39b4e0422a 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-kv/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-kv/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-kv", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for KV", "repository": { "type": "git", @@ -51,9 +51,9 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20241218.0", - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9", - "miniflare": "^3.20241205.0" + "@cloudflare/workers-types": "^4.20250109.0", + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10", + "miniflare": "^3.20241230.2" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-memory/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-memory/CHANGELOG.md index 3671b7b3df..ca16f5e647 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-memory/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-memory/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-memory +## 4.0.10 + ## 4.0.9 ## 4.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-memory/package.json b/packages/apps/session-storage/shopify-app-session-storage-memory/package.json index aee568e4a0..97c9996c84 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-memory/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-memory/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-memory", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for Memory", "repository": { "type": "git", @@ -47,7 +47,7 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9" + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-mongodb/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-mongodb/CHANGELOG.md index 9e15ffd011..7f3b3658e8 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-mongodb/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-mongodb/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/shopify-app-session-storage-mongodb +## 4.0.10 + +### Patch Changes + +- d982db5: Updated `mongodb` dependencies + ## 4.0.9 ## 4.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-mongodb/package.json b/packages/apps/session-storage/shopify-app-session-storage-mongodb/package.json index f5e413e8d3..a7537b4b55 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-mongodb/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-mongodb", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for MongoDB", "repository": { "type": "git", @@ -50,7 +50,7 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9" + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-mysql/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-mysql/CHANGELOG.md index 6adcdb91e5..77de4e612c 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-mysql/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-mysql/CHANGELOG.md @@ -1,5 +1,11 @@ # @shopify/shopify-app-session-storage-mysql +## 4.0.10 + +### Patch Changes + +- 8fbff4d: Updated `mysql2` dependencies + ## 4.0.9 ### Patch Changes diff --git a/packages/apps/session-storage/shopify-app-session-storage-mysql/package.json b/packages/apps/session-storage/shopify-app-session-storage-mysql/package.json index 00120285da..c5ab49cc6a 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-mysql/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-mysql/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-mysql", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for MySQL", "repository": { "type": "git", @@ -44,14 +44,14 @@ "session storage" ], "dependencies": { - "mysql2": "^3.11.5" + "mysql2": "^3.12.0" }, "peerDependencies": { "@shopify/shopify-api": "^11.0.0", "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9" + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-postgresql/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-postgresql/CHANGELOG.md index 7c11e8eac6..95a031673f 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-postgresql/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-postgresql/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-postgresql +## 4.0.10 + ## 4.0.9 ## 4.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-postgresql/package.json b/packages/apps/session-storage/shopify-app-session-storage-postgresql/package.json index 334f9c142d..8d62b04a15 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-postgresql/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-postgresql/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-postgresql", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for PostgreSQL", "repository": { "type": "git", @@ -52,7 +52,7 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9", + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10", "@types/pg": "^8.11.6" }, "files": [ diff --git a/packages/apps/session-storage/shopify-app-session-storage-prisma/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-prisma/CHANGELOG.md index c9e5b8e088..a9e9419143 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-prisma/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-prisma/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-prisma +## 5.2.1 + ## 5.2.0 ### Minor Changes diff --git a/packages/apps/session-storage/shopify-app-session-storage-prisma/README.md b/packages/apps/session-storage/shopify-app-session-storage-prisma/README.md index 6b1392c7b4..09a9d2a1f3 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-prisma/README.md +++ b/packages/apps/session-storage/shopify-app-session-storage-prisma/README.md @@ -6,14 +6,21 @@ Session storage for prisma requires a `schema.prisma` with a Session table with ```prisma model Session { - id String @id - shop String - state String - isOnline Boolean @default(false) - scope String? - expires DateTime? - accessToken String - userId BigInt? + id String @id + shop String + state String + isOnline Boolean @default(false) + scope String? + expires DateTime? + accessToken String + userId BigInt? + firstName String? + lastName String? + email String? + accountOwner Boolean? + locale String? + collaborator Boolean? + emailVerified Boolean? } ``` diff --git a/packages/apps/session-storage/shopify-app-session-storage-prisma/package.json b/packages/apps/session-storage/shopify-app-session-storage-prisma/package.json index 815dd65b27..ede2f75376 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-prisma/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-prisma/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-prisma", - "version": "5.2.0", + "version": "5.2.1", "description": "Shopify App Session Storage for Prisma", "repository": { "type": "git", @@ -45,15 +45,15 @@ ], "dependencies": {}, "peerDependencies": { - "@prisma/client": "^5.22.0", + "@prisma/client": "^6.2.1", "@shopify/shopify-api": "^11.0.0", "@shopify/shopify-app-session-storage": "^3.0.0", - "prisma": "^5.22.0" + "prisma": "^6.2.1" }, "devDependencies": { - "@prisma/client": "^5.22.0", - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9", - "prisma": "^5.22.0" + "@prisma/client": "^6.2.1", + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10", + "prisma": "^6.2.1" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-redis/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-redis/CHANGELOG.md index 36ebee3b82..3293b6c41f 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-redis/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-redis/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-redis +## 4.2.3 + ## 4.2.2 ## 4.2.1 diff --git a/packages/apps/session-storage/shopify-app-session-storage-redis/package.json b/packages/apps/session-storage/shopify-app-session-storage-redis/package.json index 426873a857..44140f3bcb 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-redis/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-redis/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-redis", - "version": "4.2.2", + "version": "4.2.3", "description": "Shopify App Session Storage for Redis", "repository": { "type": "git", @@ -51,7 +51,7 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9" + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage-sqlite/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-sqlite/CHANGELOG.md index 9c38454799..3ad4f30fce 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-sqlite/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-sqlite/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-sqlite +## 4.0.10 + ## 4.0.9 ## 4.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-sqlite/package.json b/packages/apps/session-storage/shopify-app-session-storage-sqlite/package.json index 967841ca59..54114a4e3d 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-sqlite/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-sqlite/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-sqlite", - "version": "4.0.9", + "version": "4.0.10", "description": "Shopify App Session Storage for SQLite", "repository": { "type": "git", @@ -51,7 +51,7 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-app-session-storage-test-utils": "^3.0.9", + "@shopify/shopify-app-session-storage-test-utils": "^3.0.10", "@types/sqlite3": "^3.1.8" }, "files": [ diff --git a/packages/apps/session-storage/shopify-app-session-storage-test-utils/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage-test-utils/CHANGELOG.md index d019761711..7cb77f4ade 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-test-utils/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage-test-utils/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage-test-utils +## 3.0.10 + ## 3.0.9 ## 3.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage-test-utils/package.json b/packages/apps/session-storage/shopify-app-session-storage-test-utils/package.json index 4608673f90..23299dac9b 100644 --- a/packages/apps/session-storage/shopify-app-session-storage-test-utils/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage-test-utils", - "version": "3.0.9", + "version": "3.0.10", "description": "Utilities for testing Shopify App Session Storage", "repository": { "type": "git", @@ -49,8 +49,8 @@ "@shopify/shopify-app-session-storage": "^3.0.0" }, "devDependencies": { - "@shopify/shopify-api": "^11.6.1", - "@shopify/shopify-app-session-storage": "^3.0.9" + "@shopify/shopify-api": "^11.7.0", + "@shopify/shopify-app-session-storage": "^3.0.10" }, "files": [ "dist/*", diff --git a/packages/apps/session-storage/shopify-app-session-storage/CHANGELOG.md b/packages/apps/session-storage/shopify-app-session-storage/CHANGELOG.md index 964afc857e..3654b20a55 100644 --- a/packages/apps/session-storage/shopify-app-session-storage/CHANGELOG.md +++ b/packages/apps/session-storage/shopify-app-session-storage/CHANGELOG.md @@ -1,5 +1,7 @@ # @shopify/shopify-app-session-storage +## 3.0.10 + ## 3.0.9 ## 3.0.8 diff --git a/packages/apps/session-storage/shopify-app-session-storage/package.json b/packages/apps/session-storage/shopify-app-session-storage/package.json index a0c103fa38..1f4ae3965b 100644 --- a/packages/apps/session-storage/shopify-app-session-storage/package.json +++ b/packages/apps/session-storage/shopify-app-session-storage/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-session-storage", - "version": "3.0.9", + "version": "3.0.10", "description": "Shopify App Session Storage - abstract class", "repository": { "type": "git", @@ -47,7 +47,7 @@ "@shopify/shopify-api": "^11.0.0" }, "devDependencies": { - "@shopify/shopify-api": "^11.6.1" + "@shopify/shopify-api": "^11.7.0" }, "files": [ "dist/*", diff --git a/packages/apps/shopify-api/CHANGELOG.md b/packages/apps/shopify-api/CHANGELOG.md index cffedd0e74..119a1d018b 100644 --- a/packages/apps/shopify-api/CHANGELOG.md +++ b/packages/apps/shopify-api/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 11.7.0 + +### Minor Changes + +- dc6b8ad: Adds 2025-01 Admin REST resources + +### Patch Changes + +- 6b71f39: Updated `express` dependencies +- 6681802: Updated `isbot` dependencies + ## 11.6.1 ### Patch Changes diff --git a/packages/apps/shopify-api/docs/migrating-to-v11.md b/packages/apps/shopify-api/docs/migrating-to-v11.md new file mode 100644 index 0000000000..260b6fbc10 --- /dev/null +++ b/packages/apps/shopify-api/docs/migrating-to-v11.md @@ -0,0 +1,11 @@ +# Migrating to V11 + +This document covers the changes apps will need to make to be able to upgrade to v11 of this package. + +The main reason for this release was to remove support for Node 16 so we can continue to evolve this package. + +## Table of contents + +To make it easier to navigate this guide, here is an overview of the sections it contains: + +- Removing Node 16 support diff --git a/packages/apps/shopify-api/lib/types.ts b/packages/apps/shopify-api/lib/types.ts index a36748685c..47dbedc9ec 100644 --- a/packages/apps/shopify-api/lib/types.ts +++ b/packages/apps/shopify-api/lib/types.ts @@ -6,6 +6,7 @@ export enum LogSeverity { } export enum ApiVersion { + January25 = '2025-01', October22 = '2022-10', January23 = '2023-01', April23 = '2023-04', diff --git a/packages/apps/shopify-api/lib/version.ts b/packages/apps/shopify-api/lib/version.ts index bc26574352..426b727264 100644 --- a/packages/apps/shopify-api/lib/version.ts +++ b/packages/apps/shopify-api/lib/version.ts @@ -1 +1 @@ -export const SHOPIFY_API_LIBRARY_VERSION = '11.6.1'; +export const SHOPIFY_API_LIBRARY_VERSION = '11.7.0'; diff --git a/packages/apps/shopify-api/package.json b/packages/apps/shopify-api/package.json index 43bb7432bb..b8008a8afd 100644 --- a/packages/apps/shopify-api/package.json +++ b/packages/apps/shopify-api/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-api", - "version": "11.6.1", + "version": "11.7.0", "description": "Shopify API Library for Node - accelerate development with support for authentication, graphql proxy, webhooks", "types": "./dist/ts/lib/index.d.ts", "module": "./dist/esm/lib/index.mjs", @@ -83,16 +83,16 @@ "@shopify/network": "^3.3.0", "@shopify/storefront-api-client": "^1.0.3", "compare-versions": "^6.1.1", - "isbot": "^5.1.18", + "isbot": "^5.1.21", "jose": "^5.9.6", "jsonwebtoken": "^9.0.2", "node-fetch": "^2.6.1", "tslib": "^2.8.1", - "uuid": "^10.0.0" + "uuid": "^11.0.5" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20241218.0", - "@swc/core": "^1.10.1", + "@cloudflare/workers-types": "^4.20250109.0", + "@swc/core": "^1.10.8", "@types/express": "^4.17.13", "@types/jsonwebtoken": "^9.0.7", "@types/node-fetch": "^2.6.11", @@ -100,10 +100,10 @@ "expect": "^29.7.0", "express": "^4.21.2", "jest-environment-miniflare": "^2.14.4", - "miniflare": "^3.20241205.0", - "rollup": "^4.28.1", + "miniflare": "^3.20241230.2", + "rollup": "^4.31.0", "rollup-plugin-swc": "^0.2.1", - "wrangler": "^3.96.0" + "wrangler": "^3.103.2" }, "files": [ "dist/*", diff --git a/packages/apps/shopify-api/rest/admin/2025-01/abandoned_checkout.ts b/packages/apps/shopify-api/rest/admin/2025-01/abandoned_checkout.ts new file mode 100644 index 0000000000..a969de838f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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 { + 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/apps/shopify-api/rest/admin/2025-01/access_scope.ts b/packages/apps/shopify-api/rest/admin/2025-01/access_scope.ts new file mode 100644 index 0000000000..5a66b8e592 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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> { + 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/apps/shopify-api/rest/admin/2025-01/apple_pay_certificate.ts b/packages/apps/shopify-api/rest/admin/2025-01/apple_pay_certificate.ts new file mode 100644 index 0000000000..17c002305b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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/.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/apps/shopify-api/rest/admin/2025-01/application_charge.ts b/packages/apps/shopify-api/rest/admin/2025-01/application_charge.ts new file mode 100644 index 0000000000..e8982a2190 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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/.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/apps/shopify-api/rest/admin/2025-01/application_credit.ts b/packages/apps/shopify-api/rest/admin/2025-01/application_credit.ts new file mode 100644 index 0000000000..bf0f1662f3 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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_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/apps/shopify-api/rest/admin/2025-01/article.ts b/packages/apps/shopify-api/rest/admin/2025-01/article.ts new file mode 100644 index 0000000000..672a06bfb0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/asset.ts b/packages/apps/shopify-api/rest/admin/2025-01/asset.ts new file mode 100644 index 0000000000..aa4d8f33e0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/assigned_fulfillment_order.ts b/packages/apps/shopify-api/rest/admin/2025-01/assigned_fulfillment_order.ts new file mode 100644 index 0000000000..232602b910 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/balance.ts b/packages/apps/shopify-api/rest/admin/2025-01/balance.ts new file mode 100644 index 0000000000..a891a08165 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/blog.ts b/packages/apps/shopify-api/rest/admin/2025-01/blog.ts new file mode 100644 index 0000000000..383cc471c7 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/cancellation_request.ts b/packages/apps/shopify-api/rest/admin/2025-01/cancellation_request.ts new file mode 100644 index 0000000000..8a1b98c47a --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/carrier_service.ts b/packages/apps/shopify-api/rest/admin/2025-01/carrier_service.ts new file mode 100644 index 0000000000..194556021e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/checkout.ts b/packages/apps/shopify-api/rest/admin/2025-01/checkout.ts new file mode 100644 index 0000000000..76db9e126d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/collect.ts b/packages/apps/shopify-api/rest/admin/2025-01/collect.ts new file mode 100644 index 0000000000..0a241c03ab --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/collection.ts b/packages/apps/shopify-api/rest/admin/2025-01/collection.ts new file mode 100644 index 0000000000..19e0333864 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/collection_listing.ts b/packages/apps/shopify-api/rest/admin/2025-01/collection_listing.ts new file mode 100644 index 0000000000..c83528724d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/comment.ts b/packages/apps/shopify-api/rest/admin/2025-01/comment.ts new file mode 100644 index 0000000000..bd91f8fd54 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/country.ts b/packages/apps/shopify-api/rest/admin/2025-01/country.ts new file mode 100644 index 0000000000..3315932437 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/currency.ts b/packages/apps/shopify-api/rest/admin/2025-01/currency.ts new file mode 100644 index 0000000000..c1d947117c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/custom_collection.ts b/packages/apps/shopify-api/rest/admin/2025-01/custom_collection.ts new file mode 100644 index 0000000000..35e45305e5 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/customer.ts b/packages/apps/shopify-api/rest/admin/2025-01/customer.ts new file mode 100644 index 0000000000..259e0bca38 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/customer.ts @@ -0,0 +1,277 @@ +/*********************************************************************************************************************** +* 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; +} +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.January25; + + 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, + ...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 response ? response.body : null; + } + + 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 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/apps/shopify-api/rest/admin/2025-01/customer_address.ts b/packages/apps/shopify-api/rest/admin/2025-01/customer_address.ts new file mode 100644 index 0000000000..898b4f526b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/customer_address.ts @@ -0,0 +1,185 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base, FindAllResponse} from '../../base'; +import {ResourcePath, ResourceNames, Body} 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.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": ["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"; + } + + protected setData(data: Body): void { + if (this.resource().config.future?.customerAddressDefaultFix) { + if ('default' in data) { + data['is_default'] = Boolean(data['default']); + delete data['default']; + } else { + data['is_default'] = false; + } + } + + return super.setData(data); + } + + 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 is_default: boolean | 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/apps/shopify-api/rest/admin/2025-01/deprecated_api_call.ts b/packages/apps/shopify-api/rest/admin/2025-01/deprecated_api_call.ts new file mode 100644 index 0000000000..9fb0d5a968 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/discount_code.ts b/packages/apps/shopify-api/rest/admin/2025-01/discount_code.ts new file mode 100644 index 0000000000..e236cba948 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/dispute.ts b/packages/apps/shopify-api/rest/admin/2025-01/dispute.ts new file mode 100644 index 0000000000..1a04265075 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/dispute_evidence.ts b/packages/apps/shopify-api/rest/admin/2025-01/dispute_evidence.ts new file mode 100644 index 0000000000..c813ed13f9 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/dispute_file_upload.ts b/packages/apps/shopify-api/rest/admin/2025-01/dispute_file_upload.ts new file mode 100644 index 0000000000..32dba48c02 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/draft_order.ts b/packages/apps/shopify-api/rest/admin/2025-01/draft_order.ts new file mode 100644 index 0000000000..b317ebb390 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/event.ts b/packages/apps/shopify-api/rest/admin/2025-01/event.ts new file mode 100644 index 0000000000..5c38cd3df2 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/fulfillment.ts b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment.ts new file mode 100644 index 0000000000..e0f5bf09b4 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/fulfillment_event.ts b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_event.ts new file mode 100644 index 0000000000..62cd67c10c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/fulfillment_order.ts b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_order.ts new file mode 100644 index 0000000000..a5e4518e45 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/fulfillment_request.ts b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_request.ts new file mode 100644 index 0000000000..6b22e79701 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_request.ts @@ -0,0 +1,91 @@ +/*********************************************************************************************************************** +* 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.January25; + + 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; + public kind: string | null; + public message: string | null; + public request_options: {[key: string]: unknown} | null; + public response_data: {[key: string]: unknown} | null; + public sent_at: string | null; +} diff --git a/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_service.ts b/packages/apps/shopify-api/rest/admin/2025-01/fulfillment_service.ts new file mode 100644 index 0000000000..d5972ea18b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/gift_card.ts b/packages/apps/shopify-api/rest/admin/2025-01/gift_card.ts new file mode 100644 index 0000000000..c350b8674d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/gift_card.ts @@ -0,0 +1,187 @@ +/*********************************************************************************************************************** +* 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 {Balance} from './balance'; +import {Currency} from './currency'; + +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; +} +interface DisableArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class GiftCard extends Base { + public static apiVersion = ApiVersion.January25; + + protected static hasOne: {[key: string]: typeof Base} = { + "balance": Balance, + "currency": Currency + }; + 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, + ...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 response ? response.body : null; + } + + 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: Balance | null | {[key: string]: any}; + public code: string | null; + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + 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/apps/shopify-api/rest/admin/2025-01/gift_card_adjustment.ts b/packages/apps/shopify-api/rest/admin/2025-01/gift_card_adjustment.ts new file mode 100644 index 0000000000..924458e683 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/image.ts b/packages/apps/shopify-api/rest/admin/2025-01/image.ts new file mode 100644 index 0000000000..9888877b5c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/index.ts b/packages/apps/shopify-api/rest/admin/2025-01/index.ts new file mode 100644 index 0000000000..4c43b25ef4 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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, +}; \ No newline at end of file diff --git a/packages/apps/shopify-api/rest/admin/2025-01/inventory_item.ts b/packages/apps/shopify-api/rest/admin/2025-01/inventory_item.ts new file mode 100644 index 0000000000..038c8fd82b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/inventory_level.ts b/packages/apps/shopify-api/rest/admin/2025-01/inventory_level.ts new file mode 100644 index 0000000000..e79d223756 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": [], "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/apps/shopify-api/rest/admin/2025-01/location.ts b/packages/apps/shopify-api/rest/admin/2025-01/location.ts new file mode 100644 index 0000000000..34cb98f7c2 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/location.ts @@ -0,0 +1,133 @@ +/*********************************************************************************************************************** +* 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; +} +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.January25; + + 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, + limit = null, + ...otherArgs + }: AllArgs + ): Promise> { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, ...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/apps/shopify-api/rest/admin/2025-01/locations_for_move.ts b/packages/apps/shopify-api/rest/admin/2025-01/locations_for_move.ts new file mode 100644 index 0000000000..9dfb5949d7 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/marketing_event.ts b/packages/apps/shopify-api/rest/admin/2025-01/marketing_event.ts new file mode 100644 index 0000000000..4f2c09b1f3 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/metafield.ts b/packages/apps/shopify-api/rest/admin/2025-01/metafield.ts new file mode 100644 index 0000000000..e4758a7199 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/metafield.ts @@ -0,0 +1,300 @@ +/*********************************************************************************************************************** +* 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; +} +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.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": ["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": ["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": "get", "operation": "get", "ids": [], "path": "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, + ...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, ...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/apps/shopify-api/rest/admin/2025-01/mobile_platform_application.ts b/packages/apps/shopify-api/rest/admin/2025-01/mobile_platform_application.ts new file mode 100644 index 0000000000..cfab40fd7e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/mobile_platform_application.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 MobilePlatformApplication 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": "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 app_clip_application_id: string | null; + public application_id: string | null; + public enabled_app_clips: boolean | 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/apps/shopify-api/rest/admin/2025-01/order.ts b/packages/apps/shopify-api/rest/admin/2025-01/order.ts new file mode 100644 index 0000000000..7239f6ce1b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/order.ts @@ -0,0 +1,338 @@ +/*********************************************************************************************************************** +* 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; + name?: 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.January25; + + 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, + name = 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, "name": name, "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 confirmed: boolean | 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 duties_included: boolean | null; + 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 id: number | null; + public landing_site: string | null; + public location_id: number | null; + public merchant_business_entity_id: string | 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_cash_rounding_payment_adjustment_set: {[key: string]: unknown} | null; + public total_cash_rounding_refund_adjustment_set: {[key: string]: unknown} | 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/apps/shopify-api/rest/admin/2025-01/order_risk.ts b/packages/apps/shopify-api/rest/admin/2025-01/order_risk.ts new file mode 100644 index 0000000000..73d5b9b27e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/page.ts b/packages/apps/shopify-api/rest/admin/2025-01/page.ts new file mode 100644 index 0000000000..845a182d00 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/payment.ts b/packages/apps/shopify-api/rest/admin/2025-01/payment.ts new file mode 100644 index 0000000000..5725579c05 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/payment.ts @@ -0,0 +1,60 @@ +/*********************************************************************************************************************** +* 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 {Transaction} from './transaction'; +import {Checkout} from './checkout'; + +interface FindArgs { + session: Session; + id: number | string; + checkout_id?: number | string | null; +} + +export class Payment extends Base { + public static apiVersion = ApiVersion.January25; + + 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": "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 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/apps/shopify-api/rest/admin/2025-01/payment_gateway.ts b/packages/apps/shopify-api/rest/admin/2025-01/payment_gateway.ts new file mode 100644 index 0000000000..033962017f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/payment_transaction.ts b/packages/apps/shopify-api/rest/admin/2025-01/payment_transaction.ts new file mode 100644 index 0000000000..605c8858d9 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/payment_transaction.ts @@ -0,0 +1,79 @@ +/*********************************************************************************************************************** +* 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.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": "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 adjustment_reason: string | 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/apps/shopify-api/rest/admin/2025-01/payout.ts b/packages/apps/shopify-api/rest/admin/2025-01/payout.ts new file mode 100644 index 0000000000..f79381011f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/policy.ts b/packages/apps/shopify-api/rest/admin/2025-01/policy.ts new file mode 100644 index 0000000000..5379ac6d00 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/price_rule.ts b/packages/apps/shopify-api/rest/admin/2025-01/price_rule.ts new file mode 100644 index 0000000000..71024b335e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/product.ts b/packages/apps/shopify-api/rest/admin/2025-01/product.ts new file mode 100644 index 0000000000..638b233ebb --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/product_listing.ts b/packages/apps/shopify-api/rest/admin/2025-01/product_listing.ts new file mode 100644 index 0000000000..b283fae207 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/product_resource_feedback.ts b/packages/apps/shopify-api/rest/admin/2025-01/product_resource_feedback.ts new file mode 100644 index 0000000000..e34dae99c0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/province.ts b/packages/apps/shopify-api/rest/admin/2025-01/province.ts new file mode 100644 index 0000000000..6c730aa111 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/recurring_application_charge.ts b/packages/apps/shopify-api/rest/admin/2025-01/recurring_application_charge.ts new file mode 100644 index 0000000000..50cbbba7fc --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/redirect.ts b/packages/apps/shopify-api/rest/admin/2025-01/redirect.ts new file mode 100644 index 0000000000..57e48447da --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/refund.ts b/packages/apps/shopify-api/rest/admin/2025-01/refund.ts new file mode 100644 index 0000000000..62372dc4a9 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/refund.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'; + +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.January25; + + 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 refund_shipping_lines: {[key: string]: unknown}[] | null; + public restock: boolean | null; + public transactions: Transaction[] | null | {[key: string]: any}; + public user_id: number | null; +} diff --git a/packages/apps/shopify-api/rest/admin/2025-01/resource_feedback.ts b/packages/apps/shopify-api/rest/admin/2025-01/resource_feedback.ts new file mode 100644 index 0000000000..abff9798a4 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/script_tag.ts b/packages/apps/shopify-api/rest/admin/2025-01/script_tag.ts new file mode 100644 index 0000000000..6566a3e465 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/shipping_zone.ts b/packages/apps/shopify-api/rest/admin/2025-01/shipping_zone.ts new file mode 100644 index 0000000000..93910961cf --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/shop.ts b/packages/apps/shopify-api/rest/admin/2025-01/shop.ts new file mode 100644 index 0000000000..6d283e23cb --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/shop.ts @@ -0,0 +1,118 @@ +/*********************************************************************************************************************** +* 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.January25; + + 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 auto_configure_tax_inclusivity: boolean | 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_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/apps/shopify-api/rest/admin/2025-01/smart_collection.ts b/packages/apps/shopify-api/rest/admin/2025-01/smart_collection.ts new file mode 100644 index 0000000000..595dc3a82d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/storefront_access_token.ts b/packages/apps/shopify-api/rest/admin/2025-01/storefront_access_token.ts new file mode 100644 index 0000000000..582903ea3a --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/tender_transaction.ts b/packages/apps/shopify-api/rest/admin/2025-01/tender_transaction.ts new file mode 100644 index 0000000000..1d8bf20a86 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/theme.ts b/packages/apps/shopify-api/rest/admin/2025-01/theme.ts new file mode 100644 index 0000000000..6b6a464fe0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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/apps/shopify-api/rest/admin/2025-01/transaction.ts b/packages/apps/shopify-api/rest/admin/2025-01/transaction.ts new file mode 100644 index 0000000000..42f2624084 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/transaction.ts @@ -0,0 +1,132 @@ +/*********************************************************************************************************************** +* 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.January25; + + 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 amount_rounding: 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 manual_payment_gateway: boolean | 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/apps/shopify-api/rest/admin/2025-01/usage_charge.ts b/packages/apps/shopify-api/rest/admin/2025-01/usage_charge.ts new file mode 100644 index 0000000000..384b145012 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/user.ts b/packages/apps/shopify-api/rest/admin/2025-01/user.ts new file mode 100644 index 0000000000..e0211386b4 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.January25; + + 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/apps/shopify-api/rest/admin/2025-01/variant.ts b/packages/apps/shopify-api/rest/admin/2025-01/variant.ts new file mode 100644 index 0000000000..b635ab2f8a --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": ["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/apps/shopify-api/rest/admin/2025-01/webhook.ts b/packages/apps/shopify-api/rest/admin/2025-01/webhook.ts new file mode 100644 index 0000000000..1f268fcf32 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/2025-01/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.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": "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; +} diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/abandoned_checkout.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/abandoned_checkout.test.ts new file mode 100644 index 0000000000..c6bd339c65 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/abandoned_checkout.test.ts @@ -0,0 +1,176 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('AbandonedCheckout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + created_at_max: "2013-10-12T07:05:27-02:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + status: "closed", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: 'status=closed', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + limit: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: 'limit=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + created_at_max: "2013-10-12T07:05:27-02:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"code": "Free Shipping", "price": "0.00", "original_shop_price": null, "original_rate_price": null, "original_shop_markup": null, "source": "shopify", "title": "Free Shipping", "presentment_title": null, "phone": null, "tax_lines": null, "custom_tax_lines": null, "markup": null, "delivery_category": null, "carrier_identifier": null, "carrier_service_id": null, "api_client_id": null, "requested_fulfillment_service_id": null, "applied_discounts": [], "delivery_option_group_type": null, "delivery_expectation_range": null, "delivery_expectation_type": null, "estimated_delivery_time_range": null, "id": "5da41c1738454765", "validation_context": null}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "f32827a8d00b0a8d", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": "TENOFF", "created_at": null, "application_type": "discount_code", "discount_class": "ORDER"}], "key": "7e8c529027b9a00e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "reservation_token": "0123456789abcdef0123456789zjkw", "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + status: "closed", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: 'status=closed', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/access_scope.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/access_scope.test.ts new file mode 100644 index 0000000000..1ce322f498 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/access_scope.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('AccessScope resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"access_scopes": [{"handle": "read_products"}, {"handle": "write_orders"}, {"handle": "read_orders"}]})); + + await shopify.rest.AccessScope.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/oauth/access_scopes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/apple_pay_certificate.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/apple_pay_certificate.test.ts new file mode 100644 index 0000000000..be51892326 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/apple_pay_certificate.test.ts @@ -0,0 +1,135 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ApplePayCertificate resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938278, "status": "issuing", "merchant_id": null}})); + + const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); + + await apple_pay_certificate.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/apple_pay_certificates.json', + query: '', + headers, + data: { "apple_pay_certificate": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "csr", "merchant_id": null}})); + + await shopify.rest.ApplePayCertificate.find({ + session: session, + id: 1068938276, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/apple_pay_certificates/1068938276.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938275, "status": "completed", "merchant_id": "merchant.something"}})); + + const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); + apple_pay_certificate.id = 1068938275; + apple_pay_certificate.status = "completed"; + apple_pay_certificate.merchant_id = "merchant.something"; + apple_pay_certificate.encoded_signed_certificate = "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECwwKNVVZMzJOTE5O\nOTEXMBUGA1UECgwOSm9zaHVhIFRlc3NpZXIxCzAJBgNVBAYTAkNBMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAEAxDDCvzG6MnsZSJOtbr0hr3MRq+4HzTZ\nx8J4FD34E3kU5CallEnZLBmnzfqmjP8644SO28LLJxvWBnrg7lHFtaOCAlUw\nggJRMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAYYraHR0cDovL29jc3Au\nYXBwbGUuY29tL29jc3AwNC1hcHBsZXd3ZHJjYTIwMTAdBgNVHQ4EFgQUkPsO\nKEKvhL/takKomy5GWXtCd8wwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSE\ntoTMOoZichZZlOgao71I3zrfCzCCAR0GA1UdIASCARQwggEQMIIBDAYJKoZI\nhvdjZAUBMIH+MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMg\nY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBv\nZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25k\naXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp\nY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"; + await apple_pay_certificate.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/apple_pay_certificates/1068938275.json', + query: '', + headers, + data: { "apple_pay_certificate": {"status": "completed", "merchant_id": "merchant.something", "encoded_signed_certificate": "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECwwKNVVZMzJOTE5O\nOTEXMBUGA1UECgwOSm9zaHVhIFRlc3NpZXIxCzAJBgNVBAYTAkNBMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAEAxDDCvzG6MnsZSJOtbr0hr3MRq+4HzTZ\nx8J4FD34E3kU5CallEnZLBmnzfqmjP8644SO28LLJxvWBnrg7lHFtaOCAlUw\nggJRMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAYYraHR0cDovL29jc3Au\nYXBwbGUuY29tL29jc3AwNC1hcHBsZXd3ZHJjYTIwMTAdBgNVHQ4EFgQUkPsO\nKEKvhL/takKomy5GWXtCd8wwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSE\ntoTMOoZichZZlOgao71I3zrfCzCCAR0GA1UdIASCARQwggEQMIIBDAYJKoZI\nhvdjZAUBMIH+MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMg\nY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBv\nZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25k\naXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp\nY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ApplePayCertificate.delete({ + session: session, + id: 1068938274, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/apple_pay_certificates/1068938274.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"csr": {"key": "YXBwbGUtcGF5LWNzcg==\n"}})); + + await shopify.rest.ApplePayCertificate.csr({ + session: session, + id: 1068938277, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/apple_pay_certificates/1068938277/csr.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_charge.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_charge.test.ts new file mode 100644 index 0000000000..b94db82eef --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_charge.test.ts @@ -0,0 +1,136 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ApplicationCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262359, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2025-01-02T11:21:36-05:00", "updated_at": "2025-01-02T11:21:36-05:00", "currency": "USD", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262359", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262359/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBBcxojw6EmF1dG9fYWN0aXZhdGVU--53cb494fedf6f420ff06e85ed207a3442ea4447e"}})); + + const application_charge = new shopify.rest.ApplicationCharge({session: session}); + application_charge.name = "Super Duper Expensive action"; + application_charge.price = 100.0; + application_charge.return_url = "http://super-duper.shopifyapps.com"; + application_charge.test = true; + await application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/application_charges.json', + query: '', + headers, + data: { "application_charge": {"name": "Super Duper Expensive action", "price": 100.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262360, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2025-01-02T11:21:38-05:00", "updated_at": "2025-01-02T11:21:38-05:00", "currency": "USD", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262360", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262360/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBBgxojw6EmF1dG9fYWN0aXZhdGVU--258ee22d3cebf17a9fbc35be9bc959c04aac0b06"}})); + + const application_charge = new shopify.rest.ApplicationCharge({session: session}); + application_charge.name = "Super Duper Expensive action"; + application_charge.price = 100.0; + application_charge.return_url = "http://super-duper.shopifyapps.com"; + await application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/application_charges.json', + query: '', + headers, + data: { "application_charge": {"name": "Super Duper Expensive action", "price": 100.0, "return_url": "http://super-duper.shopifyapps.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_charges": [{"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "external_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + + await shopify.rest.ApplicationCharge.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/application_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + + await shopify.rest.ApplicationCharge.all({ + session: session, + since_id: "556467234", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/application_charges.json', + query: 'since_id=556467234', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); + + await shopify.rest.ApplicationCharge.find({ + session: session, + id: 675931192, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/application_charges/675931192.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_credit.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_credit.test.ts new file mode 100644 index 0000000000..18ae66f58b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/application_credit.test.ts @@ -0,0 +1,67 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ApplicationCredit resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_credit": {"id": 140583599, "amount": "5.00", "description": "credit for application refund", "test": null, "currency": "USD"}})); + + await shopify.rest.ApplicationCredit.find({ + session: session, + id: 140583599, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/application_credits/140583599.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"application_credits": [{"id": 140583599, "amount": "5.00", "description": "credit for application refund", "test": null, "currency": "USD"}]})); + + await shopify.rest.ApplicationCredit.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/application_credits.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/article.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/article.test.ts new file mode 100644 index 0000000000..a00cdeb69e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/article.test.ts @@ -0,0 +1,579 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Article resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2025-01-02T11:29:59-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/Article/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/Article/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2025-01-02T11:29:59-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/Article/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}]})); + + await shopify.rest.Article.all({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2025-01-02T11:29:59-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/Article/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/Article/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2025-01-02T11:29:59-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/Article/1051293780"}]})); + + await shopify.rest.Article.all({ + session: session, + blog_id: 241253187, + since_id: "134645308", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: 'since_id=134645308', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 1051293782, "title": "My new Article title", "created_at": "2025-01-02T11:32:55-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2025-01-02T11:32:55-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/Article/1051293782"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 1051293787, "title": "My new Article title", "created_at": "2025-01-02T11:33:16-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2025-01-02T11:33:16-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/Article/1051293787", "image": {"created_at": "2025-01-02T11:33:16-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1735835596"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + }; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 1051293781, "title": "My new Article title", "created_at": "2025-01-02T11:32:54-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2025-01-02T11:32:54-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/Article/1051293781"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2025-01-02T11:33:14-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2025-01-02T11:33:14-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/Article/1051293786", "image": {"created_at": "2025-01-02T11:33:14-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20250102-63224-f3qbv0.gif?v=1735835594"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails logo" + }; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2025-01-02T11:33:04-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2025-01-02T11:33:04-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/Article/1051293784"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published = false; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Article.count({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}})); + + await shopify.rest.Article.find({ + session: session, + blog_id: 241253187, + id: 134645308, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2025-01-02T11:33:12-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = false; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2025-01-02T11:33:03-05:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2025-01-02T11:33:03-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = true; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2025-01-02T11:32:57-05:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/Article/134645308"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.image = ""; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"image": ""} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2025-01-02T11:33:09-05:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:33:09-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1735835589"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37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rB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" + }; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\n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5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2025-01-02T11:33:10-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1735835399"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2025-01-02T11:33:00-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/Article/134645308", "image": {"created_at": "2025-01-02T11:33:00-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20250102-63224-hl4boc.gif?v=1735835580"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "alt": "Rails logo" + }; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Article.delete({ + session: session, + blog_id: 241253187, + id: 134645308, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"authors": ["dennis", "John", "Rob", "Dennis"]})); + + await shopify.rest.Article.authors({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/authors.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + + await shopify.rest.Article.tags({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + + await shopify.rest.Article.tags({ + session: session, + limit: "1", + popular: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/tags.json', + query: 'limit=1&popular=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + + await shopify.rest.Article.tags({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + + await shopify.rest.Article.tags({ + session: session, + blog_id: 241253187, + limit: "1", + popular: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187/articles/tags.json', + query: 'limit=1&popular=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/asset.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/asset.test.ts new file mode 100644 index 0000000000..bce161b415 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/asset.test.ts @@ -0,0 +1,184 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Asset resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"assets": [{"key": "layout/theme.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 3252, "checksum": null, "theme_id": 828155753}, {"key": "assets/sidebar-devider.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/sidebar-devider.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1016, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-pink.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-pink.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1562, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-content.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-content.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 134, "checksum": null, "theme_id": 828155753}, {"key": "sections/header_section.liquid", "public_url": null, "created_at": "2017-04-28T10:30:00-04:00", "updated_at": "2017-04-28T10:30:00-04:00", "content_type": "application/x-liquid", "size": 998, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.css.liquid", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.css.liquid?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 14675, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.js", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.js?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/javascript", "size": 348, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-main.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-main.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 297, "checksum": null, "theme_id": 828155753}, {"key": "sections/content_section.liquid", "public_url": null, "created_at": "2016-02-11T14:31:50-05:00", "updated_at": "2016-02-11T14:31:50-05:00", "content_type": "application/x-liquid", "size": 997, "checksum": null, "theme_id": 828155753}, {"key": "templates/page.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 147, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-green.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-green.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1542, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.css", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.css?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "text/css", "size": 14058, "checksum": null, "theme_id": 828155753}, {"key": "config/settings_schema.json", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/json", "size": 4570, "checksum": null, "theme_id": 828155753}, {"key": "sections/product_section.liquid", "public_url": null, "created_at": "2016-02-14T16:31:41-05:00", "updated_at": "2016-02-14T16:31:41-05:00", "content_type": "application/x-liquid", "size": 2440, "checksum": null, "theme_id": 828155753}, {"key": "templates/blog.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 773, "checksum": null, "theme_id": 828155753}, {"key": "templates/article.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2486, "checksum": null, "theme_id": 828155753}, {"key": "templates/product.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2796, "checksum": null, "theme_id": 828155753}, {"key": "sections/footer_section.liquid", "public_url": null, "created_at": "2017-04-28T10:30:00-04:00", "updated_at": "2017-04-28T10:30:00-04:00", "content_type": "application/x-liquid", "size": 999, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-footer.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-footer.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1434, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-sidebar.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-sidebar.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 124, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-orange.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-orange.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1548, "checksum": null, "theme_id": 828155753}, {"key": "templates/collection.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 946, "checksum": null, "theme_id": 828155753}, {"key": "assets/sidebar-menu.jpg", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/sidebar-menu.jpg?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/jpeg", "size": 1609, "checksum": null, "theme_id": 828155753}, {"key": "templates/cart.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2047, "checksum": null, "theme_id": 828155753}, {"key": "config/settings_data.json", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/json", "size": 4570, "checksum": null, "theme_id": 828155753}, {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 1068, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1571, "checksum": null, "theme_id": 828155753}]})); + + await shopify.rest.Asset.all({ + session: session, + theme_id: 828155753, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2025-01-02T11:21:30-05:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "templates/index.liquid"; + asset.value = "

We are busy updating the store for you and will be back within the hour.

"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1735834893", "created_at": "2025-01-02T11:21:33-05:00", "updated_at": "2025-01-02T11:21:33-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "assets/empty.gif"; + asset.attachment = "R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==\n"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "assets/empty.gif", "attachment": "R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==\n"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1735834891", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2025-01-02T11:21:31-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "assets/bg-body.gif"; + asset.src = "http://example.com/new_bg.gif"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2025-01-02T11:21:30-05:00", "updated_at": "2025-01-02T11:21:30-05:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "layout/alternate.liquid"; + asset.source_key = "layout/theme.liquid"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "value": "\n

Featured Products

\n\n {% tablerow product in collections.frontpage.products cols:3 %}\n {{ product.featured_image | product_img_url: 'small' | img_tag }}\n

{{product.title}}

\n
    \n
  • {{product.price_min | money}}
  • \n
\n {% endtablerow %}\n
\n\n\n{{ content_for_index }}\n\n
\n {% assign article = pages.frontpage %}\n
\n {% if article.content != \"\" %}\n

{{ article.title }}

\n
\n {{ article.content }}\n
\n {% else %}\n
\n In Admin > Blogs & Pages, create a page with the handle frontpage and it will show up here.\n
\n {{ \"Learn more about handles\" | link_to \"http://wiki.shopify.com/Handle\" }}\n
\n {% endif %}\n
\n
\n", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 1068, "checksum": null, "theme_id": 828155753}})); + + await shopify.rest.Asset.all({ + session: session, + theme_id: 828155753, + asset: {"key": "templates/index.liquid"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: 'asset%5Bkey%5D=templates%2Findex.liquid', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"message": "assets/bg-body.gif was successfully deleted"})); + + await shopify.rest.Asset.delete({ + session: session, + theme_id: 828155753, + asset: {"key": "assets/bg-body.gif"}, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/themes/828155753/assets.json', + query: 'asset%5Bkey%5D=assets%2Fbg-body.gif', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/assigned_fulfillment_order.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/assigned_fulfillment_order.test.ts new file mode 100644 index 0000000000..46d60eee23 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/assigned_fulfillment_order.test.ts @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('AssignedFulfillmentOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000801, "created_at": "2025-01-02T11:31:47-05:00", "updated_at": "2025-01-02T11:31:47-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["create_fulfillment", "cancel_fulfillment_order"], "destination": {"id": 1042572133, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503297, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); + + await shopify.rest.AssignedFulfillmentOrder.all({ + session: session, + assignment_status: "cancellation_requested", + location_ids: ["24826418"], + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/assigned_fulfillment_orders.json', + query: 'assignment_status=cancellation_requested&location_ids%5B%5D=24826418', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/balance.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/balance.test.ts new file mode 100644 index 0000000000..c3fdb8f557 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/balance.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Balance resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"balance": [{"amount": "53.99", "currency": "USD"}]})); + + await shopify.rest.Balance.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/balance.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/blog.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/blog.test.ts new file mode 100644 index 0000000000..177908da5f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/blog.test.ts @@ -0,0 +1,280 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Blog resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/Blog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/Blog/241253187"}]})); + + await shopify.rest.Blog.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/Blog/382285388"}, {"id": 1008414251, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2025-01-02T11:30:30-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:30:30-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/Blog/1008414251"}]})); + + await shopify.rest.Blog.all({ + session: session, + since_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs.json', + query: 'since_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"id": 1008414248, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2025-01-02T11:30:23-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:30:23-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/Blog/1008414248"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.title = "Apple main blog"; + await blog.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs.json', + query: '', + headers, + data: { "blog": {"title": "Apple main blog"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"id": 1008414250, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2025-01-02T11:30:27-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:30:27-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/Blog/1008414250"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.title = "Apple main blog"; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await blog.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs.json', + query: '', + headers, + data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Blog.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/Blog/241253187"}})); + + await shopify.rest.Blog.find({ + session: session, + id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); + + await shopify.rest.Blog.find({ + session: session, + id: 241253187, + fields: "id,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: 'fields=id%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/Blog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2025-01-02T11:30:24-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/Blog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.title = "IPod Updates"; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"title": "IPod Updates"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2025-01-02T11:30:23-05:00", "feedburner": null, "feedburner_location": null, "created_at": "2025-01-02T11:29:59-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/Blog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.title = "IPod Updates"; + blog.handle = "ipod-updates"; + blog.commentable = "moderate"; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Blog.delete({ + session: session, + id: 241253187, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/blogs/241253187.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/cancellation_request.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/cancellation_request.test.ts new file mode 100644 index 0000000000..3e3df957ff --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/cancellation_request.test.ts @@ -0,0 +1,92 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('CancellationRequest resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000803, "created_at": "2025-01-02T11:35:24-05:00", "updated_at": "2025-01-02T11:35:24-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["create_fulfillment", "cancel_fulfillment_order"], "destination": {"id": 1042572135, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503299, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000803; + cancellation_request.message = "The customer changed his mind."; + await cancellation_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000803/cancellation_request.json', + query: '', + headers, + data: { "cancellation_request": {"message": "The customer changed his mind."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000804, "created_at": "2025-01-02T11:35:24-05:00", "updated_at": "2025-01-02T11:35:25-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold"], "destination": {"id": 1042572136, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503300, "shop_id": 548380009, "fulfillment_order_id": 1046000804, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000804; + await cancellation_request.accept({ + body: {"cancellation_request": {"message": "We had not started any processing yet."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000804/cancellation_request/accept.json', + query: '', + headers, + data: { "cancellation_request": {"message": "We had not started any processing yet."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000802, "created_at": "2025-01-02T11:35:23-05:00", "updated_at": "2025-01-02T11:35:24-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["create_fulfillment"], "destination": {"id": 1042572134, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503298, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000802; + await cancellation_request.reject({ + body: {"cancellation_request": {"message": "We have already sent the shipment out."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000802/cancellation_request/reject.json', + query: '', + headers, + data: { "cancellation_request": {"message": "We have already sent the shipment out."} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/carrier_service.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/carrier_service.test.ts new file mode 100644 index 0000000000..3921069be9 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/carrier_service.test.ts @@ -0,0 +1,135 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('CarrierService resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894960, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894960", "format": "json", "callback_url": "http://shipping.example.com/"}})); + + const carrier_service = new shopify.rest.CarrierService({session: session}); + carrier_service.name = "Shipping Rate Provider"; + carrier_service.callback_url = "http://shipping.example.com"; + carrier_service.service_discovery = true; + await carrier_service.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/carrier_services.json', + query: '', + headers, + data: { "carrier_service": {"name": "Shipping Rate Provider", "callback_url": "http://shipping.example.com", "service_discovery": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1036894956, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894956", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); + + await shopify.rest.CarrierService.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/carrier_services.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1036894957, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894957", "format": "json", "callback_url": "http://example.com/"}})); + + const carrier_service = new shopify.rest.CarrierService({session: session}); + carrier_service.id = 1036894957; + carrier_service.name = "Some new name"; + carrier_service.active = false; + await carrier_service.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/carrier_services/1036894957.json', + query: '', + headers, + data: { "carrier_service": {"name": "Some new name", "active": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894955, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894955", "format": "json", "callback_url": "http://example.com/"}})); + + await shopify.rest.CarrierService.find({ + session: session, + id: 1036894955, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/carrier_services/1036894955.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CarrierService.delete({ + session: session, + id: 1036894958, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/carrier_services/1036894958.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/checkout.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/checkout.test.ts new file mode 100644 index 0000000000..da70ba91c8 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/checkout.test.ts @@ -0,0 +1,280 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Checkout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2025-01-02T11:21:57-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1068673450", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "5cb4149503d186d8eec0ad2c4b9c6ea7", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2025-01-02T11:21:57-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/5cb4149503d186d8eec0ad2c4b9c6ea7", "line_items": [{"id": "26904b590b50d69f95497fac1dbab037", "key": "26904b590b50d69f95497fac1dbab037", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.line_items = [ + { + "variant_id": 39072856, + "quantity": 5 + } + ]; + await checkout.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: '', + headers, + data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2025-01-02T11:21:49-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339457, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1068673449", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "3f0973e8a98fc349c4e701d06885c9dd", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2025-01-02T11:21:49-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/3f0973e8a98fc349c4e701d06885c9dd", "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.email = "me@example.com"; + await checkout.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/checkouts.json', + query: '', + headers, + data: { "checkout": {"email": "me@example.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2025-01-02T11:21:53-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "b490a9220cd14d7344024f4874f640a6"; + await checkout.complete({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/checkouts/b490a9220cd14d7344024f4874f640a6/complete.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "421.88", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "421.88", "total_tax": "23.88", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}], "gift_cards": [], "tax_lines": [{"price": "23.88", "rate": 0.06, "title": "Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "bd5a8aa1ecd019dd3520ff791ee3a24c", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "421.88", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "421.88", "total_tax": "23.88", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2025-01-02T11:21:54-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}], "gift_cards": [], "tax_lines": [{"price": "23.88", "rate": 0.06, "title": "Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; + checkout.shipping_line = { + "handle": "shopify-Free%20Shipping-0.00" + }; + await checkout.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: { "checkout": {"shipping_line": {"handle": "shopify-Free%20Shipping-0.00"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339456, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "417.90", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "417.90", "total_tax": "19.90", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2025-01-02T11:21:44-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a?key=1d17203c6e8db05923bcff0a36789eb5", "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "9.95", "rate": 0.05, "title": "Tax", "channel_liable": false}]}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "9.95", "rate": 0.05, "title": "Tax", "channel_liable": false}]}], "gift_cards": [], "tax_lines": [{"price": "19.90", "rate": 0.05, "title": "Tax", "compare_at": 0.05}], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 921093900, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; + checkout.email = "john.smith@example.com"; + checkout.shipping_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "126 York St.", + "city": "Los Angeles", + "province_code": "CA", + "country_code": "US", + "phone": "(123)456-7890", + "zip": "90002" + }; + await checkout.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: { "checkout": {"email": "john.smith@example.com", "shipping_address": {"first_name": "John", "last_name": "Smith", "address1": "126 York St.", "city": "Los Angeles", "province_code": "CA", "country_code": "US", "phone": "(123)456-7890", "zip": "90002"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "23.88", "total_price": "421.88", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shipping_rates": []})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shipping_rates": []})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collect.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collect.test.ts new file mode 100644 index 0000000000..43fe7648de --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collect.test.ts @@ -0,0 +1,220 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Collect resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collect": {"id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2025-01-02T11:20:42-05:00", "updated_at": "2025-01-02T11:20:42-05:00", "position": 2, "sort_value": "0000000002"}})); + + const collect = new shopify.rest.Collect({session: session}); + collect.product_id = 921728736; + collect.collection_id = 841564295; + await collect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/collects.json', + query: '', + headers, + data: { "collect": {"product_id": 921728736, "collection_id": 841564295} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + + await shopify.rest.Collect.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559575, "collection_id": 841564295, "product_id": 921728736, "created_at": "2025-01-02T11:20:44-05:00", "updated_at": "2025-01-02T11:20:44-05:00", "position": 2, "sort_value": "0000000002"}]})); + + await shopify.rest.Collect.all({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + + await shopify.rest.Collect.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Collect.delete({ + session: session, + id: 455204334, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/collects/455204334.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); + + await shopify.rest.Collect.find({ + session: session, + id: 455204334, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects/455204334.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Collect.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Collect.count({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects/count.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Collect.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collects/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection.test.ts new file mode 100644 index 0000000000..17059bac2d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection.test.ts @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Collection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + await shopify.rest.Collection.find({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/ProductImage/850703190", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399"}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/ProductImage/562641783", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399"}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/ProductImage/378407906", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399"}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/ProductImage/850703190", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399"}}]})); + + await shopify.rest.Collection.products({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collections/841564295/products.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection_listing.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection_listing.test.ts new file mode 100644 index 0000000000..7757734ee9 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/collection_listing.test.ts @@ -0,0 +1,132 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('CollectionListing resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2025-01-02T11:09:43-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735834183"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2025-01-02T11:09:43-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735834183"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2025-01-02T11:09:43-05:00", "position": 1, "updated_at": "2025-01-02T11:09:43-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); + + await shopify.rest.CollectionListing.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collection_listings.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product_ids": [632910392]})); + + await shopify.rest.CollectionListing.product_ids({ + session: session, + collection_id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collection_listings/841564295/product_ids.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2025-01-02T11:09:43-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735834183"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + + await shopify.rest.CollectionListing.find({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collection_listings/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2025-01-02T11:09:43-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735834183"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + + const collection_listing = new shopify.rest.CollectionListing({session: session}); + collection_listing.collection_id = 482865238; + await collection_listing.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/collection_listings/482865238.json', + query: '', + headers, + data: { "collection_listing": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CollectionListing.delete({ + session: session, + collection_id: 841564295, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/collection_listings/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/comment.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/comment.test.ts new file mode 100644 index 0000000000..eba51e61cb --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/comment.test.ts @@ -0,0 +1,356 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Comment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + since_id: "118373535", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments.json', + query: 'since_id=118373535', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + article_id: "134645308", + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments.json', + query: 'article_id=134645308&blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments.json', + query: 'blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + article_id: "134645308", + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments/count.json', + query: 'article_id=134645308&blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments/count.json', + query: 'blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); + + await shopify.rest.Comment.find({ + session: session, + id: 118373535, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/comments/118373535.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2025-01-02T11:22:10-05:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:11-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 118373535; + comment.body = "You can even update through a web service."; + comment.author = "Your new name"; + comment.email = "your@updated-email.com"; + comment.published_at = "2025-01-02T16:22:10.772Z"; + await comment.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/comments/118373535.json', + query: '', + headers, + data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2025-01-02T16:22:10.772Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"comment": {"id": 757536351, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:22:08-05:00", "updated_at": "2025-01-02T11:22:08-05:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); + + const comment = new shopify.rest.Comment({session: session}); + comment.body = "I like comments\nAnd I like posting them *RESTfully*."; + comment.author = "Your name"; + comment.email = "your@email.com"; + comment.ip = "107.20.160.121"; + comment.blog_id = 241253187; + comment.article_id = 134645308; + await comment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments.json', + query: '', + headers, + data: { "comment": {"body": "I like comments\nAnd I like posting them *RESTfully*.", "author": "Your name", "email": "your@email.com", "ip": "107.20.160.121", "blog_id": 241253187, "article_id": 134645308} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:08-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.spam({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments/653537639/spam.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"published_at": "2025-01-02T11:22:07-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:07-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.not_spam({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments/653537639/not_spam.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"published_at": "2025-01-02T11:22:14-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:14-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.approve({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments/653537639/approve.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:18-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.remove({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments/653537639/remove.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"published_at": "2025-01-02T11:22:20-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:20-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.restore({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/comments/653537639/restore.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/country.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/country.test.ts new file mode 100644 index 0000000000..e5cc3f785f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/country.test.ts @@ -0,0 +1,197 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Country resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); + + await shopify.rest.Country.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); + + await shopify.rest.Country.all({ + session: session, + since_id: "359115488", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries.json', + query: 'since_id=359115488', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"country": {"id": 980881734, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/countries.json', + query: '', + headers, + data: { "country": {"code": "FR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"country": {"id": 980881733, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + country.tax = 0.2; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/countries.json', + query: '', + headers, + data: { "country": {"code": "FR", "tax": 0.2} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Country.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); + + await shopify.rest.Country.find({ + session: session, + id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/879921427.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"country_id": 879921427, "tax_name": "Tax", "id": 205434194, "name": "Alberta", "code": "AB", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 170405627, "name": "British Columbia", "code": "BC", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 342345110, "name": "Manitoba", "code": "MB", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 92264567, "name": "New Brunswick", "code": "NB", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 243284171, "name": "Newfoundland", "code": "NL", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 439598329, "name": "Northwest Territories", "code": "NT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 448070559, "name": "Nova Scotia", "code": "NS", "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 670206421, "name": "Nunavut", "code": "NU", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 702530425, "name": "Ontario", "code": "ON", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 570891722, "name": "Prince Edward Island", "code": "PE", "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 473391800, "name": "Saskatchewan", "code": "SK", "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 1005264686, "name": "Yukon", "code": "YT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); + + const country = new shopify.rest.Country({session: session}); + country.id = 879921427; + country.tax = 0.05; + await country.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/countries/879921427.json', + query: '', + headers, + data: { "country": {"tax": 0.05} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Country.delete({ + session: session, + id: 879921427, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/countries/879921427.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/currency.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/currency.test.ts new file mode 100644 index 0000000000..50d69f081b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/currency.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Currency resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"currencies": [{"currency": "CAD", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}, {"currency": "EUR", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}, {"currency": "JPY", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}]})); + + await shopify.rest.Currency.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/currencies.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/custom_collection.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/custom_collection.test.ts new file mode 100644 index 0000000000..3567321021 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/custom_collection.test.ts @@ -0,0 +1,527 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('CustomCollection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + ids: "395646240,691652237,841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: 'ids=395646240%2C691652237%2C841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001322, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:34:01-05:00", "body_html": null, "published_at": "2025-01-02T11:34:01-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001322"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + since_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: 'since_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.CustomCollection.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.CustomCollection.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + await shopify.rest.CustomCollection.find({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2025-01-02T11:33:59-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.collects = [ + { + "product_id": 921728736, + "position": 1 + }, + { + "id": 455204334, + "position": 2 + } + ]; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2008-02-01T19:00:00-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2025-01-02T11:33:52-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = false; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2025-01-02T11:34:03-05:00", "updated_at": "2025-01-02T11:34:03-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = true; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2025-01-02T11:33:35-05:00", "id": 841564295, "title": "IPods", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = ""; + custom_collection.updated_at = "2025-01-02T11:33:35-05:00"; + custom_collection.handle = "ipods"; + custom_collection.title = "IPods"; + custom_collection.body_html = "

The best selling ipod ever

"; + custom_collection.published_at = "2008-02-01T19:00:00-05:00"; + custom_collection.sort_order = "manual"; + custom_collection.template_suffix = null; + custom_collection.published_scope = "web"; + custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": "", "updated_at": "2025-01-02T11:33:35-05:00", "handle": "ipods", "title": "IPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2025-01-02T11:33:42-05:00", "id": 841564295, "handle": "ipods", "title": "IPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:33:42-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1735835622"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TB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0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsy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dAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2025-01-02T11:33:56-05:00", "id": 841564295, "handle": "ipods", "title": "IPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2025-01-02T11:33:54-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20250102-63224-g7onuw.gif?v=1735835636"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = { + "alt": "Rails logo" + }; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2025-01-02T11:33:31-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.body_html = "

5000 songs in your pocket

"; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CustomCollection.delete({ + session: session, + id: 841564295, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/custom_collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001311, "handle": "ipods-1", "title": "IPods", "updated_at": "2025-01-02T11:33:23-05:00", "body_html": null, "published_at": "2025-01-02T11:33:23-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001311"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "IPods"; + custom_collection.collects = [ + { + "product_id": 921728736 + } + ]; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001320, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:33:57-05:00", "body_html": null, "published_at": "2025-01-02T11:33:57-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001320"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001315, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:33:49-05:00", "body_html": null, "published_at": "2025-01-02T11:33:49-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001314, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:33:48-05:00", "body_html": null, "published_at": "2025-01-02T11:33:45-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001314", "image": {"created_at": "2025-01-02T11:33:46-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20250102-63224-29raj.gif?v=1735835628"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001319, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:33:57-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001319"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.published = false; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "published": false} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer.test.ts new file mode 100644 index 0000000000..3a3bac0b4f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer.test.ts @@ -0,0 +1,747 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Customer resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339462, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:27:00-05:00", "updated_at": "2025-01-02T11:27:00-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317292, "customer_id": 1073339462, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339462", "default_address": {"id": 1053317292, "customer_id": 1073339462, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:26:48-05:00", "updated_at": "2025-01-02T11:26:48-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + ids: "207119551,1073339462", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers.json', + query: 'ids=207119551%2C1073339462', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339464, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:28:14-05:00", "updated_at": "2025-01-02T11:28:14-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + since_id: "207119551", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers.json', + query: 'since_id=207119551', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:34-05:00", "updated_at": "2025-01-02T11:29:34-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + updated_at_min: "2025-01-01 16:29:45", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers.json', + query: 'updated_at_min=2025-01-01+16%3A29%3A45', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:25:34-05:00", "updated_at": "2025-01-02T11:25:34-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "tags": "L\u00E9on, No\u00EBl"}]})); + + await shopify.rest.Customer.all({ + session: session, + fields: "id,email,tags", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers.json', + query: 'fields=id%2Cemail%2Ctags', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:23:11-05:00", "updated_at": "2025-01-02T11:23:11-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "email:bob.norman@mail.example.com", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'query=email%3Abob.norman%40mail.example.com', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman"}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name", + query: "last_name:Norman", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name&query=last_name%3ANorman', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339460, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name, tags", + query: "customer_tag:New Customer", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name%2C+tags&query=customer_tag%3ANew+Customer', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:24:33-05:00", "updated_at": "2025-01-02T11:24:33-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "first_name:Bob country:United States", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'query=first_name%3ABob+country%3AUnited+States', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:28:42-05:00", "updated_at": "2025-01-02T11:28:42-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "email:*@mail.example.com", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'query=email%3A%2A%40mail.example.com', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339465, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name, verified_email", + query: "verified_email:true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name%2C+verified_email&query=verified_email%3Atrue', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:25:58-05:00", "updated_at": "2025-01-02T11:25:58-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + await shopify.rest.Customer.find({ + session: session, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "created_at": "2025-01-02T11:27:01-05:00", "updated_at": "2025-01-02T11:27:01-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "created_at": "2025-01-02T11:23:23-05:00", "updated_at": "2025-01-02T11:23:23-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.accepts_marketing = true; + customer.accepts_marketing_updated_at = "2024-12-30T11:23:34-05:00"; + customer.marketing_opt_in_level = "confirmed_opt_in"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2024-12-30T11:23:34-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "created_at": "2025-01-02T11:23:47-05:00", "updated_at": "2025-01-02T11:23:47-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.tags = "New Customer, Repeat Customer"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"tags": "New Customer, Repeat Customer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"email": "changed@example.com", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "created_at": "2025-01-02T11:24:21-05:00", "updated_at": "2025-01-02T11:24:32-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.email = "changed@example.com"; + customer.note = "Customer is a great guy"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"email": "changed@example.com", "note": "Customer is a great guy"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Customer.delete({ + session: session, + id: 207119551, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/customers/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"id": 1073339458, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:23:46-05:00", "updated_at": "2025-01-02T11:23:46-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339458", "default_address": {"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.password = "newpass"; + customer.password_confirmation = "newpass"; + customer.send_email_welcome = false; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "password": "newpass", "password_confirmation": "newpass", "send_email_welcome": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"id": 1073339459, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:24:21-05:00", "updated_at": "2025-01-02T11:24:21-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339459", "default_address": {"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.send_email_invite = true; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "send_email_invite": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"id": 1073339466, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:29:08-05:00", "updated_at": "2025-01-02T11:29:08-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339466", "default_address": {"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer": {"id": 1073339463, "email": "steve.lastnameson@example.com", "created_at": "2025-01-02T11:27:37-05:00", "updated_at": "2025-01-02T11:27:37-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339463", "default_address": {"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/11bae3857fe3f4ab2ff807da447dd1db-1735835208"})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.account_activation_url({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers/207119551/account_activation_url.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "subject": "Welcome to my new shop", "custom_message": "My awesome new store", "bcc": ["j.limited@example.com"]}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.send_invite({ + body: {"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "bcc": ["j.limited@example.com"], "subject": "Welcome to my new shop", "custom_message": "My awesome new store"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers/207119551/send_invite.json', + query: '', + headers, + data: {"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "bcc": ["j.limited@example.com"], "subject": "Welcome to my new shop", "custom_message": "My awesome new store"}} + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_invite": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Customer account activation", "custom_message": "", "bcc": []}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.send_invite({ + body: {"customer_invite": {}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers/207119551/send_invite.json', + query: '', + headers, + data: {"customer_invite": {}} + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + updated_at_min: "2025-01-01 16:27:48", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/count.json', + query: 'updated_at_min=2025-01-01+16%3A27%3A48', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + created_at_min: "2025-01-01 16:25:57", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/count.json', + query: 'created_at_min=2025-01-01+16%3A25%3A57', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:27:13-05:00", "updated_at": "2025-01-02T11:27:13-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:27:13-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:27:13-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:27:13-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:27:13-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Customer.orders({ + session: session, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:25:09-05:00", "updated_at": "2025-01-02T11:25:09-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:25:09-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:25:09-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:25:09-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:25:09-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Customer.orders({ + session: session, + id: 207119551, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/orders.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer_address.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer_address.test.ts new file mode 100644 index 0000000000..3a3a9b14bd --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/customer_address.test.ts @@ -0,0 +1,243 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('CustomerAddress resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}]})); + + await shopify.rest.CustomerAddress.all({ + session: session, + customer_id: 207119551, + limit: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses.json', + query: 'limit=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}]})); + + await shopify.rest.CustomerAddress.all({ + session: session, + customer_id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + await shopify.rest.CustomerAddress.find({ + session: session, + customer_id: 207119551, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_address": {"customer_id": 207119551, "zip": "90210", "country": "United States", "province": "Kentucky", "city": "Louisville", "address1": "Chestnut Street 92", "address2": "", "first_name": null, "last_name": null, "company": null, "phone": "555-625-1199", "id": 207119551, "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 207119551; + customer_address.zip = "90210"; + await customer_address.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: { "address": {"zip": "90210"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_address": {"customer_id": 207119551, "address1": "Apartment 23", "address2": "Chestnut Street 92", "country": "United States", "province": "Kentucky", "zip": "40202", "city": "Louisville", "first_name": null, "last_name": null, "company": null, "phone": "555-625-1199", "id": 207119551, "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 207119551; + customer_address.address1 = "Apartment 23"; + customer_address.address2 = "Chestnut Street 92"; + await customer_address.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: { "address": {"address1": "Apartment 23", "address2": "Chestnut Street 92"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CustomerAddress.delete({ + session: session, + customer_id: 207119551, + id: 1053317310, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/1053317310.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317309, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.address1 = "1 Rue des Carrieres"; + customer_address.address2 = "Suite 1234"; + customer_address.city = "Montreal"; + customer_address.company = "Fancy Co."; + customer_address.first_name = "Samuel"; + customer_address.last_name = "de Champlain"; + customer_address.phone = "819-555-5555"; + customer_address.province = "Quebec"; + customer_address.country = "Canada"; + customer_address.zip = "G1R 4P5"; + customer_address.name = "Samuel de Champlain"; + customer_address.province_code = "QC"; + customer_address.country_code = "CA"; + customer_address.country_name = "Canada"; + await customer_address.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses.json', + query: '', + headers, + data: { "address": {"address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "company": "Fancy Co.", "first_name": "Samuel", "last_name": "de Champlain", "phone": "819-555-5555", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + await customer_address.set({ + address_ids: ["1053317311"], + operation: "destroy", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/set.json', + query: 'address_ids%5B%5D=1053317311&operation=destroy', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317312, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 1053317312; + await customer_address.default({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551/addresses/1053317312/default.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/deprecated_api_call.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/deprecated_api_call.test.ts new file mode 100644 index 0000000000..3eee003471 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/deprecated_api_call.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('DeprecatedApiCall resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"data_updated_at": "2020-10-13T00:15:30Z", "deprecated_api_calls": [{"api_type": "REST", "description": "The page filter has been removed from multiple endpoints. Use cursor-based pagination instead.", "documentation_url": "https://shopify.dev/api/usage/pagination-rest", "endpoint": "Product", "last_call_at": "2020-06-12T03:46:18Z", "migration_deadline": "2020-07-02T13:00:00Z", "graphql_schema_name": null, "version": "2019-07"}]})); + + await shopify.rest.DeprecatedApiCall.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/deprecated_api_calls.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/discount_code.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/discount_code.test.ts new file mode 100644 index 0000000000..a5152d8d82 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/discount_code.test.ts @@ -0,0 +1,227 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('DiscountCode resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_code": {"id": 1057371196, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2025-01-02T11:31:50-05:00", "updated_at": "2025-01-02T11:31:50-05:00"}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + discount_code.code = "SUMMERSALE10OFF"; + await discount_code.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules/507328175/discount_codes.json', + query: '', + headers, + data: { "discount_code": {"code": "SUMMERSALE10OFF"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00"}]})); + + await shopify.rest.DiscountCode.all({ + session: session, + price_rule_id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/507328175/discount_codes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:31:48-05:00"}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + discount_code.id = 507328175; + discount_code.code = "WINTERSALE20OFF"; + await discount_code.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: { "discount_code": {"code": "WINTERSALE20OFF"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00"}})); + + await shopify.rest.DiscountCode.find({ + session: session, + price_rule_id: 507328175, + id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.DiscountCode.delete({ + session: session, + price_rule_id: 507328175, + id: 507328175, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.DiscountCode.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/discount_codes/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2025-01-02T11:31:50-05:00", "updated_at": "2025-01-02T11:31:50-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + await discount_code.batch({ + body: {"discount_codes": [{"code": "SUMMER1"}, {"code": "SUMMER2"}, {"code": "SUMMER3"}]}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules/507328175/batch.json', + query: '', + headers, + data: {"discount_codes": [{"code": "SUMMER1"}, {"code": "SUMMER2"}, {"code": "SUMMER3"}]} + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + + await shopify.rest.DiscountCode.get_all({ + session: session, + price_rule_id: 507328175, + batch_id: 173232803, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/507328175/batch/173232803.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"discount_codes": [{"id": null, "code": "foo", "errors": {}}, {"id": null, "code": "", "errors": {}}, {"id": null, "code": "bar", "errors": {}}]})); + + await shopify.rest.DiscountCode.all({ + session: session, + price_rule_id: 507328175, + batch_id: 173232803, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/507328175/batch/173232803/discount_codes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute.test.ts new file mode 100644 index 0000000000..7fbdb507d0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute.test.ts @@ -0,0 +1,111 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Dispute resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 815713555, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "credit_not_processed", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 670893524, "order_id": 625362839, "type": "inquiry", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": null, "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 297752803, "order_id": 625362839, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "lost", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 257169523, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 85190714, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "under_review", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": "2099-12-30T19:00:00-05:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 46484353, "order_id": 625362839, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "lost", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 35982383, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "subscription_canceled", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + initiated_at: "2013-05-03", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes.json', + query: 'initiated_at=2013-05-03', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 815713555, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "credit_not_processed", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 670893524, "order_id": 625362839, "type": "inquiry", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": null, "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 297752803, "order_id": 625362839, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "lost", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 257169523, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 85190714, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "under_review", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": "2099-12-30T19:00:00-05:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 46484353, "order_id": 625362839, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "lost", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 35982383, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "subscription_canceled", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + status: "won", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes.json', + query: 'status=won', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"dispute": {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2099-12-29T19:00:00-05:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}})); + + await shopify.rest.Dispute.find({ + session: session, + id: 598735659, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_evidence.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_evidence.test.ts new file mode 100644 index 0000000000..e7a75d77af --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_evidence.test.ts @@ -0,0 +1,113 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('DisputeEvidence resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"dispute_evidence": {"id": 819974671, "payments_dispute_id": 598735659, "access_activity_log": null, "billing_address": {"id": 867402159, "address1": "123 Amoebobacterieae St", "address2": "", "city": "Ottawa", "province": "Ontario", "province_code": "ON", "country": "Canada", "country_code": "CA", "zip": "K2P0V6"}, "cancellation_policy_disclosure": null, "cancellation_rebuttal": null, "customer_email_address": "example@shopify.com", "customer_first_name": "Kermit", "customer_last_name": "the Frog", "product_description": "Product name: Draft\nTitle: 151cm\nPrice: $10.00\nQuantity: 1\nProduct Description: good board", "refund_policy_disclosure": null, "refund_refusal_explanation": null, "shipping_address": {"id": 867402159, "address1": "123 Amoebobacterieae St", "address2": "", "city": "Ottawa", "province": "Ontario", "province_code": "ON", "country": "Canada", "country_code": "CA", "zip": "K2P0V6"}, "uncategorized_text": "Sample uncategorized text", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:43-05:00", "submitted_by_merchant_on": null, "fulfillments": [{"shipping_carrier": "UPS", "shipping_tracking_number": "1234", "shipping_date": "2017-01-01"}, {"shipping_carrier": "FedEx", "shipping_tracking_number": "4321", "shipping_date": "2017-01-02"}], "dispute_evidence_files": {"cancellation_policy_file_id": null, "customer_communication_file_id": 539650252, "customer_signature_file_id": 799719586, "refund_policy_file_id": null, "service_documentation_file_id": null, "shipping_documentation_file_id": 799719586, "uncategorized_file_id": 567271523}}})); + + await shopify.rest.DisputeEvidence.find({ + session: session, + dispute_id: 598735659, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659/dispute_evidences.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"dispute_evidence": {"id": 819974671, "payments_dispute_id": 598735659, "access_activity_log": null, "billing_address": {"id": 867402159, "address1": "123 Amoebobacterieae St", "address2": "", "city": "Ottawa", "province": "Ontario", "province_code": "ON", "country": "Canada", "country_code": "CA", "zip": "K2P0V6"}, "cancellation_policy_disclosure": null, "cancellation_rebuttal": null, "customer_email_address": "example@shopify.com", "customer_first_name": "Kermit", "customer_last_name": "the Frog", "product_description": "Product name: Draft\nTitle: 151cm\nPrice: $10.00\nQuantity: 1\nProduct Description: good board", "refund_policy_disclosure": null, "refund_refusal_explanation": null, "shipping_address": {"id": 867402159, "address1": "123 Amoebobacterieae St", "address2": "", "city": "Ottawa", "province": "Ontario", "province_code": "ON", "country": "Canada", "country_code": "CA", "zip": "K2P0V6"}, "uncategorized_text": "Sample uncategorized text", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:42-05:00", "submitted_by_merchant_on": "2025-01-02T11:22:42-05:00", "fulfillments": [{"shipping_carrier": "UPS", "shipping_tracking_number": "1234", "shipping_date": "2017-01-01"}, {"shipping_carrier": "FedEx", "shipping_tracking_number": "4321", "shipping_date": "2017-01-02"}], "dispute_evidence_files": {"cancellation_policy_file_id": null, "customer_communication_file_id": 539650252, "customer_signature_file_id": 799719586, "refund_policy_file_id": null, "service_documentation_file_id": null, "shipping_documentation_file_id": 799719586, "uncategorized_file_id": 567271523}}})); + + const dispute_evidence = new shopify.rest.DisputeEvidence({session: session}); + dispute_evidence.dispute_id = 598735659; + dispute_evidence.submit_evidence = true; + await dispute_evidence.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659/dispute_evidences.json', + query: '', + headers, + data: { "dispute_evidence": {"submit_evidence": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"dispute_evidence": {"id": 819974671, "payments_dispute_id": 598735659, "access_activity_log": "https://example.com/access-activity-log", "billing_address": {"id": 867402159, "address1": "1 Infinite Loop", "address2": "Muppet Studio", "city": "Cupertino", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "95014"}, "cancellation_policy_disclosure": "https://example.com/cancellation-policy", "cancellation_rebuttal": "https://example.com/cancellation-rebuttal", "customer_email_address": "customer@example.com", "customer_first_name": "John", "customer_last_name": "Doe", "product_description": "Product name: Draft\nTitle: 151cm\nPrice: $10.00\nQuantity: 1\nProduct Description: good board", "refund_policy_disclosure": "https://example.com/refund-policy", "refund_refusal_explanation": "Product must have receipt of proof of purchase", "shipping_address": {"id": 867402159, "address1": "1 Infinite Loop", "address2": "Muppet Studio", "city": "Cupertino", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "95014"}, "uncategorized_text": "Any additional notes", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:22:43-05:00", "submitted_by_merchant_on": null, "fulfillments": [{"shipping_carrier": "UPS", "shipping_tracking_number": "1234", "shipping_date": "2017-01-01"}, {"shipping_carrier": "FedEx", "shipping_tracking_number": "4321", "shipping_date": "2017-01-02"}, {"shipping_carrier": "FedEx", "shipping_tracking_number": "4321", "shipping_date": "2017-01-02"}], "dispute_evidence_files": {"cancellation_policy_file_id": null, "customer_communication_file_id": 539650252, "customer_signature_file_id": 799719586, "refund_policy_file_id": null, "service_documentation_file_id": null, "shipping_documentation_file_id": 799719586, "uncategorized_file_id": 567271523}}})); + + const dispute_evidence = new shopify.rest.DisputeEvidence({session: session}); + dispute_evidence.dispute_id = 598735659; + dispute_evidence.access_activity_log = "https://example.com/access-activity-log"; + dispute_evidence.cancellation_policy_disclosure = "https://example.com/cancellation-policy"; + dispute_evidence.cancellation_rebuttal = "https://example.com/cancellation-rebuttal"; + dispute_evidence.customer_email_address = "customer@example.com"; + dispute_evidence.customer_first_name = "John"; + dispute_evidence.customer_last_name = "Doe"; + dispute_evidence.refund_policy_disclosure = "https://example.com/refund-policy"; + dispute_evidence.refund_refusal_explanation = "Product must have receipt of proof of purchase"; + dispute_evidence.uncategorized_text = "Any additional notes"; + dispute_evidence.shipping_address_attributes = { + "address1": "1 Infinite Loop", + "address2": "Muppet Studio", + "city": "Cupertino", + "zip": "95014", + "country_code": "US", + "province_code": "CA" + }; + dispute_evidence.fulfillments_attributes = [ + { + "shipping_carrier": "FedEx", + "shipping_tracking_number": 4321, + "shipping_date": "2017-01-02T13:00:00+00:00" + } + ]; + await dispute_evidence.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659/dispute_evidences.json', + query: '', + headers, + data: { "dispute_evidence": {"access_activity_log": "https://example.com/access-activity-log", "cancellation_policy_disclosure": "https://example.com/cancellation-policy", "cancellation_rebuttal": "https://example.com/cancellation-rebuttal", "customer_email_address": "customer@example.com", "customer_first_name": "John", "customer_last_name": "Doe", "refund_policy_disclosure": "https://example.com/refund-policy", "refund_refusal_explanation": "Product must have receipt of proof of purchase", "uncategorized_text": "Any additional notes", "shipping_address_attributes": {"address1": "1 Infinite Loop", "address2": "Muppet Studio", "city": "Cupertino", "zip": "95014", "country_code": "US", "province_code": "CA"}, "fulfillments_attributes": [{"shipping_carrier": "FedEx", "shipping_tracking_number": 4321, "shipping_date": "2017-01-02T13:00:00+00:00"}]} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_file_upload.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_file_upload.test.ts new file mode 100644 index 0000000000..a7c9dc0185 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/dispute_file_upload.test.ts @@ -0,0 +1,72 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('DisputeFileUpload resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"dispute_file_upload": {"id": 1047018778, "shop_id": 220006451, "file_size": 34509, "file_type": "application/pdf", "original_filename": "test.pdf", "filename": "4a32338f-3f15-4f85-8de4-3c17e92b7bbe.pdf", "created_at": "2025-01-02T11:30:22-05:00", "updated_at": "2025-01-02T11:30:22-05:00", "dispute_evidence_id": 819974671, "dispute_evidence_type": "uncategorized_file", "url": "https://unittest.storage.googleapis.com/s/files/1/0002/2000/6451/payments_file_uploads/4a32338f-3f15-4f85-8de4-3c17e92b7bbe.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=shopify-core-gcs-test%40shopify-tiers.iam.gserviceaccount.com%2F20200912%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=2025-01-02T16:30:22Z&X-Goog-Expires=604800&X-Goog-SignedHeaders=host&response-content-disposition=&X-Goog-Signature=87811646776a232917997f6a4595871d9123629da45d35b2b915e7210eececff55a58147e79ac636861617cc21b5a2f\n 6e5ea6547d9a20e9503e64caca84c9043ecccbf27d20142118017c60d2418edb7896c53eb466335fca\n 9153d8d73c15645962eace819a3588301d55bcbc5b4ecf2225561de914b104e2069daa400e741a59a\n 306d094f7b147c0ae2215f8203e4ce20a907c983a2e4be074c584725bd1c9e399f633499531160dac25\n b34054527795ef5ea48a4ac1d392585d4bc0976d62cab57e18d33547c9110599f39368983e4c88275790\n 0bac1eddcb41b87d4d26269bfe01b0161ef0a81088a0e4d6596380f4d3d37e4e72a8c5fefc6bc07551efb59"}})); + + const dispute_file_upload = new shopify.rest.DisputeFileUpload({session: session}); + dispute_file_upload.dispute_id = 598735659; + dispute_file_upload.document_type = "uncategorized_file"; + dispute_file_upload.filename = "test.pdf"; + dispute_file_upload.mimetype = "application/pdf"; + dispute_file_upload.data = "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAG1nFtvHMd2hd/nV0zeKEBnztxJIk+OfQ6QIBZkWHEegjxQFC3pgCJpUzTy8/OtWquqq+dCjmJEAnq6q/Z979pVtaubv01/mv42veT/5nI9PT9fT3+/mf7n9G761+8fF9Prx+m8/H+8Bmo+W679rJuLy9nF+eXFxfR8MZ/N15PrL9N/eQfMfDHfTN9dT9ebApufd1+mf333bjFdTN/9Ov2v6dm/3//+arqent18eTX9y2Z6NuVnezE9+/xqup2cPTy+AvLsaafzw/0t3dOz4FYcAwtzeva1XGvP1ZdXE1G/cfPrUed14XF/Z/QbPxow8E+WsVH78PnVBB4PZmU8o7nl7mMFvbGgvUyzEfMfEGyFJnfh2xCf6l2Y313Vhhjjynx9vRLVSbPed1hxibp3N1d3oP339N2/Tf/2rrj4iPO2l+ez1XLanDdfryYvOu/zB3nLTlvKa1jtL/jr853bs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MwIC9Sb290IDEzIDAgUiAvSW5mbyAxIDAgUiAvSUQgWyA8YWFkYjdhZjU5ZjIxNWE0Y2U4Y2QzZWIwYzFiNmNjNTc+CjxhYWRiN2FmNTlmMjE1YTRjZThjZDNlYjBjMWI2Y2M1Nz4gXSA+PgpzdGFydHhyZWYKMzM3NTEKJSVFT0YK"; + await dispute_file_upload.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659/dispute_file_uploads.json', + query: '', + headers, + data: { "dispute_file_upload": {"document_type": "uncategorized_file", "filename": "test.pdf", "mimetype": "application/pdf", "data": "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAG1nFtvHMd2hd/nV0zeKEBnztxJIk+OfQ6QIBZkWHEegjxQFC3pgCJpUzTy8/OtWquqq+dCjmJEAnq6q/Z979pVtaubv01/mv42veT/5nI9PT9fT3+/mf7n9G761+8fF9Prx+m8/H+8Bmo+W679rJuLy9nF+eXFxfR8MZ/N15PrL9N/eQfMfDHfTN9dT9ebApufd1+mf333bjFdTN/9Ov2v6dm/3//+arqent18eTX9y2Z6NuVnezE9+/xqup2cPTy+AvLsaafzw/0t3dOz4FYcAwtzeva1XGvP1ZdXE1G/cfPrUed14XF/Z/QbPxow8E+WsVH78PnVBB4PZmU8o7nl7mMFvbGgvUyzEfMfEGyFJnfh2xCf6l2Y313Vhhjjynx9vRLVSbPed1hxibp3N1d3oP339N2/Tf/2rrj4iPO2l+ez1XLanDdfryYvOu/zB3nLTlvKa1jtL/jr853bsYmsDthEYE9uTWdgpVXBvf380f0Bu73yI84SzQZ3ZWKh3ZpllQU6ByvUq0BYqUZXmL0X9cnZjX6mZzhYBrv3E8YcsfxRz0N3gAsFtIsIk7MqQqjchnZ4V1HS2gQ/AGVHFkH/sESfgx3tdmlUW8UosWBh3NF6MK1P/gmpKBOKY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TEKJSVFT0YK"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.DisputeFileUpload.delete({ + session: session, + dispute_id: 598735659, + id: 799719586, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/shopify_payments/disputes/598735659/dispute_file_uploads/799719586.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/draft_order.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/draft_order.test.ts new file mode 100644 index 0000000000..8ec3c525ca --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/draft_order.test.ts @@ -0,0 +1,578 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('DraftOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:27-05:00", "updated_at": "2025-01-02T11:34:27-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630385, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "1.80"}], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "api_client_id": 755357713, "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/305ddbf7f99c454f1790c33952227ae8", "created_on_api_version": null, "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "1.80"}], "tags": "", "note_attributes": [], "total_price": "31.80", "subtotal_price": "30.00", "total_tax": "1.80", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "31.80", "currency_code": "USD"}, "presentment_money": {"amount": "31.80", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.80", "currency_code": "USD"}, "presentment_money": {"amount": "1.80", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "31.80", "currency_code": "USD"}, "presentment_money": {"amount": "31.80", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 2 + } + ]; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.00", + "title": "Custom" + }; + draft_order.customer = { + "id": 207119551 + }; + draft_order.use_customer_default_address = true; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:29-05:00", "updated_at": "2025-01-02T11:34:29-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630387, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630387"}], "api_client_id": 755357713, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/66834ff2e9e2cc5ca4e467b29e5038e3", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 1, + "applied_discount": { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "2.0", + "title": "Custom" + } + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:28-05:00", "updated_at": "2025-01-02T11:34:28-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "2.40"}], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "api_client_id": 755357713, "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/550b83ece89cb4f4d990f37a08793d8e", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "2.40"}], "tags": "", "note_attributes": [], "total_price": "42.40", "subtotal_price": "40.00", "total_tax": "2.40", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "42.40", "currency_code": "USD"}, "presentment_money": {"amount": "42.40", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.40", "currency_code": "USD"}, "presentment_money": {"amount": "2.40", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "42.40", "currency_code": "USD"}, "presentment_money": {"amount": "42.40", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 2 + } + ]; + draft_order.customer = { + "id": 207119551 + }; + draft_order.use_customer_default_address = true; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:16-05:00", "updated_at": "2025-01-02T11:34:16-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630383, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "api_client_id": 755357713, "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/227ace46b94425496bdca915ea44eb0e", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": {"id": 1073339478, "email": null, "created_at": "2025-01-02T11:34:16-05:00", "updated_at": "2025-01-02T11:34:16-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339478", "default_address": {"id": 1053317306, "customer_id": 1073339478, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + draft_order.billing_address = { + "first_name": "Bob", + "last_name": "Norman", + "address1": "123 Main St", + "city": "Anytown", + "province": "ON", + "country": "Canada", + "zip": "A1B2C3", + "phone": "555-555-5555" + }; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "billing_address": {"first_name": "Bob", "last_name": "Norman", "address1": "123 Main St", "city": "Anytown", "province": "ON", "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:13-05:00", "updated_at": "2025-01-02T11:34:13-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630381, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "api_client_id": 755357713, "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f01ba754078eab3d971971e674db356d", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 1073339477, "email": null, "created_at": "2025-01-02T11:34:13-05:00", "updated_at": "2025-01-02T11:34:13-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339477", "default_address": {"id": 1053317305, "customer_id": 1073339477, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + draft_order.shipping_address = { + "first_name": "Bob", + "last_name": "Norman", + "address1": "123 Main St", + "city": "Anytown", + "province": "ON", + "country": "Canada", + "zip": "A1B2C3", + "phone": "555-555-5555" + }; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "shipping_address": {"first_name": "Bob", "last_name": "Norman", "address1": "123 Main St", "city": "Anytown", "province": "ON", "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:24-05:00", "updated_at": "2025-01-02T11:34:24-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630384, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "api_client_id": 755357713, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f6c787434a8e0d6ca9dbd36ff10b150d", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 1, + "applied_discount": { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.0", + "title": "Custom" + } + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:34:12-05:00", "updated_at": "2025-01-02T11:34:12-05:00", "tax_exempt": false, "completed_at": null, "name": "#D3", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "api_client_id": 755357713, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/9c6f89115462495544d70e33c17adf57", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "431.88", "subtotal_price": "398.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "431.88", "currency_code": "USD"}, "presentment_money": {"amount": "431.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "885.56", "subtotal_price": "826.00", "total_tax": "49.56", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "885.56", "currency_code": "USD"}, "presentment_money": {"amount": "885.56", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "49.56", "currency_code": "USD"}, "presentment_money": {"amount": "49.56", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "api_client_id": 755357713, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "220.94", "subtotal_price": "199.00", "total_tax": "11.94", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "220.94", "currency_code": "USD"}, "presentment_money": {"amount": "220.94", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.64", "currency_code": "USD"}, "presentment_money": {"amount": "11.64", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "api_client_id": 1354745, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "232.88", "subtotal_price": "199.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "232.88", "currency_code": "USD"}, "presentment_money": {"amount": "232.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); + + await shopify.rest.DraftOrder.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "431.88", "subtotal_price": "398.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "431.88", "currency_code": "USD"}, "presentment_money": {"amount": "431.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "885.56", "subtotal_price": "826.00", "total_tax": "49.56", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "885.56", "currency_code": "USD"}, "presentment_money": {"amount": "885.56", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "49.56", "currency_code": "USD"}, "presentment_money": {"amount": "49.56", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "api_client_id": 755357713, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "220.94", "subtotal_price": "199.00", "total_tax": "11.94", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "220.94", "currency_code": "USD"}, "presentment_money": {"amount": "220.94", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.64", "currency_code": "USD"}, "presentment_money": {"amount": "11.64", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "api_client_id": 1354745, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "232.88", "subtotal_price": "199.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "232.88", "currency_code": "USD"}, "presentment_money": {"amount": "232.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); + + await shopify.rest.DraftOrder.all({ + session: session, + since_id: "123", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: 'since_id=123', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "created_at": "2025-01-02T11:29:59-05:00", "name": "#D1", "total_price": "431.88"}, {"id": 622762746, "created_at": "2025-01-02T11:29:59-05:00", "name": "#D1", "total_price": "885.56"}, {"id": 691042898, "created_at": "2025-01-02T11:29:59-05:00", "name": "#D1", "total_price": "220.94"}, {"id": 994118539, "created_at": "2025-01-02T11:29:59-05:00", "name": "#D2", "total_price": "217.89"}, {"id": 1012750869, "created_at": "2025-01-02T11:29:59-05:00", "name": "#D2", "total_price": "232.88"}]})); + + await shopify.rest.DraftOrder.all({ + session: session, + fields: "created_at,id,name,total-price", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: 'fields=created_at%2Cid%2Cname%2Ctotal-price', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "431.88", "subtotal_price": "398.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "431.88", "currency_code": "USD"}, "presentment_money": {"amount": "431.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "398.00", "currency_code": "USD"}, "presentment_money": {"amount": "398.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "885.56", "subtotal_price": "826.00", "total_tax": "49.56", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "885.56", "currency_code": "USD"}, "presentment_money": {"amount": "885.56", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "49.56", "currency_code": "USD"}, "presentment_money": {"amount": "49.56", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "api_client_id": 755357713, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "created_on_api_version": null, "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "220.94", "subtotal_price": "199.00", "total_tax": "11.94", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "220.94", "currency_code": "USD"}, "presentment_money": {"amount": "220.94", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.64", "currency_code": "USD"}, "presentment_money": {"amount": "11.64", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "api_client_id": 1354745, "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "created_on_api_version": null, "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "232.88", "subtotal_price": "199.00", "total_tax": "23.88", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "232.88", "currency_code": "USD"}, "presentment_money": {"amount": "232.88", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "23.88", "currency_code": "USD"}, "presentment_money": {"amount": "23.88", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); + + await shopify.rest.DraftOrder.all({ + session: session, + updated_at_min: "2005-07-31T15:57:11-04:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders.json', + query: 'updated_at_min=2005-07-31T15%3A57%3A11-04%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:25-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "10.75"}], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": true, "handle": null, "price": "12.25"}, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "10.75"}], "tags": "Wholesale", "note_attributes": [], "total_price": "202.10", "subtotal_price": "179.10", "total_tax": "10.75", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "202.10", "currency_code": "USD"}, "presentment_money": {"amount": "202.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "10.75", "currency_code": "USD"}, "presentment_money": {"amount": "10.75", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "202.10", "currency_code": "USD"}, "presentment_money": {"amount": "202.10", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "19.90", + "title": "Custom" + }; + await draft_order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/994118539.json', + query: '', + headers, + data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:23-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "11.64"}], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": "$5promo", "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": true, "handle": null, "price": "12.25"}, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "11.64"}], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.64", "currency_code": "USD"}, "presentment_money": {"amount": "11.64", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + draft_order.note = "Customer contacted us about a custom engraving on this iPod"; + await draft_order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/994118539.json', + query: '', + headers, + data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:14-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 1066630382, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "11.64"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": "$5promo", "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": true, "handle": null, "price": "12.25"}, "tax_lines": [{"rate": 0.06, "title": "Tax", "price": "11.64"}], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "11.64", "currency_code": "USD"}, "presentment_money": {"amount": "11.64", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_now_set": {"shop_money": {"amount": "217.89", "currency_code": "USD"}, "presentment_money": {"amount": "217.89", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/994118539.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "created_on_api_version": null, "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "eyJhbGciOiJIUzI1NiJ9.eyJ0aXRsZSI6IlVQUyBHcm91bmQiLCJjb2RlIjoiMyIsInNvdXJjZSI6InVwcyIsInByaWNlIjoiMTIuMjUiLCJjdXJyZW5jeSI6IlVTRCIsImVzdGltYXRlZF9kZWxpdmVyeV90aW1lX3JhbmdlIjpudWxsLCJncm91cF9pZCI6bnVsbH0.-OHCLb12F-7O9SJekdvEcA1aN8teIoR0fcOISE4Y3Uc", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "217.89", "subtotal_price": "194.00", "total_tax": "11.64", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "L\u00E9on, No\u00EBl", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + await shopify.rest.DraftOrder.find({ + session: session, + id: 994118539, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders/994118539.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.DraftOrder.delete({ + session: session, + id: 994118539, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/draft_orders/994118539.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 5})); + + await shopify.rest.DraftOrder.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.send_invoice({ + body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders/994118539/send_invoice.json', + query: '', + headers, + data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "\"John Smith Test Store\" ", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.send_invoice({ + body: {"draft_order_invoice": {}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders/994118539/send_invoice.json', + query: '', + headers, + data: {"draft_order_invoice": {}} + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:20-05:00", "tax_exempt": false, "completed_at": "2025-01-02T11:34:20-05:00", "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "created_on_api_version": null, "applied_discount": null, "order_id": 1073459985, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "885.56", "subtotal_price": "826.00", "total_tax": "49.56", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "885.56", "currency_code": "USD"}, "presentment_money": {"amount": "885.56", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "49.56", "currency_code": "USD"}, "presentment_money": {"amount": "49.56", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:20-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317307, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": null, "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 622762746; + await draft_order.complete({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/complete.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"draft_order": {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:22-05:00", "tax_exempt": false, "completed_at": "2025-01-02T11:34:22-05:00", "name": "#D1", "allow_discount_codes_in_checkout?": false, "b2b?": false, "status": "completed", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "api_client_id": 1354745, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "created_on_api_version": null, "applied_discount": null, "order_id": 1073459986, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "885.56", "subtotal_price": "826.00", "total_tax": "49.56", "payment_terms": null, "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "885.56", "currency_code": "USD"}, "presentment_money": {"amount": "885.56", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "49.56", "currency_code": "USD"}, "presentment_money": {"amount": "49.56", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_additional_fees_set": null, "total_duties_set": null, "amount_due_now_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "amount_due_later_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:22-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "currency": "USD", "phone": "+16136120707", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317308, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": null, "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 622762746; + await draft_order.complete({ + payment_pending: "true", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/complete.json', + query: 'payment_pending=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/event.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/event.test.ts new file mode 100644 index 0000000000..39829a4a1e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/event.test.ts @@ -0,0 +1,267 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Event resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 103105390, "subject_id": 450789469, "created_at": "2008-01-10T05:00:00-05:00", "subject_type": "Order", "verb": "authorization_success", "arguments": ["389404469", "210.94", "USD"], "body": null, "message": "A transaction was authorized.", "author": "Shopify", "description": "A transaction was authorized.", "path": "/admin/orders/450789469"}, {"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 852065041, "subject_id": 450789469, "created_at": "2008-01-10T09:00:00-05:00", "subject_type": "Order", "verb": "placed", "arguments": [], "body": null, "message": "This order was created for Bob Norman from draft order #D1.", "author": "Shopify", "description": "This order was created for Bob Norman from draft order #D1.", "path": "/admin/orders/450789469"}]})); + + await shopify.rest.Event.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + filter: "Product,Order", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events.json', + query: 'filter=Product%2COrder', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": []})); + + await shopify.rest.Event.all({ + session: session, + filter: "Product", + verb: "destroy", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events.json', + query: 'filter=Product&verb=destroy', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + created_at_min: "2008-01-10 12:30:00+00:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events.json', + query: 'created_at_min=2008-01-10+12%3A30%3A00%2B00%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + since_id: "164748010", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events.json', + query: 'since_id=164748010', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/921728736/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"events": [{"id": 852065041, "subject_id": 450789469, "created_at": "2008-01-10T09:00:00-05:00", "subject_type": "Order", "verb": "placed", "arguments": [], "body": null, "message": "This order was created for Bob Norman from draft order #D1.", "author": "Shopify", "description": "This order was created for Bob Norman from draft order #D1.", "path": "/admin/orders/450789469"}]})); + + await shopify.rest.Event.all({ + session: session, + order_id: 450789469, + limit: "1", + since_id: "164748010", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/events.json', + query: 'limit=1&since_id=164748010', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"event": {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}})); + + await shopify.rest.Event.find({ + session: session, + id: 677313116, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events/677313116.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Event.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Event.count({ + session: session, + created_at_min: "2008-01-10T13:00:00+00:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/events/count.json', + query: 'created_at_min=2008-01-10T13%3A00%3A00%2B00%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment.test.ts new file mode 100644 index 0000000000..c38aab9694 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment.test.ts @@ -0,0 +1,353 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Fulfillment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:15-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "channel_liable": null}], "fulfillment_line_item_id": 225088298}], "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019878, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:43-05:00", "service": "shipwire-app", "updated_at": "2025-01-02T11:38:43-05:00", "tracking_company": "my-custom-shipping-company", "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "channel_liable": null}], "fulfillment_line_item_id": 1024374829}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "http://my-custom-shipping-company.shopifyapps.com/track/123456", "tracking_urls": ["http://my-custom-shipping-company.shopifyapps.com/track/123456", "http://my-custom-shipping-company.shopifyapps.com/track/789012"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019878"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + order_id: 450789469, + since_id: "255858046", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments.json', + query: 'since_id=255858046', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019880, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:15-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "origin_address": {"address1": "150 Elgin St", "city": "Ottawa", "zip": "K2P 1L4", "province_code": "ON", "country_code": "CA"}, "line_items": [{"id": 1071823219, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823219", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019880"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + fulfillment_order_id: 1046000819, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000819/fulfillments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Fulfillment.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:15-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + + await shopify.rest.Fulfillment.find({ + session: session, + order_id: 450789469, + id: 255858046, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/255858046.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019877, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:43-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:43-05:00", "tracking_company": null, "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 1071823216, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crafty_shoes_red", "variant_title": "Small", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823216", "tax_lines": []}], "tracking_number": "MS1562678", "tracking_numbers": ["MS1562678"], "tracking_url": "https://www.my-shipping-company.com?tracking_number=MS1562678", "tracking_urls": ["https://www.my-shipping-company.com?tracking_number=MS1562678"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019877"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000816 + } + ]; + fulfillment.tracking_info = { + "number": "MS1562678", + "url": "https://www.my-shipping-company.com?tracking_number=MS1562678" + }; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000816}], "tracking_info": {"number": "MS1562678", "url": "https://www.my-shipping-company.com?tracking_number=MS1562678"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019871, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:40-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:40-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 1071823210, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crafty_shoes_red", "variant_title": "Small", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823210", "tax_lines": []}], "tracking_number": "1Z001985YW99744790", "tracking_numbers": ["1Z001985YW99744790"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019871"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000813 + } + ]; + fulfillment.tracking_info = { + "number": "1Z001985YW99744790" + }; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000813}], "tracking_info": {"number": "1Z001985YW99744790"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019873, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:41-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:41-05:00", "tracking_company": null, "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 1071823212, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crafty_shoes_red", "variant_title": "Small", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823212", "tax_lines": []}], "tracking_number": "MS1562678", "tracking_numbers": ["MS1562678"], "tracking_url": "https://www.my-shipping-company.com?tracking=MS1562678", "tracking_urls": ["https://www.my-shipping-company.com?tracking=MS1562678"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019873"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.message = "The package was shipped this morning."; + fulfillment.notify_customer = false; + fulfillment.tracking_info = { + "number": "MS1562678", + "url": "https://www.my-shipping-company.com?tracking=MS1562678" + }; + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000814 + } + ]; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": "MS1562678", "url": "https://www.my-shipping-company.com?tracking=MS1562678"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000814}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019868, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:38-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:38-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 1071823206, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crafty_shoes_red", "variant_title": "Small", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823206", "tax_lines": []}], "tracking_number": "1Z001985YW99744790", "tracking_numbers": ["1Z001985YW99744790"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019868"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.message = "The package was shipped this morning."; + fulfillment.notify_customer = false; + fulfillment.tracking_info = { + "number": "1Z001985YW99744790", + "company": "UPS" + }; + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000811, + "fulfillment_order_line_items": [ + { + "id": 1072503316, + "quantity": 1 + } + ] + } + ]; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": "1Z001985YW99744790", "company": "UPS"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000811, "fulfillment_order_line_items": [{"id": 1072503316, "quantity": 1}]}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019875, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:42-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:42-05:00", "tracking_company": null, "shipment_status": null, "location_id": 24826418, "origin_address": null, "line_items": [{"id": 1071823214, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crafty_shoes_red", "variant_title": "Small", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823214", "tax_lines": []}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019875"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000815 + } + ]; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000815}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "UPS", "location_id": 24826418, "id": 1069019869, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:39-05:00", "shipment_status": null, "origin_address": {"address1": "150 Elgin St", "city": "Ottawa", "zip": "K2P 1L4", "province_code": "ON", "country_code": "CA"}, "line_items": [{"id": 1071823207, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823207", "tax_lines": []}], "tracking_number": "1Z001985YW99744790", "tracking_numbers": ["1Z001985YW99744790"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019869"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.id = 1069019869; + await fulfillment.update_tracking({ + body: {"fulfillment": {"notify_customer": true, "tracking_info": {"company": "UPS", "number": "1Z001985YW99744790"}}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments/1069019869/update_tracking.json', + query: '', + headers, + data: { "fulfillment": {"notify_customer": true, "tracking_info": {"company": "UPS", "number": "1Z001985YW99744790"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": null, "location_id": 24826418, "id": 1069019866, "order_id": 450789469, "status": "success", "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:37-05:00", "shipment_status": null, "origin_address": {"address1": "150 Elgin St", "city": "Ottawa", "zip": "K2P 1L4", "province_code": "ON", "country_code": "CA"}, "line_items": [{"id": 1071823203, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823203", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019866"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.id = 1069019866; + await fulfillment.update_tracking({ + body: {"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com"}}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments/1069019866/update_tracking.json', + query: '', + headers, + data: { "fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019879, "created_at": "2025-01-02T11:38:15-05:00", "service": "manual", "updated_at": "2025-01-02T11:38:45-05:00", "tracking_company": "UPS", "shipment_status": null, "origin_address": {"address1": "150 Elgin St", "city": "Ottawa", "zip": "K2P 1L4", "province_code": "ON", "country_code": "CA"}, "line_items": [{"id": 1071823217, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": "Birthday Present Factory", "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823217", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019879"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.id = 1069019879; + await fulfillment.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillments/1069019879/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_event.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_event.test.ts new file mode 100644 index 0000000000..a368a86582 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_event.test.ts @@ -0,0 +1,118 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('FulfillmentEvent resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2025-01-02T11:39:28-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2025-01-02T11:39:28-05:00", "updated_at": "2025-01-02T11:39:28-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}]})); + + await shopify.rest.FulfillmentEvent.all({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/255858046/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956394, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2025-01-02T11:39:30-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2025-01-02T11:39:30-05:00", "updated_at": "2025-01-02T11:39:30-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956394"}})); + + const fulfillment_event = new shopify.rest.FulfillmentEvent({session: session}); + fulfillment_event.order_id = 450789469; + fulfillment_event.fulfillment_id = 255858046; + fulfillment_event.status = "in_transit"; + await fulfillment_event.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/255858046/events.json', + query: '', + headers, + data: { "event": {"status": "in_transit"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956391, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2025-01-02T11:39:28-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2025-01-02T11:39:28-05:00", "updated_at": "2025-01-02T11:39:28-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956391"}})); + + await shopify.rest.FulfillmentEvent.find({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + id: 944956391, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/255858046/events/944956391.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.FulfillmentEvent.delete({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + id: 944956393, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillments/255858046/events/944956393.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_order.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_order.test.ts new file mode 100644 index 0000000000..3b3d5a8e56 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_order.test.ts @@ -0,0 +1,338 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('FulfillmentOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000780, "created_at": "2025-01-02T11:22:25-05:00", "updated_at": "2025-01-02T11:22:25-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572112, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503277, "shop_id": 548380009, "fulfillment_order_id": 1046000780, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + + await shopify.rest.FulfillmentOrder.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillment_orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000784, "created_at": "2025-01-02T11:22:28-05:00", "updated_at": "2025-01-02T11:22:28-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572116, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503281, "shop_id": 548380009, "fulfillment_order_id": 1046000784, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385, "financial_summaries": [{"quantity": 1, "original_unit_price_set": "199.00", "approximate_discounted_unit_price_set": "199.00", "discount_allocations": [{"amount": "3.33", "discount_application": {"allocation_method": "across", "target_selection": "all", "target_type": "line_item"}}]}]}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + + await shopify.rest.FulfillmentOrder.all({ + session: session, + order_id: 450789469, + include_financial_summaries: "true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillment_orders.json', + query: 'include_financial_summaries=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000783, "created_at": "2025-01-02T11:22:28-05:00", "updated_at": "2025-01-02T11:22:28-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572115, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503280, "shop_id": 548380009, "fulfillment_order_id": 1046000783, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "order_name": "#1001", "order_processed_at": "2008-01-10T11:00:00-05:00", "channel_id": null, "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + + await shopify.rest.FulfillmentOrder.all({ + session: session, + order_id: 450789469, + include_order_reference_fields: "true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/fulfillment_orders.json', + query: 'include_order_reference_fields=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000781, "created_at": "2025-01-02T11:22:26-05:00", "updated_at": "2025-01-02T11:22:26-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572113, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503278, "shop_id": 548380009, "fulfillment_order_id": 1046000781, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + await shopify.rest.FulfillmentOrder.find({ + session: session, + id: 1046000781, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000781.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000779, "created_at": "2025-01-02T11:22:24-05:00", "updated_at": "2025-01-02T11:22:25-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572111, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503276, "shop_id": 548380009, "fulfillment_order_id": 1046000779, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385, "financial_summaries": [{"quantity": 1, "original_unit_price_set": "199.00", "approximate_discounted_unit_price_set": "199.00", "discount_allocations": [{"amount": "3.33", "discount_application": {"allocation_method": "across", "target_selection": "all", "target_type": "line_item"}}]}]}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + await shopify.rest.FulfillmentOrder.find({ + session: session, + id: 1046000779, + include_financial_summaries: "true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000779.json', + query: 'include_financial_summaries=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000790, "created_at": "2025-01-02T11:22:33-05:00", "updated_at": "2025-01-02T11:22:33-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572122, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503286, "shop_id": 548380009, "fulfillment_order_id": 1046000790, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "order_name": "#1001", "order_processed_at": "2008-01-10T11:00:00-05:00", "channel_id": null, "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + await shopify.rest.FulfillmentOrder.find({ + session: session, + id: 1046000790, + include_order_reference_fields: "true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000790.json', + query: 'include_order_reference_fields=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000788, "created_at": "2025-01-02T11:22:32-05:00", "updated_at": "2025-01-02T11:22:32-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "fulfill_at": null, "fulfill_by": null, "supported_actions": [], "destination": {"id": 1042572120, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000789, "created_at": "2025-01-02T11:22:32-05:00", "updated_at": "2025-01-02T11:22:32-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold"], "destination": {"id": 1042572121, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503285, "shop_id": 548380009, "fulfillment_order_id": 1046000789, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000788; + await fulfillment_order.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000788/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000793, "created_at": "2025-01-02T11:22:35-05:00", "updated_at": "2025-01-02T11:22:36-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold"], "destination": {"id": 1042572125, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503289, "shop_id": 548380009, "fulfillment_order_id": 1046000793, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000793; + await fulfillment_order.close({ + body: {"fulfillment_order": {"message": "Not enough inventory to complete this work."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000793/close.json', + query: '', + headers, + data: { "fulfillment_order": {"message": "Not enough inventory to complete this work."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000786, "created_at": "2025-01-02T11:22:30-05:00", "updated_at": "2025-01-02T11:22:31-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "fulfill_at": null, "fulfill_by": null, "supported_actions": [], "destination": {"id": 1042572118, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000787, "created_at": "2025-01-02T11:22:31-05:00", "updated_at": "2025-01-02T11:22:31-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["create_fulfillment", "move", "hold"], "destination": {"id": 1042572119, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503284, "shop_id": 548380009, "fulfillment_order_id": 1046000787, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000786; + await fulfillment_order.move({ + body: {"fulfillment_order": {"new_location_id": 655441491, "fulfillment_order_line_items": [{"id": 1072503283, "quantity": 1}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000786/move.json', + query: '', + headers, + data: { "fulfillment_order": {"new_location_id": 655441491, "fulfillment_order_line_items": [{"id": 1072503283, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000785, "created_at": "2025-01-02T11:22:29-05:00", "updated_at": "2025-01-02T11:22:30-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold"], "destination": {"id": 1042572117, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503282, "shop_id": 548380009, "fulfillment_order_id": 1046000785, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000785; + await fulfillment_order.open({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000785/open.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000791, "created_at": "2025-01-02T11:22:33-05:00", "updated_at": "2025-01-02T11:22:34-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "fulfill_at": "2026-02-02T11:22:00-05:00", "fulfill_by": null, "supported_actions": ["mark_as_open"], "destination": {"id": 1042572123, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503287, "shop_id": 548380009, "fulfillment_order_id": 1046000791, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000791; + await fulfillment_order.reschedule({ + body: {"fulfillment_order": {"new_fulfill_at": "2026-02-02 16:22 UTC"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000791/reschedule.json', + query: '', + headers, + data: { "fulfillment_order": {"new_fulfill_at": "2026-02-02 16:22 UTC"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000782, "created_at": "2025-01-02T11:22:26-05:00", "updated_at": "2025-01-02T11:22:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["release_hold", "hold"], "destination": {"id": 1042572114, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1072503279, "shop_id": 548380009, "fulfillment_order_id": 1046000782, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "international_duties": null, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000782; + await fulfillment_order.hold({ + body: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work.", "fulfillment_order_line_items": [{"id": 1072503279, "quantity": 1}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000782/hold.json', + query: '', + headers, + data: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work.", "fulfillment_order_line_items": [{"id": 1072503279, "quantity": 1}]}} + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + + await fulfillment_order.set_fulfillment_orders_deadline({ + body: {"fulfillment_order_ids": [1046000792], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/set_fulfillment_orders_deadline.json', + query: '', + headers, + data: {"fulfillment_order_ids": [1046000792], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000794, "created_at": "2025-01-02T11:22:36-05:00", "updated_at": "2025-01-02T11:22:37-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572126, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503290, "shop_id": 548380009, "fulfillment_order_id": 1046000794, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": null}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000794; + await fulfillment_order.release_hold({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000794/release_hold.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_request.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_request.test.ts new file mode 100644 index 0000000000..e5a9626597 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_request.test.ts @@ -0,0 +1,125 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('FulfillmentRequest resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000806, "created_at": "2025-01-02T11:35:26-05:00", "updated_at": "2025-01-02T11:35:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572138, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503304, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503305, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1072503306, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2025-01-02T11:35:27-05:00", "kind": "fulfillment_request"}], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232621, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}, "submitted_fulfillment_order": {"id": 1046000806, "created_at": "2025-01-02T11:35:26-05:00", "updated_at": "2025-01-02T11:35:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572138, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503304, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503305, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1072503306, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2025-01-02T11:35:27-05:00", "kind": "fulfillment_request"}], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232621, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}, "unsubmitted_fulfillment_order": null})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000806; + fulfillment_request.message = "Fulfill this ASAP please."; + await fulfillment_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000806/fulfillment_request.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000807, "created_at": "2025-01-02T11:35:27-05:00", "updated_at": "2025-01-02T11:35:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572139, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503307, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503308, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": true}, "sent_at": "2025-01-02T11:35:27-05:00", "kind": "fulfillment_request"}], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232622, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}, "submitted_fulfillment_order": {"id": 1046000807, "created_at": "2025-01-02T11:35:27-05:00", "updated_at": "2025-01-02T11:35:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1042572139, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503307, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503308, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": true}, "sent_at": "2025-01-02T11:35:27-05:00", "kind": "fulfillment_request"}], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232622, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}, "unsubmitted_fulfillment_order": {"id": 1046000808, "created_at": "2025-01-02T11:35:27-05:00", "updated_at": "2025-01-02T11:35:27-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold", "merge"], "destination": {"id": 1042572140, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503309, "shop_id": 548380009, "fulfillment_order_id": 1046000808, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232623, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000807; + fulfillment_request.message = "Fulfill this ASAP please."; + fulfillment_request.fulfillment_order_line_items = [ + { + "id": 1072503307, + "quantity": 1 + }, + { + "id": 1072503308, + "quantity": 1 + } + ]; + fulfillment_request.notify_customer = true; + await fulfillment_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000807/fulfillment_request.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1072503307, "quantity": 1}, {"id": 1072503308, "quantity": 1}], "notify_customer": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000809, "created_at": "2025-01-02T11:35:28-05:00", "updated_at": "2025-01-02T11:35:28-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["create_fulfillment", "request_cancellation"], "destination": {"id": 1042572141, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503310, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503311, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1072503312, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232624, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000809; + await fulfillment_request.accept({ + body: {"fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000809/fulfillment_request/accept.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000805, "created_at": "2025-01-02T11:35:25-05:00", "updated_at": "2025-01-02T11:35:26-05:00", "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "fulfill_at": null, "fulfill_by": null, "supported_actions": ["request_fulfillment", "create_fulfillment", "hold", "split"], "destination": {"id": 1042572137, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1072503301, "shop_id": 548380009, "fulfillment_order_id": 1046000805, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1072503302, "shop_id": 548380009, "fulfillment_order_id": 1046000805, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1072503303, "shop_id": 548380009, "fulfillment_order_id": 1046000805, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "international_duties": null, "fulfillment_holds": [], "delivery_method": {"id": 989232620, "method_type": "shipping", "min_delivery_date_time": null, "max_delivery_date_time": null, "additional_information": {"phone": null, "instructions": null, "failed_carriers": null, "pickup_point_id": null}, "service_code": null, "detailed_branded_promise": null, "source_reference": null, "presented_name": "Expedited Shipping"}}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000805; + await fulfillment_request.reject({ + body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1072503301, "message": "Not enough inventory."}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000805/fulfillment_request/reject.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1072503301, "message": "Not enough inventory."}]} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_service.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_service.test.ts new file mode 100644 index 0000000000..567aaae13d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/fulfillment_service.test.ts @@ -0,0 +1,158 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('FulfillmentService resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_services": [{"id": 611870435, "name": "Venus Fulfillment", "email": null, "service_name": "Venus Fulfillment", "handle": "venus-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 611870435, "callback_url": "http://google.com/", "tracking_support": false, "inventory_management": false, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/611870435", "permits_sku_sharing": false, "requires_shipping_method": true}, {"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713", "permits_sku_sharing": true, "requires_shipping_method": true}]})); + + await shopify.rest.FulfillmentService.all({ + session: session, + scope: "all", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_services.json', + query: 'scope=all', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_services": [{"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713", "permits_sku_sharing": true, "requires_shipping_method": true}]})); + + await shopify.rest.FulfillmentService.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_services.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774487, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404544, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774487", "permits_sku_sharing": true, "requires_shipping_method": true}})); + + const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); + fulfillment_service.name = "Jupiter Fulfillment"; + fulfillment_service.callback_url = "http://google.com"; + fulfillment_service.inventory_management = true; + fulfillment_service.tracking_support = true; + fulfillment_service.permits_sku_sharing = true; + await fulfillment_service.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/fulfillment_services.json', + query: '', + headers, + data: { "fulfillment_service": {"name": "Jupiter Fulfillment", "callback_url": "http://google.com", "inventory_management": true, "tracking_support": true, "permits_sku_sharing": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713", "permits_sku_sharing": true, "requires_shipping_method": true}})); + + await shopify.rest.FulfillmentService.find({ + session: session, + id: 755357713, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_services/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 755357713, "name": "New Fulfillment Service Name", "email": null, "service_name": "New Fulfillment Service Name", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713", "permits_sku_sharing": true, "requires_shipping_method": true}})); + + const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); + fulfillment_service.id = 755357713; + fulfillment_service.name = "New Fulfillment Service Name"; + await fulfillment_service.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/fulfillment_services/755357713.json', + query: '', + headers, + data: { "fulfillment_service": {"name": "New Fulfillment Service Name"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.FulfillmentService.delete({ + session: session, + id: 755357713, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/fulfillment_services/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card.test.ts new file mode 100644 index 0000000000..4e96026847 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card.test.ts @@ -0,0 +1,290 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('GiftCard resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2024-01-02", "template_suffix": null, "notify": true, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "0y0y", "order_id": null}]})); + + await shopify.rest.GiftCard.all({ + session: session, + status: "enabled", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards.json', + query: 'status=enabled', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2024-01-02", "template_suffix": null, "notify": true, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "0y0y", "order_id": null}]})); + + await shopify.rest.GiftCard.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); + + await shopify.rest.GiftCard.find({ + session: session, + id: 1035197676, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "id": 1035197676, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:10:56-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + gift_card.expires_on = "2020-01-01"; + await gift_card.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676.json', + query: '', + headers, + data: { "gift_card": {"expires_on": "2020-01-01"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "id": 1035197676, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:10:53-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + gift_card.note = "Updating with a new note"; + await gift_card.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676.json', + query: '', + headers, + data: { "gift_card": {"note": "Updating with a new note"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.GiftCard.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.GiftCard.count({ + session: session, + status: "enabled", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/count.json', + query: 'status=enabled', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936320, "balance": "100.00", "created_at": "2025-01-02T11:10:51-05:00", "updated_at": "2025-01-02T11:10:51-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.note = "This is a note"; + gift_card.initial_value = "100.00"; + gift_card.code = "ABCD EFGH IJKL MNOP"; + gift_card.template_suffix = "gift_cards.birthday.liquid"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"note": "This is a note", "initial_value": "100.00", "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936322, "balance": "25.00", "created_at": "2025-01-02T11:10:52-05:00", "updated_at": "2025-01-02T11:10:52-05:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "8g42", "order_id": null, "code": "2f8e5fh6bag78g42"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = "25.00"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": "25.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936318, "balance": "100.00", "created_at": "2023-11-30T19:00:00-05:00", "updated_at": "2023-11-30T19:00:00-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "55h7", "order_id": null, "code": "hf26he2f8gaf55h7"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = "100.00"; + gift_card.recipient_id = 207119551; + gift_card.message = "Happy birthday!"; + gift_card.send_on = "2023-12-31"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": "100.00", "recipient_id": 207119551, "message": "Happy birthday!", "send_on": "2023-12-31"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2025-01-02T11:10:54-05:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "id": 1035197676, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:10:54-05:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + await gift_card.disable({ + body: {"gift_card": {"id": 1035197676}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/disable.json', + query: '', + headers, + data: { "gift_card": {"id": 1035197676} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936316, "balance": "10.00", "created_at": "2025-01-02T11:10:46-05:00", "updated_at": "2025-01-02T11:10:46-05:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "notify": true, "last_characters": "mnop", "order_id": null}]})); + + await shopify.rest.GiftCard.search({ + session: session, + query: "last_characters:mnop", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/search.json', + query: 'query=last_characters%3Amnop', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card_adjustment.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card_adjustment.test.ts new file mode 100644 index 0000000000..46b229be9b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/gift_card_adjustment.test.ts @@ -0,0 +1,162 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('GiftCardAdjustment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); + + await shopify.rest.GiftCardAdjustment.all({ + session: session, + gift_card_id: 1035197676, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2025-01-02T11:20:30-05:00", "created_at": "2025-01-02T11:20:30-05:00", "updated_at": "2025-01-02T11:20:30-05:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; + gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2025-01-02T11:20:32-05:00", "created_at": "2025-01-02T11:20:32-05:00", "updated_at": "2025-01-02T11:20:32-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.note = "Customer refilled gift card by $10"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "note": "Customer refilled gift card by $10"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2025-01-02T11:20:31-05:00", "created_at": "2025-01-02T11:20:31-05:00", "updated_at": "2025-01-02T11:20:31-05:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = -20.0; + gift_card_adjustment.note = "Customer spent $20 via external service"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": -20.0, "note": "Customer spent $20 via external service"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273909, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2024-07-02T11:20:29-04:00", "created_at": "2025-01-02T11:20:29-05:00", "updated_at": "2025-01-02T11:20:29-05:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.processed_at = "2024-07-02T11:20:29-04:00"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "processed_at": "2024-07-02T11:20:29-04:00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + await shopify.rest.GiftCardAdjustment.find({ + session: session, + gift_card_id: 1035197676, + id: 1064273908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/gift_cards/1035197676/adjustments/1064273908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/image.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/image.test.ts new file mode 100644 index 0000000000..a05364a72f --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/image.test.ts @@ -0,0 +1,368 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Image resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": []}]})); + + await shopify.rest.Image.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"images": [{"id": 1001473896, "alt": null, "position": 4, "product_id": 632910392, "created_at": "2025-01-02T11:20:51-05:00", "updated_at": "2025-01-02T11:20:51-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273189", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo.gif?v=1735834851", "variant_ids": []}]})); + + await shopify.rest.Image.all({ + session: session, + product_id: 632910392, + since_id: "850703190", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: 'since_id=850703190', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 1001473904, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:21:06-05:00", "updated_at": "2025-01-02T11:21:06-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273193", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo.gif?v=1735834866", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJ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rYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQx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0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 1001473900, "alt": null, "position": 4, "product_id": 632910392, "created_at": "2025-01-02T11:20:58-05:00", "updated_at": "2025-01-02T11:20:58-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273191", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo.gif?v=1735834858", "variant_ids": [808950810, 457924702]}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.variant_ids = [ + 808950810, + 457924702 + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbE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WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7Z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0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 1001473902, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:21:03-05:00", "updated_at": "2025-01-02T11:21:03-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273192", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo.gif?v=1735834863", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIsRwS7hAN8l/YtvDvnYXHbAoLI47SIUsOMenorF4gO/m4+fH\npo4vLZ8oKM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); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIsRwS7hAN8l/YtvDvnYXHbAoLI47SIUsOMenorF4gO/m4+fH\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} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 1001473898, "alt": null, "position": 4, "product_id": 632910392, "created_at": "2025-01-02T11:20:54-05:00", "updated_at": "2025-01-02T11:20:55-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273190", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo20250102-63224-3y0xt6.gif?v=1735834854", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.src = "http://example.com/rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"src": "http://example.com/rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 1001473906, "alt": null, "position": 4, "product_id": 632910392, "created_at": "2025-01-02T11:21:09-05:00", "updated_at": "2025-01-02T11:21:09-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273194", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo.gif?v=1735834869", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5a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+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYI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BXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/images/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + since_id: "850703190", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/images/count.json', + query: 'since_id=850703190', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": []}})); + + await shopify.rest.Image.find({ + session: session, + product_id: 632910392, + id: 850703190, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/images/850703190.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "alt": "new alt tag content", "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:21:12-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.position = 2; + image.alt = "new alt tag content"; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"position": 2, "alt": "new alt tag content"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": []}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.metafields = [ + { + "key": "my_new_metafield", + "value": "my_new_value", + "type": "single_line_text_field", + "namespace": "tags" + } + ]; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": [808950810, 457924702]}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.variant_ids = [ + 808950810, + 457924702 + ]; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"variant_ids": [808950810, 457924702]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Image.delete({ + session: session, + product_id: 632910392, + id: 850703190, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/products/632910392/images/850703190.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_item.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_item.test.ts new file mode 100644 index 0000000000..65e2c4ef1c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_item.test.ts @@ -0,0 +1,112 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('InventoryItem resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); + + await shopify.rest.InventoryItem.all({ + session: session, + ids: "808950810,39072856,457924702", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/inventory_items.json', + query: 'ids=808950810%2C39072856%2C457924702', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + await shopify.rest.InventoryItem.find({ + session: session, + id: 808950810, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/inventory_items/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:37:01-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + const inventory_item = new shopify.rest.InventoryItem({session: session}); + inventory_item.id = 808950810; + inventory_item.sku = "new sku"; + await inventory_item.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/inventory_items/808950810.json', + query: '', + headers, + data: { "inventory_item": {"sku": "new sku"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + const inventory_item = new shopify.rest.InventoryItem({session: session}); + inventory_item.id = 808950810; + inventory_item.cost = "25.00"; + await inventory_item.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/inventory_items/808950810.json', + query: '', + headers, + data: { "inventory_item": {"cost": "25.00"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_level.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_level.test.ts new file mode 100644 index 0000000000..bfdf526cda --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/inventory_level.test.ts @@ -0,0 +1,183 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('InventoryLevel resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + location_ids: "655441491", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/inventory_levels.json', + query: 'location_ids=655441491', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + inventory_item_ids: "808950810", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/inventory_levels.json', + query: 'inventory_item_ids=808950810', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + inventory_item_ids: "808950810,39072856", + location_ids: "655441491,487838322", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/inventory_levels.json', + query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2025-01-02T11:30:19-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.adjust({ + body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/inventory_levels/adjust.json', + query: '', + headers, + data: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5} + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.InventoryLevel.delete({ + session: session, + inventory_item_id: "808950810", + location_id: "655441491", + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/inventory_levels.json', + query: 'inventory_item_id=808950810&location_id=655441491', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2025-01-02T11:30:15-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.connect({ + body: {"location_id": 844681632, "inventory_item_id": 457924702}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/inventory_levels/connect.json', + query: '', + headers, + data: {"location_id": 844681632, "inventory_item_id": 457924702} + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2025-01-02T11:30:13-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.set({ + body: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/inventory_levels/set.json', + query: '', + headers, + data: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42} + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/location.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/location.test.ts new file mode 100644 index 0000000000..3baefa0515 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/location.test.ts @@ -0,0 +1,110 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Location resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); + + await shopify.rest.Location.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/locations.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); + + await shopify.rest.Location.find({ + session: session, + id: 487838322, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/locations/487838322.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 5})); + + await shopify.rest.Location.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/locations/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2025-01-02T11:09:43-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); + + await shopify.rest.Location.inventory_levels({ + session: session, + id: 487838322, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/locations/487838322/inventory_levels.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/locations_for_move.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/locations_for_move.test.ts new file mode 100644 index 0000000000..26167dfd0e --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/locations_for_move.test.ts @@ -0,0 +1,46 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('LocationsForMove resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"locations_for_move": [{"location": {"id": 1072404542, "name": "Alpha Location"}, "message": "Current location.", "movable": false}, {"location": {"id": 1072404543, "name": "Bravo Location"}, "message": "No items are stocked at this location.", "movable": false}]})); + + await shopify.rest.LocationsForMove.all({ + session: session, + fulfillment_order_id: 1046000777, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/fulfillment_orders/1046000777/locations_for_move.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/marketing_event.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/marketing_event.test.ts new file mode 100644 index 0000000000..12cb101c2c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/marketing_event.test.ts @@ -0,0 +1,194 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('MarketingEvent resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2025-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); + + await shopify.rest.MarketingEvent.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/marketing_events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2025-12-15T00:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2025", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.started_at = "2025-12-15"; + marketing_event.utm_campaign = "Christmas2025"; + marketing_event.utm_source = "facebook"; + marketing_event.utm_medium = "cpc"; + marketing_event.event_type = "ad"; + marketing_event.referring_domain = "facebook.com"; + marketing_event.marketing_channel = "social"; + marketing_event.paid = true; + await marketing_event.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/marketing_events.json', + query: '', + headers, + data: { "marketing_event": {"started_at": "2025-12-15", "utm_campaign": "Christmas2025", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.MarketingEvent.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/marketing_events/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2025-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + + await shopify.rest.MarketingEvent.find({ + session: session, + id: 998730532, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/marketing_events/998730532.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2025-02-01T19:00:00-05:00", "ended_at": "2025-02-02T19:00:00-05:00", "scheduled_to_end_at": "2025-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "event_type": "post", "id": 998730532, "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.id = 998730532; + marketing_event.remote_id = "1000:2000"; + marketing_event.started_at = "2025-02-02T00:00 +00:00"; + marketing_event.ended_at = "2025-02-03T00:00 +00:00"; + marketing_event.scheduled_to_end_at = "2025-02-04T00:00 +00:00"; + marketing_event.budget = "11.1"; + marketing_event.budget_type = "daily"; + marketing_event.currency = "CAD"; + marketing_event.utm_campaign = "other"; + marketing_event.utm_source = "other"; + marketing_event.utm_medium = "other"; + marketing_event.event_type = "ad"; + marketing_event.referring_domain = "instagram.com"; + await marketing_event.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/marketing_events/998730532.json', + query: '', + headers, + data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2025-02-02T00:00 +00:00", "ended_at": "2025-02-03T00:00 +00:00", "scheduled_to_end_at": "2025-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.MarketingEvent.delete({ + session: session, + id: 998730532, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/marketing_events/998730532.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2025-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2025-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2025-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.id = 998730532; + await marketing_event.engagements({ + body: {"engagements": [{"occurred_on": "2025-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2025-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2025-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/marketing_events/998730532/engagements.json', + query: '', + headers, + data: {"engagements": [{"occurred_on": "2025-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2025-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2025-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/metafield.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/metafield.test.ts new file mode 100644 index 0000000000..7950afcf4d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/metafield.test.ts @@ -0,0 +1,1569 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Metafield resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069228961, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2025-01-02T11:32:46-05:00", "updated_at": "2025-01-02T11:32:46-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228961"}]})); + + await shopify.rest.Metafield.all({ + session: session, + blog_id: 382285388, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "collection", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "collection", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}, {"id": 1069228959, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2025-01-02T11:32:40-05:00", "updated_at": "2025-01-02T11:32:40-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228959"}]})); + + await shopify.rest.Metafield.all({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}, {"id": 1069228963, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2025-01-02T11:32:48-05:00", "updated_at": "2025-01-02T11:32:48-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228963"}]})); + + await shopify.rest.Metafield.all({ + session: session, + customer_id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}, {"id": 1069228958, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2025-01-02T11:32:36-05:00", "updated_at": "2025-01-02T11:32:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228958"}]})); + + await shopify.rest.Metafield.all({ + session: session, + draft_order_id: 622762746, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}, {"id": 1069228941, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2025-01-02T11:31:56-05:00", "updated_at": "2025-01-02T11:31:56-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228941"}]})); + + await shopify.rest.Metafield.all({ + session: session, + page_id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}, {"id": 1069228951, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:32:21-05:00", "updated_at": "2025-01-02T11:32:21-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228951"}]})); + + await shopify.rest.Metafield.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 498048120, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "media_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}, {"id": 1069228942, "namespace": "translation", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 498048120, "created_at": "2025-01-02T11:31:57-05:00", "updated_at": "2025-01-02T11:31:57-05:00", "owner_resource": "media_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228942"}]})); + + await shopify.rest.Metafield.all({ + session: session, + product_image_id: 850703190, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069228962, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2025-01-02T11:32:47-05:00", "updated_at": "2025-01-02T11:32:47-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228962"}]})); + + await shopify.rest.Metafield.all({ + session: session, + variant_id: 49148385, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069228952, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2025-01-02T11:32:23-05:00", "updated_at": "2025-01-02T11:32:23-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228952"}]})); + + await shopify.rest.Metafield.all({ + session: session, + article_id: 674387490, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}, {"id": 1069228955, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2025-01-02T11:32:29-05:00", "updated_at": "2025-01-02T11:32:29-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228955"}]})); + + await shopify.rest.Metafield.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); + + await shopify.rest.Metafield.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069228946, "namespace": "my_fields", "key": "my_items", "value": "{\"items\":[\"some item\"]}", "description": null, "owner_id": 548380009, "created_at": "2025-01-02T11:32:08-05:00", "updated_at": "2025-01-02T11:32:08-05:00", "owner_resource": "shop", "type": "json", "admin_graphql_api_id": "gid://shopify/Metafield/1069228946"}]})); + + await shopify.rest.Metafield.all({ + session: session, + since_id: "721389482", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/metafields.json', + query: 'since_id=721389482', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228947, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2025-01-02T11:32:13-05:00", "updated_at": "2025-01-02T11:32:13-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228947"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.namespace = "my_fields"; + metafield.key = "sponsor"; + metafield.type = "single_line_text_field"; + metafield.value = "Shopify"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "sponsor", "type": "single_line_text_field", "value": "Shopify"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228960, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2025-01-02T11:32:44-05:00", "updated_at": "2025-01-02T11:32:44-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228960"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.namespace = "my_fields"; + metafield.key = "discount"; + metafield.type = "single_line_text_field"; + metafield.value = "25%"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "discount", "type": "single_line_text_field", "value": "25%"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228944, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2025-01-02T11:32:05-05:00", "updated_at": "2025-01-02T11:32:05-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228944"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.namespace = "discounts"; + metafield.key = "special"; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "discounts", "key": "special", "value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228957, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2025-01-02T11:32:32-05:00", "updated_at": "2025-01-02T11:32:32-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228957"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "97453"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "97453"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228948, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2025-01-02T11:32:14-05:00", "updated_at": "2025-01-02T11:32:14-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228948"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.namespace = "my_fields"; + metafield.key = "subtitle"; + metafield.type = "single_line_text_field"; + metafield.value = "A subtitle for my page"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "subtitle", "type": "single_line_text_field", "value": "A subtitle for my page"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228953, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:32:25-05:00", "updated_at": "2025-01-02T11:32:25-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228953"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228954, "namespace": "translation", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 850703190, "created_at": "2025-01-02T11:32:26-05:00", "updated_at": "2025-01-02T11:32:26-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228954"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.namespace = "translation"; + metafield.key = "title_spanish"; + metafield.type = "single_line_text_field"; + metafield.value = "botas"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "translation", "key": "title_spanish", "type": "single_line_text_field", "value": "botas"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228950, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2025-01-02T11:32:21-05:00", "updated_at": "2025-01-02T11:32:21-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228950"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.namespace = "my_fields"; + metafield.key = "liner_material"; + metafield.type = "single_line_text_field"; + metafield.value = "synthetic leather"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "liner_material", "type": "single_line_text_field", "value": "synthetic leather"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228956, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2025-01-02T11:32:30-05:00", "updated_at": "2025-01-02T11:32:30-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228956"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.namespace = "my_fields"; + metafield.key = "category"; + metafield.type = "single_line_text_field"; + metafield.value = "outdoors"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "category", "type": "single_line_text_field", "value": "outdoors"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228945, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2025-01-02T11:32:07-05:00", "updated_at": "2025-01-02T11:32:07-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228945"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "123"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "123"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228949, "namespace": "my_fields", "key": "my_items", "value": "{\"items\":[\"some item\"]}", "description": null, "owner_id": 548380009, "created_at": "2025-01-02T11:32:21-05:00", "updated_at": "2025-01-02T11:32:21-05:00", "owner_resource": "shop", "type": "json", "admin_graphql_api_id": "gid://shopify/Metafield/1069228949"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.namespace = "my_fields"; + metafield.key = "my_items"; + metafield.value = "{\"items\":[\"some item\"]}"; + metafield.type = "json"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "my_items", "value": "{\"items\":[\"some item\"]}", "type": "json"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + blog_id: 382285388, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Metafield.count({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + customer_id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + draft_order_id: 622762746, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + page_id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 16})); + + await shopify.rest.Metafield.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + product_image_id: 850703190, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + variant_id: 49148385, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + article_id: 674387490, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_33', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_34', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_35', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + await shopify.rest.Metafield.find({ + session: session, + blog_id: 382285388, + id: 534526895, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_36', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + await shopify.rest.Metafield.find({ + session: session, + collection_id: 482865238, + id: 1010236510, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_37', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + await shopify.rest.Metafield.find({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_38', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + await shopify.rest.Metafield.find({ + session: session, + draft_order_id: 622762746, + id: 106172460, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_39', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + await shopify.rest.Metafield.find({ + session: session, + page_id: 131092082, + id: 290519330, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_40', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + await shopify.rest.Metafield.find({ + session: session, + product_id: 632910392, + id: 1001077698, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_41', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 498048120, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "media_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + await shopify.rest.Metafield.find({ + session: session, + product_image_id: 850703190, + id: 625663657, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_42', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + await shopify.rest.Metafield.find({ + session: session, + variant_id: 49148385, + id: 323119633, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_43', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + await shopify.rest.Metafield.find({ + session: session, + article_id: 674387490, + id: 838981074, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_44', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + await shopify.rest.Metafield.find({ + session: session, + order_id: 450789469, + id: 915396079, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_45', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + await shopify.rest.Metafield.find({ + session: session, + id: 721389482, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/metafields/721389482.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_46', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated blog title", "owner_id": 241253187, "namespace": "translation", "key": "title_fr", "id": 534526895, "description": "Blog French title translation", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:37-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.id = 534526895; + metafield.value = "a translated blog title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: { "metafield": {"value": "a translated blog title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_47', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "seo title", "owner_id": 482865238, "namespace": "global", "key": "title_tag", "id": 1010236510, "description": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:26-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.id = 1010236510; + metafield.value = "seo title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: { "metafield": {"value": "seo title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_48', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "yes", "owner_id": 207119551, "namespace": "discounts", "key": "returning_customer", "id": 220591908, "description": "Customer deserves discount", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.id = 220591908; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: { "metafield": {"value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_49', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "110000", "owner_id": 622762746, "namespace": "notes", "key": "note", "id": 106172460, "description": "This is for notes", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:42-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.id = 106172460; + metafield.value = "110000"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: { "metafield": {"value": "110000", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_50', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "An updated translation", "owner_id": 131092082, "namespace": "translation", "key": "title_fr", "id": 290519330, "description": "Page French title translation", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:07-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.id = 290519330; + metafield.value = "An updated translation"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: { "metafield": {"value": "An updated translation", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_51', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "having fun", "owner_id": 632910392, "namespace": "my_fields", "key": "best_for", "id": 1001077698, "description": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:28-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.id = 1001077698; + metafield.value = "having fun"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: { "metafield": {"value": "having fun", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_52', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "translated description", "owner_id": 498048120, "namespace": "translation", "key": "title_fr", "id": 625663657, "description": "French product image title", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:27-05:00", "owner_resource": "media_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.id = 625663657; + metafield.value = "translated description"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: { "metafield": {"value": "translated description", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_53', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "Red", "owner_id": 808950810, "namespace": "my_fields", "key": "color", "id": 323119633, "description": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:35-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.id = 323119633; + metafield.value = "Red"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: { "metafield": {"value": "Red", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_54', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "[\"something new\"]", "owner_id": 548380009, "namespace": "affiliates", "key": "app_key", "id": 721389482, "description": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:20-05:00", "owner_resource": "shop", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.id = 721389482; + metafield.value = "[\"something new\"]"; + metafield.type = "list.single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/metafields/721389482.json', + query: '', + headers, + data: { "metafield": {"value": "[\"something new\"]", "type": "list.single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_55', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated title", "owner_id": 134645308, "namespace": "translation", "key": "title_fr", "id": 838981074, "description": "Article French title translation", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:38-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.id = 838981074; + metafield.value = "a translated title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: { "metafield": {"value": "a translated title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_56', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"metafield": {"value": "Provided a discount code", "owner_id": 450789469, "namespace": "notes", "key": "buyer", "id": 915396079, "description": "This field is for buyer notes", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:32:47-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.id = 915396079; + metafield.value = "Provided a discount code"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: { "metafield": {"value": "Provided a discount code", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_57', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + blog_id: 382285388, + id: 534526895, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_58', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + collection_id: 482865238, + id: 1010236510, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_59', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_60', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + draft_order_id: 622762746, + id: 106172460, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_61', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + page_id: 131092082, + id: 290519330, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_62', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + product_id: 632910392, + id: 1001077698, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_63', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + product_image_id: 850703190, + id: 625663657, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_64', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + variant_id: 49148385, + id: 323119633, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_65', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + article_id: 674387490, + id: 838981074, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_66', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + order_id: 450789469, + id: 915396079, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_67', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + id: 721389482, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/metafields/721389482.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/mobile_platform_application.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/mobile_platform_application.test.ts new file mode 100644 index 0000000000..bf88056506 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/mobile_platform_application.test.ts @@ -0,0 +1,201 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('MobilePlatformApplication resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066176000, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2025-01-02T11:11:11-05:00", "updated_at": "2025-01-02T11:11:11-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}, {"id": 1066176001, "application_id": "com.example", "platform": "android", "created_at": "2025-01-02T11:11:11-05:00", "updated_at": "2025-01-02T11:11:11-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}]})); + + await shopify.rest.MobilePlatformApplication.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/mobile_platform_applications.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176002, "application_id": "com.example", "platform": "android", "created_at": "2025-01-02T11:11:12-05:00", "updated_at": "2025-01-02T11:11:12-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.platform = "android"; + mobile_platform_application.application_id = "com.example"; + mobile_platform_application.sha256_cert_fingerprints = [ + "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" + ]; + mobile_platform_application.enabled_universal_or_app_links = true; + await mobile_platform_application.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/mobile_platform_applications.json', + query: '', + headers, + data: { "mobile_platform_application": {"platform": "android", "application_id": "com.example", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176003, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2025-01-02T11:11:13-05:00", "updated_at": "2025-01-02T11:11:13-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.platform = "ios"; + mobile_platform_application.application_id = "X1Y2.ca.domain.app"; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = true; + await mobile_platform_application.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/mobile_platform_applications.json', + query: '', + headers, + data: { "mobile_platform_application": {"platform": "ios", "application_id": "X1Y2.ca.domain.app", "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066175997, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2025-01-02T11:11:09-05:00", "updated_at": "2025-01-02T11:11:09-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); + + await shopify.rest.MobilePlatformApplication.find({ + session: session, + id: 1066175997, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/mobile_platform_applications/1066175997.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066175998, "created_at": "2025-01-02T11:11:09-05:00", "updated_at": "2025-01-02T11:11:10-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.id = 1066175998; + mobile_platform_application.application_id = "com.example.news.app"; + mobile_platform_application.platform = "android"; + mobile_platform_application.created_at = "2025-01-02T11:11:09-05:00"; + mobile_platform_application.updated_at = "2025-01-02T11:11:09-05:00"; + mobile_platform_application.sha256_cert_fingerprints = [ + "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" + ]; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = false; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; + await mobile_platform_application.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/mobile_platform_applications/1066175998.json', + query: '', + headers, + data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2025-01-02T11:11:09-05:00", "updated_at": "2025-01-02T11:11:09-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066175996, "created_at": "2025-01-02T11:11:08-05:00", "updated_at": "2025-01-02T11:11:09-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.id = 1066175996; + mobile_platform_application.application_id = "A1B2.ca.domain.app"; + mobile_platform_application.platform = "ios"; + mobile_platform_application.created_at = "2025-01-02T11:11:08-05:00"; + mobile_platform_application.updated_at = "2025-01-02T11:11:08-05:00"; + mobile_platform_application.sha256_cert_fingerprints = []; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = true; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; + await mobile_platform_application.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/mobile_platform_applications/1066175996.json', + query: '', + headers, + data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2025-01-02T11:11:08-05:00", "updated_at": "2025-01-02T11:11:08-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.MobilePlatformApplication.delete({ + session: session, + id: 1066175999, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/mobile_platform_applications/1066175999.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order.test.ts new file mode 100644 index 0000000000..1b7249ca2c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order.test.ts @@ -0,0 +1,957 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Order resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + since_id: "123", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'since_id=123', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "created_at": "2008-01-10T11:00:00-05:00", "name": "#1001", "total_price": "598.94"}]})); + + await shopify.rest.Order.all({ + session: session, + fields: "created_at,id,name,total-price", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'fields=created_at%2Cid%2Cname%2Ctotal-price', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + updated_at_min: "2005-07-31T15:57:11-04:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'updated_at_min=2005-07-31T15%3A57%3A11-04%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "authorized", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:47-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + financial_status: "authorized", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'financial_status=authorized', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"orders": [{"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "AYWH5FXK0", "confirmed": true, "contact_email": null, "created_at": "2025-01-02T11:30:59-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/be8948fb32e1cc6001cb0ec9e17e1b59/authenticate?key=661c072f1271d4cd1816073e76f487d1", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:30:59-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "be8948fb32e1cc6001cb0ec9e17e1b59", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:59-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}]})); + + await shopify.rest.Order.all({ + session: session, + ids: "1073459969", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders.json', + query: 'ids=1073459969', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "name": "#1001", "total_price": "598.94", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}]}})); + + await shopify.rest.Order.find({ + session: session, + id: 450789469, + fields: "id,line_items,name,total_price", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: 'fields=id%2Cline_items%2Cname%2Ctotal_price', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + await shopify.rest.Order.find({ + session: session, + id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Order.count({ + session: session, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/count.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Order.count({ + session: session, + financial_status: "authorized", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/count.json', + query: 'financial_status=authorized', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2025-01-02T11:30:51-05:00", "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:51-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.close({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/close.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:23-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.open({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/open.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": "other", "cancelled_at": "2025-01-02T11:31:25-05:00", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:25-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": "other", "cancelled_at": "2025-01-02T11:31:21-05:00", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 929361465, "admin_graphql_api_id": "gid://shopify/Refund/929361465", "created_at": "2025-01-02T11:31:21-05:00", "note": "Order canceled", "order_id": 450789469, "processed_at": "2025-01-02T11:31:21-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278491, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491", "amount": "10.00", "authorization": null, "created_at": "2025-01-02T11:31:21-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278490, "payment_id": "c901414060.3", "processed_at": "2025-01-02T11:31:21-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498312, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498313, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498314, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({ + body: {"amount": "10.00", "currency": "USD"}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/cancel.json', + query: '', + headers, + data: {"amount": "10.00", "currency": "USD"} + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": "other", "cancelled_at": "2025-01-02T11:31:11-05:00", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:11-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 929361464, "admin_graphql_api_id": "gid://shopify/Refund/929361464", "created_at": "2025-01-02T11:31:10-05:00", "note": "Order canceled", "order_id": 450789469, "processed_at": "2025-01-02T11:31:10-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976843, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361464, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278487, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278487", "amount": "10.00", "authorization": null, "created_at": "2025-01-02T11:31:10-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278485, "payment_id": "c901414060.4", "processed_at": "2025-01-02T11:31:10-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278488, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278488", "amount": "100.00", "authorization": null, "created_at": "2025-01-02T11:31:10-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278486, "payment_id": "c901414060.5", "processed_at": "2025-01-02T11:31:10-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498311, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({ + body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278485, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278486, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/cancel.json', + query: '', + headers, + data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278485, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278486, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459976, "admin_graphql_api_id": "gid://shopify/Order/1073459976", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "82IFATIRQ", "confirmed": true, "contact_email": null, "created_at": "2025-01-02T11:31:26-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a229dbf865b776cc02ec2d3622008f24/authenticate?key=18f6d9e015b9456e2df645d9a199e584", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "po_number": null, "presentment_currency": "EUR", "processed_at": "2025-01-02T11:31:26-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": false}], "taxes_included": false, "test": false, "token": "a229dbf865b776cc02ec2d3622008f24", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:26-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823188, "admin_graphql_api_id": "gid://shopify/LineItem/1071823188", "attributed_staffs": [], "current_quantity": 3, "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": false, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "title": "Big Brown Bear Boots", + "price": 74.99, + "grams": "1300", + "quantity": 3, + "tax_lines": [ + { + "price": 13.5, + "rate": 0.06, + "title": "State tax" + } + ] + } + ]; + order.transactions = [ + { + "kind": "sale", + "status": "success", + "amount": 238.47 + } + ]; + order.total_tax = 13.5; + order.currency = "EUR"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"title": "Big Brown Bear Boots", "price": 74.99, "grams": "1300", "quantity": 3, "tax_lines": [{"price": 13.5, "rate": 0.06, "title": "State tax"}]}], "transactions": [{"kind": "sale", "status": "success", "amount": 238.47}], "total_tax": 13.5, "currency": "EUR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459980, "admin_graphql_api_id": "gid://shopify/Order/1073459980", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "4LV2G40TZ", "confirmed": true, "contact_email": "jane@example.com", "created_at": "2025-01-02T11:31:36-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/7f65687839eb1871df7dae5fdd0290ff/authenticate?key=19ddde8d7ca3cbe83423d5a819e30677", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:36-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "7f65687839eb1871df7dae5fdd0290ff", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:36-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339474, "email": "paul.norman@example.com", "created_at": "2025-01-02T11:31:36-05:00", "updated_at": "2025-01-02T11:31:37-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339474", "default_address": {"id": 1053317301, "customer_id": 1073339474, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823192, "admin_graphql_api_id": "gid://shopify/LineItem/1071823192", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.customer = { + "first_name": "Paul", + "last_name": "Norman", + "email": "paul.norman@example.com" + }; + order.billing_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "555-555-5555", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.shipping_address = { + "first_name": "Jane", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "777-777-7777", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.email = "jane@example.com"; + order.transactions = [ + { + "kind": "authorization", + "status": "success", + "amount": 50.0 + } + ]; + order.financial_status = "partially_paid"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "customer": {"first_name": "Paul", "last_name": "Norman", "email": "paul.norman@example.com"}, "billing_address": {"first_name": "John", "last_name": "Smith", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "shipping_address": {"first_name": "Jane", "last_name": "Smith", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "email": "jane@example.com", "transactions": [{"kind": "authorization", "status": "success", "amount": 50.0}], "financial_status": "partially_paid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459983, "admin_graphql_api_id": "gid://shopify/Order/1073459983", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "8A254F5WZ", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:31:40-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a5d13692539cbbc478ab2a95ef9ced58/authenticate?key=a96cc5c4257ff918e03620a75fe34304", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:40-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "a5d13692539cbbc478ab2a95ef9ced58", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:40-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:31:40-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823195, "admin_graphql_api_id": "gid://shopify/LineItem/1071823195", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.customer = { + "id": 207119551 + }; + order.financial_status = "pending"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "customer": {"id": 207119551}, "financial_status": "pending"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "XQN8Y1N51", "confirmed": true, "contact_email": "foo@example.com", "created_at": "2025-01-02T11:31:05-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/8b3de232ee7402f33f1258ec40265254/authenticate?key=cb80aa39e6d825db903b1c0325e932ad", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:05-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "8b3de232ee7402f33f1258ec40265254", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:05-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339470, "email": "foo@example.com", "created_at": "2025-01-02T11:31:05-05:00", "updated_at": "2025-01-02T11:31:05-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339470"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2025-01-02T11:31:05-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459972, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2025-01-02T11:31:05-05:00", "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.fulfillments = [ + { + "location_id": 24826418 + } + ]; + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "fulfillments": [{"location_id": 24826418}], "line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459966, "admin_graphql_api_id": "gid://shopify/Order/1073459966", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "1Y3LVXFZ5", "confirmed": true, "contact_email": null, "created_at": "2025-01-02T11:30:54-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/54c72de158fceac79655df1b98077c92/authenticate?key=8f39d6cdd41587f4b3b8851426a4e4d9", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:30:54-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "54c72de158fceac79655df1b98077c92", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:54-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459975, "admin_graphql_api_id": "gid://shopify/Order/1073459975", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "QTY60WTHK", "confirmed": true, "contact_email": "foo@example.com", "created_at": "2025-01-02T11:31:23-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/797972a5525779f09fbca490d825079c/authenticate?key=2eb2936b866aefd439e1419a17698bca", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:23-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "797972a5525779f09fbca490d825079c", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:23-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339471, "email": "foo@example.com", "created_at": "2025-01-02T11:31:23-05:00", "updated_at": "2025-01-02T11:31:23-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339471"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823187, "admin_graphql_api_id": "gid://shopify/LineItem/1071823187", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "R8AWMR0NT", "confirmed": true, "contact_email": "foo@example.com", "created_at": "2025-01-02T11:31:02-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b33b1a488ee98b2fa1a6762c2d815e3f/authenticate?key=034a1a30619620b50ebb5eb4b2ac1228", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:02-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "b33b1a488ee98b2fa1a6762c2d815e3f", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:02-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339468, "email": "foo@example.com", "created_at": "2025-01-02T11:31:02-05:00", "updated_at": "2025-01-02T11:31:03-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339468"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2025-01-02T11:31:03-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459970, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2025-01-02T11:31:03-05:00", "line_items": [{"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.send_receipt = true; + order.send_fulfillment_receipt = true; + order.line_items = [ + { + "variant_id": 457924702, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "send_receipt": true, "send_fulfillment_receipt": true, "line_items": [{"variant_id": 457924702, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459981, "admin_graphql_api_id": "gid://shopify/Order/1073459981", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "P0HNKQN95", "confirmed": true, "contact_email": "jane@example.com", "created_at": "2025-01-02T11:31:38-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "duties_included": false, "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/58d13f0c20a78c55f334a309fe75bd51/authenticate?key=f2fb793948b8756e798251f0bdb4a0b5", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:31:38-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [], "taxes_included": false, "test": false, "token": "58d13f0c20a78c55f334a309fe75bd51", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:38-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339475, "email": "jane@example.com", "created_at": "2025-01-02T11:31:38-05:00", "updated_at": "2025-01-02T11:31:39-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339475", "default_address": {"id": 1053317303, "customer_id": 1073339475, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823193, "admin_graphql_api_id": "gid://shopify/LineItem/1071823193", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.email = "jane@example.com"; + order.phone = "18885551234"; + order.billing_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "555-555-5555", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.shipping_address = { + "first_name": "Jane", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "777-777-7777", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.transactions = [ + { + "kind": "sale", + "status": "success", + "amount": 50.0 + } + ]; + order.financial_status = "paid"; + order.discount_codes = [ + { + "code": "FAKE30", + "amount": "9.00", + "type": "percentage" + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "email": "jane@example.com", "phone": "18885551234", "billing_address": {"first_name": "John", "last_name": "Smith", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "shipping_address": {"first_name": "Jane", "last_name": "Smith", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "transactions": [{"kind": "sale", "status": "success", "amount": 50.0}], "financial_status": "paid", "discount_codes": [{"code": "FAKE30", "amount": "9.00", "type": "percentage"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 1073459963, "admin_graphql_api_id": "gid://shopify/Order/1073459963", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmation_number": "UEL2XH9LG", "confirmed": true, "contact_email": null, "created_at": "2025-01-02T11:30:45-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "duties_included": false, "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/8f9f05ee17a32575cd5ead546094b811/authenticate?key=879676a18d42dc7b11dc818e8bd5641a", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2025-01-02T11:30:45-05:00", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": false}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": false}], "taxes_included": false, "test": false, "token": "8f9f05ee17a32575cd5ead546094b811", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:45-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823173, "admin_graphql_api_id": "gid://shopify/LineItem/1071823173", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": false, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": false, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823175, "admin_graphql_api_id": "gid://shopify/LineItem/1071823175", "attributed_staffs": [], "current_quantity": 2, "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": false, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": false, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "title": "Red Leather Coat", + "price": 129.99, + "grams": "1700", + "quantity": 1 + }, + { + "title": "Blue Suede Shoes", + "price": 85.95, + "grams": "750", + "quantity": 1, + "taxable": false + }, + { + "title": "Raspberry Beret", + "price": 19.99, + "grams": "320", + "quantity": 2 + } + ]; + order.tax_lines = [ + { + "price": 10.2, + "rate": 0.06, + "title": "State tax" + }, + { + "price": 4.25, + "rate": 0.025, + "title": "County tax" + } + ]; + order.total_tax = 14.45; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"title": "Red Leather Coat", "price": 129.99, "grams": "1700", "quantity": 1}, {"title": "Blue Suede Shoes", "price": 85.95, "grams": "750", "quantity": 1, "taxable": false}, {"title": "Raspberry Beret", "price": 19.99, "grams": "320", "quantity": 2}], "tax_lines": [{"price": 10.2, "rate": 0.06, "title": "State tax"}, {"price": 4.25, "rate": 0.025, "title": "County tax"}], "total_tax": 14.45} } + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:18-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.note = "Customer contacted us about a custom engraving on this iPod"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:52-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.note_attributes = [ + { + "name": "colour", + "value": "red" + } + ]; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"note_attributes": [{"name": "colour", "value": "red"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:42-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.email = "a-different@email.com"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"email": "a-different@email.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:14-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.phone = "+15145556677"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"phone": "+15145556677"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:37-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.buyer_accepts_marketing = true; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"buyer_accepts_marketing": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:30:50-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": null, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.customer = null; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"customer": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.tags = "External, Inbound, Outbound"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"tags": "External, Inbound, Outbound"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_33', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmation_number": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "duties_included": false, "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_business_entity_id": "MTU0ODM4MDAwOQ", "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "po_number": "ABC123", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_cash_rounding_payment_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_cash_rounding_refund_adjustment_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2025-01-02T11:31:27-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": "+16136120707", "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2024-01-01T07:00:00-05:00", "consent_collected_from": "OTHER"}, "tags": "L\u00E9on, No\u00EBl", "currency": "USD", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2025-01-02T11:29:59-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z1234512345123456", "tracking_numbers": ["1Z1234512345123456"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z1234512345123456"], "updated_at": "2025-01-02T11:29:59-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "attributed_staffs": [], "current_quantity": 1, "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2025-01-02T11:29:59-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2025-01-02T11:29:59-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "attributed_staffs": [], "current_quantity": 0, "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "is_removed": false, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.shipping_address = { + "address1": "123 Ship Street", + "city": "Shipsville" + }; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"shipping_address": {"address1": "123 Ship Street", "city": "Shipsville"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_34', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Order.delete({ + session: session, + id: 450789469, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/orders/450789469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order_risk.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order_risk.test.ts new file mode 100644 index 0000000000..f9f6ab5ebb --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/order_risk.test.ts @@ -0,0 +1,146 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('OrderRisk resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"risk": {"id": 1029151490, "order_id": 450789469, "checkout_id": 901414060, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order came from an anonymous proxy", "merchant_message": "This order came from an anonymous proxy"}})); + + const order_risk = new shopify.rest.OrderRisk({session: session}); + order_risk.order_id = 450789469; + order_risk.message = "This order came from an anonymous proxy"; + order_risk.recommendation = "cancel"; + order_risk.score = "1.0"; + order_risk.source = "External"; + order_risk.cause_cancel = true; + order_risk.display = true; + await order_risk.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/risks.json', + query: '', + headers, + data: { "risk": {"message": "This order came from an anonymous proxy", "recommendation": "cancel", "score": "1.0", "source": "External", "cause_cancel": true, "display": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"risks": [{"id": 284138680, "order_id": 450789469, "checkout_id": null, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order was placed from a proxy IP", "merchant_message": "This order was placed from a proxy IP"}, {"id": 1029151489, "order_id": 450789469, "checkout_id": 901414060, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order came from an anonymous proxy", "merchant_message": "This order came from an anonymous proxy"}]})); + + await shopify.rest.OrderRisk.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/risks.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"risk": {"id": 284138680, "order_id": 450789469, "checkout_id": null, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order was placed from a proxy IP", "merchant_message": "This order was placed from a proxy IP"}})); + + await shopify.rest.OrderRisk.find({ + session: session, + order_id: 450789469, + id: 284138680, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"risk": {"order_id": 450789469, "cause_cancel": false, "message": "After further review, this is a legitimate order", "recommendation": "accept", "score": "0.0", "source": "External", "id": 284138680, "checkout_id": null, "display": true, "merchant_message": "After further review, this is a legitimate order"}})); + + const order_risk = new shopify.rest.OrderRisk({session: session}); + order_risk.order_id = 450789469; + order_risk.id = 284138680; + order_risk.message = "After further review, this is a legitimate order"; + order_risk.recommendation = "accept"; + order_risk.source = "External"; + order_risk.cause_cancel = false; + order_risk.score = "0.0"; + await order_risk.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: { "risk": {"message": "After further review, this is a legitimate order", "recommendation": "accept", "source": "External", "cause_cancel": false, "score": "0.0"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.OrderRisk.delete({ + session: session, + order_id: 450789469, + id: 284138680, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/page.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/page.test.ts new file mode 100644 index 0000000000..0df26eafac --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/page.test.ts @@ -0,0 +1,327 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Page resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}]})); + + await shopify.rest.Page.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/169524623"}]})); + + await shopify.rest.Page.all({ + session: session, + since_id: "108828309", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages.json', + query: 'since_id=108828309', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"id": 1025371368, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2025-01-02T11:35:08-05:00", "updated_at": "2025-01-02T11:35:08-05:00", "published_at": "2025-01-02T11:35:08-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/1025371368"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"id": 1025371371, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2025-01-02T11:35:18-05:00", "updated_at": "2025-01-02T11:35:18-05:00", "published_at": "2025-01-02T11:35:18-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/1025371371"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"id": 1025371369, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2025-01-02T11:35:15-05:00", "updated_at": "2025-01-02T11:35:15-05:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/1025371369"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.published = false; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Page.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + await shopify.rest.Page.find({ + session: session, + id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2025-01-02T11:35:08-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.published = false; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2025-01-02T11:35:09-05:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2025-01-02T11:35:09-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.published = true; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2025-01-02T11:35:20-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + page.author = "Christopher Gorski"; + page.title = "New warranty"; + page.handle = "new-warranty"; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2025-01-02T11:35:13-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/Page/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Page.delete({ + session: session, + id: 131092082, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment.test.ts new file mode 100644 index 0000000000..181653851a --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment.test.ts @@ -0,0 +1,99 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Payment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment": {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2026, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "421.88", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}}, "credit_card": null}, {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2026, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "421.88", "total_tax": "23.88", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2025-01-02T11:10:24-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "Tax", "channel_liable": false}]}], "gift_cards": [], "tax_lines": [{"price": "23.88", "rate": 0.06, "title": "Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2026, "customer_id": 207119551}, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + const payment = new shopify.rest.Payment({session: session}); + payment.checkout_id = "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x"; + payment.request_details = { + "ip_address": "123.1.1.1", + "accept_language": "en-US,en;q=0.8,fr;q=0.6", + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" + }; + payment.amount = "421.88"; + payment.session_id = "global-3c2223e8018ca0e3"; + payment.unique_token = "client-side-idempotency-token"; + await payment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', + query: '', + headers, + data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "421.88", "session_id": "global-3c2223e8018ca0e3", "unique_token": "client-side-idempotency-token"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2025-01-02T11:10:14-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278463, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2025-01-02T11:10:14-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278463, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + await shopify.rest.Payment.find({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + id: 25428999, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments/25428999.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2025-01-02T11:10:20-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278464, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2025-01-02T11:10:20-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278464, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "60715a3461f5f853", "key": "60715a3461f5f853", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "0703986f986628ba", "key": "0703986f986628ba", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 921093900, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + await shopify.rest.Payment.find({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + id: 25428999, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments/25428999.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_gateway.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_gateway.test.ts new file mode 100644 index 0000000000..957d8eb433 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_gateway.test.ts @@ -0,0 +1,155 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('PaymentGateway resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}, {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2025-01-02T11:20:26-05:00", "credential4": null, "attachment": null}]})); + + await shopify.rest.PaymentGateway.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/payment_gateways.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2025-01-02T11:20:25-05:00", "credential4": null, "attachment": null}]})); + + await shopify.rest.PaymentGateway.all({ + session: session, + disabled: "false", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/payment_gateways.json', + query: 'disabled=false', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1071179973, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2025-01-02T11:20:29-05:00", "updated_at": "2025-01-02T11:20:29-05:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.credential1 = "someone@example.com"; + payment_gateway.provider_id = 7; + await payment_gateway.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/payment_gateways.json', + query: '', + headers, + data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2025-01-02T11:20:27-05:00", "credential4": null, "attachment": null}})); + + await shopify.rest.PaymentGateway.find({ + session: session, + id: 431363653, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/payment_gateways/431363653.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:20:25-05:00"}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.id = 170508070; + payment_gateway.sandbox = true; + await payment_gateway.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/payment_gateways/170508070.json', + query: '', + headers, + data: { "payment_gateway": {"sandbox": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.PaymentGateway.delete({ + session: session, + id: 170508070, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/payment_gateways/170508070.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_transaction.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_transaction.test.ts new file mode 100644 index 0000000000..4a9230fa4c --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payment_transaction.test.ts @@ -0,0 +1,46 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('PaymentTransaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transactions": [{"id": 716142630, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-0.75", "fee": "0.00", "net": "-0.75", "source_id": 514396116, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-10-31T20:00:00-04:00", "adjustment_order_transactions": [], "adjustment_reason": "tax_adjustment"}, {"id": 476425693, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "1.50", "fee": "0.00", "net": "1.50", "source_id": 206869143, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-10-31T20:00:00-04:00", "adjustment_order_transactions": [], "adjustment_reason": "tax_adjustment"}, {"id": 396322840, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "0.25", "fee": "0.00", "net": "0.25", "source_id": 105592054, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-10-31T20:00:00-04:00", "adjustment_order_transactions": [], "adjustment_reason": "tax_adjustment"}, {"id": 348058882, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-0.75", "fee": "0.00", "net": "-0.75", "source_id": 616988872, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-10-31T20:00:00-04:00", "adjustment_order_transactions": [], "adjustment_reason": "tax_adjustment"}, {"id": 699519475, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-50.00", "fee": "0.00", "net": "-50.00", "source_id": 460709370, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-01-11T07:34:56-05:00", "adjustment_order_transactions": [], "adjustment_reason": "billing"}, {"id": 77412310, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "50.00", "fee": "0.00", "net": "50.00", "source_id": 374511569, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-01-11T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 1044362223, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-3.45", "fee": "0.00", "net": "-3.45", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 1006917261, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-3.45", "fee": "0.00", "net": "-3.45", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 777128868, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-8.05", "fee": "0.00", "net": "-8.05", "source_id": 777128868, "source_type": "Payments::Refund", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 758509248, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-1.50", "fee": "-0.25", "net": "-1.75", "source_id": 764194150, "source_type": "charge", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 746296004, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "10.00", "fee": "2.00", "net": "8.00", "source_id": 746296004, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 890672011, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 515523000, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.65", "net": "10.85", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 482793472, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "0.45", "fee": "0.00", "net": "0.45", "source_id": 204289877, "source_type": "charge", "source_order_id": 217130470, "source_order_transaction_id": 567994517, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 382557793, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "0.20", "fee": "0.00", "net": "0.20", "source_id": 204289877, "source_type": "charge", "source_order_id": 217130470, "source_order_transaction_id": 567994517, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 365577382, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-3.45", "fee": "0.00", "net": "-3.45", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 201521674, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-2.00", "fee": "0.00", "net": "-2.00", "source_id": 971443537, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 461790020, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 188711209, "type": "capture", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-11.37", "fee": "0.00", "net": "-11.37", "source_id": 188711209, "source_type": "charge", "source_order_id": 923751907, "source_order_transaction_id": 972637531, "processed_at": "2024-01-10T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 977134221, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "15.00", "net": "-115.00", "source_id": 297752803, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 774282320, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "15.00", "net": "-115.00", "source_id": 46484353, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 726130462, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-11.50", "fee": "15.00", "net": "-26.50", "source_id": 598735659, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 590656313, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "15.00", "net": "-115.00", "source_id": 297752803, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 585267611, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-50.00", "fee": "0.00", "net": "-50.00", "source_id": 46484353, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 295058327, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "-15.00", "net": "115.00", "source_id": 297752803, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 144665135, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "2.83", "fee": "-15.00", "net": "17.83", "source_id": 297752803, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2023-12-31T07:34:56-05:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 1039379438, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-10.00", "fee": "0.00", "net": "-10.00", "source_id": 98265485, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "channel_transfer"}, {"id": 996672915, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 996672915, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 972818242, "type": "reserve", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-42.00", "fee": "0.00", "net": "-42.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 951890146, "type": "advance", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 911614749, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 31693764, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "shop_cash_refund"}, {"id": 843310825, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.63", "net": "10.87", "source_id": 843310825, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 841651232, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 841651232, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 777723124, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 777723124, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 744334347, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 14450113, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [{"id": 348327371, "amount": "11.50", "order": {"id": 625362839, "name": "#1001"}}], "adjustment_reason": "shopify_collective_credit"}, {"id": 717600021, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 717600021, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "chargeback_protection"}, {"id": 645292099, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 717600021, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "chargeback_protection"}, {"id": 637679484, "type": "SHOPIFY_COLLECTIVE_DEBIT_REVERSAL", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "1.00", "fee": "0.00", "net": "1.00", "source_id": 637679484, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 620327031, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.63", "net": "10.87", "source_id": 620327031, "source_type": "charge", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 524892362, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 87730317, "source_type": "adjustment", "source_order_id": 625362839, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [{"id": 348327371, "amount": "11.50", "order": {"id": 625362839, "name": "#1001"}}], "adjustment_reason": "shopify_collective_debit"}, {"id": 510004917, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 504962724, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "shop_cash_campaign_billing"}, {"id": 504303358, "type": "seller_protection_credit_reversal", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 504303358, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 459441379, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 14450113, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [{"id": 348327371, "amount": "11.50", "order": {"id": 625362839, "name": "#1001"}}], "adjustment_reason": "shopify_collective_credit"}, {"id": 427940661, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "150.00", "fee": "0.00", "net": "150.00", "source_id": 427940661, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 381560291, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-150.00", "fee": "0.00", "net": "-150.00", "source_id": 381560291, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "chargeback_protection"}, {"id": 357948134, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "10.00", "fee": "0.46", "net": "9.54", "source_id": 971443537, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 461790020, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 344667176, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.50", "fee": "0.50", "net": "100.00", "source_id": 291591126, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "shop_cash"}, {"id": 316417004, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.50", "net": "11.00", "source_id": 316417004, "source_type": "charge", "source_order_id": 753768948, "source_order_transaction_id": 316417004, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 294868963, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 294868963, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 268738895, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "1000.00", "fee": "0.00", "net": "1000.00", "source_id": 60315799, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": [], "adjustment_reason": "anomaly"}, {"id": 232023232, "type": "reserve", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "42.00", "fee": "0.00", "net": "42.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}, {"id": 222417706, "type": "advance_funding", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-10.00", "fee": "0.00", "net": "-10.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00", "adjustment_order_transactions": null, "adjustment_reason": null}]})); + + await shopify.rest.PaymentTransaction.transactions({ + session: session, + payout_id: "623721858", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/balance/transactions.json', + query: 'payout_id=623721858', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payout.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payout.test.ts new file mode 100644 index 0000000000..dad4e50721 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/payout.test.ts @@ -0,0 +1,89 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Payout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payouts": [{"id": 512467833, "status": "failed", "date": "2013-12-01", "currency": "USD", "amount": "43.12", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "45.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 39438702, "status": "in_transit", "date": "2013-11-01", "currency": "USD", "amount": "43.12", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "45.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 917000993, "status": "failed", "date": "2012-11-13", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 867808544, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 725076685, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 714327683, "status": "failed", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 631321250, "status": "scheduled", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}]})); + + await shopify.rest.Payout.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/payouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payouts": [{"id": 867808544, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 725076685, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 714327683, "status": "failed", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 631321250, "status": "scheduled", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}]})); + + await shopify.rest.Payout.all({ + session: session, + date_max: "2012-11-12", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/payouts.json', + query: 'date_max=2012-11-12', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"payout": {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}})); + + await shopify.rest.Payout.find({ + session: session, + id: 623721858, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shopify_payments/payouts/623721858.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/policy.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/policy.test.ts new file mode 100644 index 0000000000..ab4621cff8 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/policy.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Policy resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2025-01-02T11:31:46-05:00", "updated_at": "2025-01-02T11:31:46-05:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/997884056"}]})); + + await shopify.rest.Policy.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/policies.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/price_rule.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/price_rule.test.ts new file mode 100644 index 0000000000..646d8e08b0 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/price_rule.test.ts @@ -0,0 +1,284 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('PriceRule resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 1057371197, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2025-01-02T11:20:21-05:00", "updated_at": "2025-01-02T11:20:21-05:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/1057371197"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "Buy2iPodsGetiPodTouchForFree"; + price_rule.value_type = "percentage"; + price_rule.value = "-100.0"; + price_rule.customer_selection = "all"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "entitled"; + price_rule.allocation_method = "each"; + price_rule.starts_at = "2018-03-22T00:00:00-00:00"; + price_rule.prerequisite_collection_ids = [ + 841564295 + ]; + price_rule.entitled_product_ids = [ + 921728736 + ]; + price_rule.prerequisite_to_entitlement_quantity_ratio = { + "prerequisite_quantity": 2, + "entitled_quantity": 1 + }; + price_rule.allocation_limit = 3; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "Buy2iPodsGetiPodTouchForFree", "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "starts_at": "2018-03-22T00:00:00-00:00", "prerequisite_collection_ids": [841564295], "entitled_product_ids": [921728736], "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "allocation_limit": 3} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 1057371199, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2025-01-02T11:20:24-05:00", "updated_at": "2025-01-02T11:20:24-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/1057371199"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "SUMMERSALE10OFF"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "across"; + price_rule.value_type = "fixed_amount"; + price_rule.value = "-10.0"; + price_rule.customer_selection = "all"; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 1057371198, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2025-01-02T11:20:23-05:00", "updated_at": "2025-01-02T11:20:23-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/1057371198"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "15OFFCOLLECTION"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "entitled"; + price_rule.allocation_method = "across"; + price_rule.value_type = "percentage"; + price_rule.value = "-15.0"; + price_rule.customer_selection = "all"; + price_rule.entitled_collection_ids = [ + 841564295 + ]; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 1057371196, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2025-01-02T11:20:20-05:00", "updated_at": "2025-01-02T11:20:20-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/1057371196"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "FREESHIPPING"; + price_rule.target_type = "shipping_line"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "each"; + price_rule.value_type = "percentage"; + price_rule.value = "-100.0"; + price_rule.usage_limit = 20; + price_rule.customer_selection = "all"; + price_rule.prerequisite_subtotal_range = { + "greater_than_or_equal_to": "50.0" + }; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2024-12-27T11:09:43-05:00", "ends_at": "2025-01-08T11:09:43-05:00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2024-12-31T11:09:43-05:00", "ends_at": "2025-01-04T11:09:43-05:00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); + + await shopify.rest.PriceRule.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2024-12-27T11:09:43-05:00", "ends_at": "2025-01-08T11:09:43-05:00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); + + await shopify.rest.PriceRule.all({ + session: session, + since_id: "106886545", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules.json', + query: 'since_id=106886545', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2024-12-27T11:09:43-05:00", "ends_at": "2025-01-08T11:09:43-05:00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:20:24-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.id = 507328175; + price_rule.title = "WINTER SALE"; + await price_rule.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/price_rules/507328175.json', + query: '', + headers, + data: { "price_rule": {"title": "WINTER SALE"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2024-12-27T11:09:43-05:00", "ends_at": "2025-01-08T11:09:43-05:00", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + + await shopify.rest.PriceRule.find({ + session: session, + id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.PriceRule.delete({ + session: session, + id: 507328175, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/price_rules/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.PriceRule.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/price_rules/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product.test.ts new file mode 100644 index 0000000000..f838e16959 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product.test.ts @@ -0,0 +1,873 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Product resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-touch", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2009BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529", "image_id": null}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + ids: "632910392,921728736", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: 'ids=632910392%2C921728736', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-touch", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2009BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529", "image_id": null}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-touch", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2009BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529", "image_id": null}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + since_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: 'since_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}]})); + + await shopify.rest.Product.all({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-touch", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2009BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529", "image_id": null}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + presentment_currencies: "USD", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: 'presentment_currencies=USD', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); + + await shopify.rest.Product.all({ + session: session, + fields: "id,images,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products.json', + query: 'fields=id%2Cimages%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Product.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Product.count({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/count.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + await shopify.rest.Product.find({ + session: session, + id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}]}})); + + await shopify.rest.Product.find({ + session: session, + id: 632910392, + fields: "id,images,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: 'fields=id%2Cimages%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:35:57-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:09-05:00", "published_at": null, "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.published = false; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:41-05:00", "published_at": "2025-01-02T11:36:41-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.published = true; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:40-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:40-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "Updating the Product SKU", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "2000.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.title = "Updated Product Title"; + product.variants = [ + { + "id": 808950810, + "price": "2000.00", + "sku": "Updating the Product SKU" + }, + { + "id": 49148385 + }, + { + "id": 39072856 + }, + { + "id": 457924702 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:58-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 1001473910, "alt": null, "position": 4, "product_id": 632910392, "created_at": "2025-01-02T11:36:58-05:00", "updated_at": "2025-01-02T11:36:58-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273207", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo20250102-63224-i8ga8z.gif?v=1735835818", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190 + }, + { + "id": 562641783 + }, + { + "id": 378407906 + }, + { + "src": "http://example.com/rails_logo.gif" + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:35:58-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:35:58-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": null}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = []; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": []} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:44-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:44-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 850703190, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:44-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835804", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}], "image": {"id": 378407906, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:44-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190, + "position": 3 + }, + { + "id": 562641783, + "position": 2 + }, + { + "id": 378407906, + "position": 1 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:38-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:38-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:38-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:38-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:36:38-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.variants = [ + { + "id": 457924702 + }, + { + "id": 39072856 + }, + { + "id": 49148385 + }, + { + "id": 808950810 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:29:59-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields_global_title_tag = "Brand new title"; + product.metafields_global_description_tag = "Brand new description"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:49-05:00", "published_at": null, "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "draft", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.status = "draft"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"status": "draft"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:36:13-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.tags = "Barnes & Noble, John's Fav"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"tags": "Barnes & Noble, John's Fav"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2025-01-02T11:29:59-05:00", "handle": "ipod-nano", "updated_at": "2025-01-02T11:35:46-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}, {"id": 562641783, "alt": null, "position": 2, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1071517486", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735835399", "variant_ids": [808950810]}, {"id": 378407906, "alt": null, "position": 3, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/220090436", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}], "image": {"id": 850703190, "alt": null, "position": 1, "product_id": 632910392, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/498048120", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735835399", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.title = "New product title"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: { "product": {"title": "New product title"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Product.delete({ + session: session, + id: 632910392, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/products/632910392.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481050, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:28-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:28-05:00", "published_at": null, "template_suffix": null, "published_scope": "web", "tags": "", "status": "draft", "admin_graphql_api_id": "gid://shopify/Product/1072481050", "variants": [{"id": 1070325028, "product_id": 1072481050, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:28-05:00", "updated_at": "2025-01-02T11:36:28-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325028, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325028", "image_id": null}], "options": [{"id": 1064576492, "product_id": 1072481050, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.status = "draft"; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481048, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:27-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:27-05:00", "published_at": "2025-01-02T11:36:27-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481048", "variants": [{"id": 1070325025, "product_id": 1072481048, "title": "First", "price": "10.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "First", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:27-05:00", "updated_at": "2025-01-02T11:36:27-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "123", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325025, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325025", "image_id": null}, {"id": 1070325026, "product_id": 1072481048, "title": "Second", "price": "20.00", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:27-05:00", "updated_at": "2025-01-02T11:36:27-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "123", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325026, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325026", "image_id": null}], "options": [{"id": 1064576490, "product_id": 1072481048, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ + { + "option1": "First", + "price": "10.00", + "sku": "123" + }, + { + "option1": "Second", + "price": "20.00", + "sku": "123" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481053, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:39-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:39-05:00", "published_at": "2025-01-02T11:36:39-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481053", "variants": [{"id": 1070325032, "product_id": 1072481053, "title": "Blue / 155", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2025-01-02T11:36:39-05:00", "updated_at": "2025-01-02T11:36:39-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325032, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325032", "image_id": null}, {"id": 1070325033, "product_id": 1072481053, "title": "Black / 159", "price": "0.00", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2025-01-02T11:36:39-05:00", "updated_at": "2025-01-02T11:36:39-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325033, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325033", "image_id": null}], "options": [{"id": 1064576499, "product_id": 1072481053, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1064576500, "product_id": 1072481053, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ + { + "option1": "Blue", + "option2": "155" + }, + { + "option1": "Black", + "option2": "159" + } + ]; + product.options = [ + { + "name": "Color", + "values": [ + "Blue", + "Black" + ] + }, + { + "name": "Size", + "values": [ + "155", + "159" + ] + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481055, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:46-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:46-05:00", "published_at": "2025-01-02T11:36:46-05:00", "template_suffix": null, "published_scope": "global", "tags": "Barnes & Noble, Big Air, John's Fav", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481055", "variants": [{"id": 1070325035, "product_id": 1072481055, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:46-05:00", "updated_at": "2025-01-02T11:36:46-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325035, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325035", "image_id": null}], "options": [{"id": 1064576504, "product_id": 1072481055, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.tags = [ + "Barnes & Noble", + "Big Air", + "John's Fav" + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481042, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:35:54-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:35:54-05:00", "published_at": "2025-01-02T11:35:54-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481042", "variants": [{"id": 1070325019, "product_id": 1072481042, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:35:54-05:00", "updated_at": "2025-01-02T11:35:54-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325019, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019", "image_id": null}], "options": [{"id": 1064576483, "product_id": 1072481042, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473907, "alt": null, "position": 1, "product_id": 1072481042, "created_at": "2025-01-02T11:35:54-05:00", "updated_at": "2025-01-02T11:35:54-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273204", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo20250102-63224-bpqtol.gif?v=1735835754", "variant_ids": []}], "image": {"id": 1001473907, "alt": null, "position": 1, "product_id": 1072481042, "created_at": "2025-01-02T11:35:54-05:00", "updated_at": "2025-01-02T11:35:54-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273204", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/rails_logo20250102-63224-bpqtol.gif?v=1735835754", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "src": "http://example.com/rails_logo.gif" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481047, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:25-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:25-05:00", "published_at": "2025-01-02T11:36:25-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481047", "variants": [{"id": 1070325024, "product_id": 1072481047, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:25-05:00", "updated_at": "2025-01-02T11:36:25-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325024, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325024", "image_id": null}], "options": [{"id": 1064576489, "product_id": 1072481047, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473909, "alt": null, "position": 1, "product_id": 1072481047, "created_at": "2025-01-02T11:36:25-05:00", "updated_at": "2025-01-02T11:36:25-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273206", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1735835785", "variant_ids": []}], "image": {"id": 1001473909, "alt": null, "position": 1, "product_id": 1072481047, "created_at": "2025-01-02T11:36:25-05:00", "updated_at": "2025-01-02T11:36:25-05:00", "admin_graphql_api_id": "gid://shopify/MediaImage/1072273206", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/files/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1735835785", "variant_ids": []}}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481045, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:11-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:12-05:00", "published_at": null, "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481045", "variants": [{"id": 1070325021, "product_id": 1072481045, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:12-05:00", "updated_at": "2025-01-02T11:36:12-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325021, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325021", "image_id": null}], "options": [{"id": 1064576487, "product_id": 1072481045, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.published = false; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481049, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:27-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:27-05:00", "published_at": "2025-01-02T11:36:27-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481049", "variants": [{"id": 1070325027, "product_id": 1072481049, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:27-05:00", "updated_at": "2025-01-02T11:36:27-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325027, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325027", "image_id": null}], "options": [{"id": 1064576491, "product_id": 1072481049, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product": {"id": 1072481058, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2025-01-02T11:36:51-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2025-01-02T11:36:51-05:00", "published_at": "2025-01-02T11:36:51-05:00", "template_suffix": null, "published_scope": "global", "tags": "", "status": "active", "admin_graphql_api_id": "gid://shopify/Product/1072481058", "variants": [{"id": 1070325038, "product_id": 1072481058, "title": "Default Title", "price": "0.00", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2025-01-02T11:36:51-05:00", "updated_at": "2025-01-02T11:36:51-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": null, "requires_shipping": true, "sku": "", "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325038, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325038", "image_id": null}], "options": [{"id": 1064576509, "product_id": 1072481058, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields_global_title_tag = "Product SEO Title"; + product.metafields_global_description_tag = "Product SEO Description"; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_listing.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_listing.test.ts new file mode 100644 index 0000000000..ea29a18e49 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_listing.test.ts @@ -0,0 +1,152 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ProductListing resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}], "images": [{"id": 850703190, "created_at": "2025-01-02T11:09:43-05:00", "position": 1, "updated_at": "2025-01-02T11:09:43-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2025-01-02T11:09:43-05:00", "position": 2, "updated_at": "2025-01-02T11:09:43-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1735834183", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2025-01-02T11:09:43-05:00", "position": 3, "updated_at": "2025-01-02T11:09:43-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1735834183", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); + + await shopify.rest.ProductListing.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_listings.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product_ids": [921728736, 632910392]})); + + await shopify.rest.ProductListing.product_ids({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_listings/product_ids.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.ProductListing.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_listings/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + + await shopify.rest.ProductListing.find({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/product_listings/921728736.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + + const product_listing = new shopify.rest.ProductListing({session: session}); + product_listing.product_id = 921728736; + await product_listing.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/product_listings/921728736.json', + query: '', + headers, + data: { "product_listing": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ProductListing.delete({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/product_listings/921728736.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_resource_feedback.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_resource_feedback.test.ts new file mode 100644 index 0000000000..34704bd4c8 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/product_resource_feedback.test.ts @@ -0,0 +1,97 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ProductResourceFeedback resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2025-01-02T11:22:24-05:00", "updated_at": "2025-01-02T11:22:24-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2025-01-02T11:09:43-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2025-01-02T11:22:23-05:00", "state": "requires_action"}})); + + const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); + product_resource_feedback.product_id = 632910392; + product_resource_feedback.state = "requires_action"; + product_resource_feedback.messages = [ + "Needs at least one image." + ]; + product_resource_feedback.resource_updated_at = "2025-01-02T11:09:43-05:00"; + product_resource_feedback.feedback_generated_at = "2025-01-02T16:22:23.605756Z"; + await product_resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2025-01-02T11:09:43-05:00", "feedback_generated_at": "2025-01-02T16:22:23.605756Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2025-01-02T11:22:23-05:00", "updated_at": "2025-01-02T11:22:23-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2025-01-02T11:09:43-05:00", "messages": [], "feedback_generated_at": "2025-01-02T11:22:23-05:00", "state": "success"}})); + + const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); + product_resource_feedback.product_id = 632910392; + product_resource_feedback.state = "success"; + product_resource_feedback.resource_updated_at = "2025-01-02T11:09:43-05:00"; + product_resource_feedback.feedback_generated_at = "2025-01-02T16:22:23.139254Z"; + await product_resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "success", "resource_updated_at": "2025-01-02T11:09:43-05:00", "feedback_generated_at": "2025-01-02T16:22:23.139254Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2025-01-02T11:22:20-05:00", "updated_at": "2025-01-02T11:22:20-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2025-01-02T11:09:43-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2025-01-02T10:22:20-05:00", "state": "requires_action"}]})); + + await shopify.rest.ProductResourceFeedback.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/province.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/province.test.ts new file mode 100644 index 0000000000..269b412861 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/province.test.ts @@ -0,0 +1,137 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Province resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]})); + + await shopify.rest.Province.all({ + session: session, + country_id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/879921427/provinces.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"provinces": [{"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]})); + + await shopify.rest.Province.all({ + session: session, + country_id: 879921427, + since_id: "536137098", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/879921427/provinces.json', + query: 'since_id=536137098', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 13})); + + await shopify.rest.Province.count({ + session: session, + country_id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/879921427/provinces/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"province": {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}})); + + await shopify.rest.Province.find({ + session: session, + country_id: 879921427, + id: 224293623, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/countries/879921427/provinces/224293623.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"province": {"country_id": 879921427, "id": 224293623, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}})); + + const province = new shopify.rest.Province({session: session}); + province.country_id = 879921427; + province.id = 224293623; + province.tax = 0.09; + await province.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/countries/879921427/provinces/224293623.json', + query: '', + headers, + data: { "province": {"tax": 0.09} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/recurring_application_charge.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/recurring_application_charge.test.ts new file mode 100644 index 0000000000..6daf8caf76 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/recurring_application_charge.test.ts @@ -0,0 +1,230 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('RecurringApplicationCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "price": "10.00", "billing_on": null, "status": "pending", "created_at": "2025-01-02T11:10:31-05:00", "updated_at": "2025-01-02T11:10:31-05:00", "activated_on": null, "return_url": "http://super-duper.shopifyapps.com/", "test": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--5d3422b29fc518b770f1dc29f33408b2702fd244", "currency": "USD"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.trial_days = 5; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266950, "name": "Super Duper Plan", "price": "10.00", "billing_on": null, "status": "pending", "created_at": "2025-01-02T11:10:30-05:00", "updated_at": "2025-01-02T11:10:30-05:00", "activated_on": null, "return_url": "http://super-duper.shopifyapps.com/", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266950", "capped_amount": "100.00", "balance_used": 0, "balance_remaining": "100.00", "risk_level": 0, "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266950/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAZeWT06EmF1dG9fYWN0aXZhdGVU--1a27035cd74cb04125ca75347ba33295072249fd", "currency": "USD"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.capped_amount = 100; + recurring_application_charge.terms = "$1 for 1000 emails"; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266947, "name": "Super Duper Plan", "price": "10.00", "billing_on": null, "status": "pending", "created_at": "2025-01-02T11:10:25-05:00", "updated_at": "2025-01-02T11:10:25-05:00", "activated_on": null, "return_url": "http://super-duper.shopifyapps.com/", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--13dbd717accea352543a04313e8fcd7957c4cde4", "currency": "USD"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266949, "name": "Super Duper Plan", "price": "10.00", "billing_on": null, "status": "pending", "created_at": "2025-01-02T11:10:29-05:00", "updated_at": "2025-01-02T11:10:29-05:00", "activated_on": null, "return_url": "http://super-duper.shopifyapps.com/", "test": true, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266949", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--1f151a17fb46cdc82cd243f92608fae2885ac0bb", "currency": "USD"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.test = true; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "price": "15.00", "billing_on": "2025-01-02", "status": "accepted", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:10:34-05:00", "activated_on": null, "return_url": "http://yourapp.example.org", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "currency": "USD"}]})); + + await shopify.rest.RecurringApplicationCharge.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266953, "name": "Super Duper Plan", "price": "10.00", "billing_on": null, "status": "pending", "created_at": "2025-01-02T11:10:35-05:00", "updated_at": "2025-01-02T11:10:35-05:00", "activated_on": null, "return_url": "http://super-duper.shopifyapps.com/", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266953", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266953/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAleWT06EmF1dG9fYWN0aXZhdGVU--0395a63fec46f517b12dc65dd7330d14f461e801", "currency": "USD"}]})); + + await shopify.rest.RecurringApplicationCharge.all({ + session: session, + since_id: "455696195", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/recurring_application_charges.json', + query: 'since_id=455696195', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "price": "15.00", "billing_on": "2025-01-02", "status": "pending", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "activated_on": null, "return_url": "http://yourapp.example.org", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "api_client_id": 755357713, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c", "currency": "USD"}})); + + await shopify.rest.RecurringApplicationCharge.find({ + session: session, + id: 455696195, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.RecurringApplicationCharge.delete({ + session: session, + id: 455696195, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "price": "15.00", "billing_on": null, "status": "active", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:10:33-05:00", "activated_on": "2025-01-02", "return_url": "http://yourapp.example.org", "test": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": "2025-01-02", "api_client_id": 755357713, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "capped_amount": "100.00", "balance_used": "0.0", "balance_remaining": "100.00", "risk_level": 0, "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--0d202ac9e22df0d6d100239ef2ae9ca6ba0a648f", "currency": "USD"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.id = 455696195; + await recurring_application_charge.customize({ + recurring_application_charge: {"capped_amount": "200"}, + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195/customize.json', + query: 'recurring_application_charge%5Bcapped_amount%5D=200', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/redirect.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/redirect.test.ts new file mode 100644 index 0000000000..866a3ea2cc --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/redirect.test.ts @@ -0,0 +1,243 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Redirect resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirects": [{"id": 950115854, "path": "/ibook", "target": "/products/macbook"}]})); + + await shopify.rest.Redirect.all({ + session: session, + since_id: "668809255", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/redirects.json', + query: 'since_id=668809255', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirects": [{"id": 304339089, "path": "/products.php", "target": "/products"}, {"id": 668809255, "path": "/leopard", "target": "/pages/macosx"}, {"id": 950115854, "path": "/ibook", "target": "/products/macbook"}]})); + + await shopify.rest.Redirect.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/redirects.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Redirect.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/redirects/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"id": 668809255, "path": "/leopard", "target": "/pages/macosx"}})); + + await shopify.rest.Redirect.find({ + session: session, + id: 668809255, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/redirects/668809255.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"path": "/powermac", "target": "/pages/macpro", "id": 950115854}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 950115854; + redirect.path = "/powermac"; + redirect.target = "/pages/macpro"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/redirects/950115854.json', + query: '', + headers, + data: { "redirect": {"path": "/powermac", "target": "/pages/macpro"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"path": "/tiger", "target": "/pages/macosx", "id": 668809255}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 668809255; + redirect.path = "/tiger"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/redirects/668809255.json', + query: '', + headers, + data: { "redirect": {"path": "/tiger"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"target": "/pages/macpro", "path": "/leopard", "id": 668809255}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 668809255; + redirect.target = "/pages/macpro"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/redirects/668809255.json', + query: '', + headers, + data: { "redirect": {"target": "/pages/macpro"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Redirect.delete({ + session: session, + id: 668809255, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/redirects/668809255.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/ipod", "target": "/pages/itunes"}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.path = "/ipod"; + redirect.target = "/pages/itunes"; + await redirect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/redirects.json', + query: '', + headers, + data: { "redirect": {"path": "/ipod", "target": "/pages/itunes"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/forums", "target": "http://forums.apple.com/"}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.path = "http://www.apple.com/forums"; + redirect.target = "http://forums.apple.com"; + await redirect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/redirects.json', + query: '', + headers, + data: { "redirect": {"path": "http://www.apple.com/forums", "target": "http://forums.apple.com"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/refund.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/refund.test.ts new file mode 100644 index 0000000000..aef41919da --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/refund.test.ts @@ -0,0 +1,214 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Refund resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2025-01-02T11:38:15-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2025-01-02T11:38:15-05:00", "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "restock": true, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [], "admin_graphql_api_id": "gid://shopify/Refund/509562969", "order_adjustments": [], "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}]}]})); + + await shopify.rest.Refund.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"id": 929361472, "order_id": 450789469, "created_at": "2025-01-02T11:38:34-05:00", "note": "wrong size", "user_id": null, "processed_at": "2025-01-02T11:38:34-05:00", "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "restock": false, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [], "admin_graphql_api_id": "gid://shopify/Refund/929361472", "order_adjustments": [], "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498320, "line_item_id": 518995019, "subtotal": 0.0, "total_tax": 0.0, "subtotal_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278526, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:38:34-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2025-01-02T11:38:34-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278526"}]}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + refund.currency = "USD"; + refund.notify = true; + refund.note = "wrong size"; + refund.shipping = { + "full_refund": true + }; + refund.refund_line_items = [ + { + "line_item_id": 518995019, + "quantity": 1, + "restock_type": "return", + "location_id": 487838322 + } + ]; + refund.transactions = [ + { + "parent_id": 801038806, + "amount": 41.94, + "kind": "refund", + "gateway": "bogus" + } + ]; + await refund.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"id": 929361471, "order_id": 450789469, "created_at": "2025-01-02T11:38:32-05:00", "note": null, "user_id": null, "processed_at": "2025-01-02T11:38:32-05:00", "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "restock": false, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [{"id": 623176826, "shipping_line_id": 369256396, "subtotal_amount_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "shipping_line": {"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "5.00", "discounted_price_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "phone": null, "price": "5.00", "price_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}}], "admin_graphql_api_id": "gid://shopify/Refund/929361471", "order_adjustments": [{"id": 1030976844, "order_id": 450789469, "refund_id": 929361471, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "refund_line_items": [], "transactions": [{"id": 1068278525, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:38:32-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2025-01-02T11:38:32-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278525"}]}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + refund.currency = "USD"; + refund.shipping = { + "amount": 5.0 + }; + refund.transactions = [ + { + "parent_id": 801038806, + "amount": 5.0, + "kind": "refund", + "gateway": "web" + } + ]; + await refund.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "web"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2025-01-02T11:38:15-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2025-01-02T11:38:15-05:00", "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "restock": true, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [], "admin_graphql_api_id": "gid://shopify/Refund/509562969", "order_adjustments": [], "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}]}})); + + await shopify.rest.Refund.find({ + session: session, + order_id: 450789469, + id: 509562969, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds/509562969.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [{"id": null, "shipping_line_id": 369256396, "subtotal_amount_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "shipping_line": {"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "discounted_price": "5.00", "discounted_price_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "phone": null, "price": "5.00", "price_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}}], "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "shipping": {"amount": "0.00", "tax": "0.00", "maximum_refundable": "0.00"}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [], "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"refund": {"duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "shipping": {"amount": "0.00", "tax": "0.00", "maximum_refundable": "0.00"}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_shipping_lines": [], "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/resource_feedback.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/resource_feedback.test.ts new file mode 100644 index 0000000000..c7ff6d47bc --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/resource_feedback.test.ts @@ -0,0 +1,92 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ResourceFeedback resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2025-01-02T11:38:55-05:00", "updated_at": "2025-01-02T11:38:55-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2025-01-02T11:38:54-05:00", "state": "requires_action"}})); + + const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); + resource_feedback.state = "requires_action"; + resource_feedback.messages = [ + "is not connected. Connect your account to use this sales channel." + ]; + resource_feedback.feedback_generated_at = "2025-01-02T16:38:54.865459Z"; + await resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2025-01-02T16:38:54.865459Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2025-01-02T11:38:54-05:00", "updated_at": "2025-01-02T11:38:54-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2025-01-02T11:38:54-05:00", "state": "success"}})); + + const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); + resource_feedback.state = "success"; + resource_feedback.feedback_generated_at = "2025-01-02T16:38:54.358185Z"; + await resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2025-01-02T16:38:54.358185Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2025-01-02T11:38:53-05:00", "updated_at": "2025-01-02T11:38:53-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2025-01-02T10:38:53-05:00", "state": "requires_action"}]})); + + await shopify.rest.ResourceFeedback.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/resource_feedback.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/script_tag.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/script_tag.test.ts new file mode 100644 index 0000000000..852564c3a1 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/script_tag.test.ts @@ -0,0 +1,198 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ScriptTag resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "display_scope": "all", "cache": false}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "display_scope": "all", "cache": false}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/script_tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "display_scope": "all", "cache": false}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + since_id: "421379493", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/script_tags.json', + query: 'since_id=421379493', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "display_scope": "all", "cache": false}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + src: "https://js.example.org/foo.js", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/script_tags.json', + query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tag": {"id": 870402688, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2025-01-02T11:11:00-05:00", "updated_at": "2025-01-02T11:11:00-05:00", "display_scope": "all", "cache": false}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.event = "onload"; + script_tag.src = "https://example.com/my_script.js"; + await script_tag.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/script_tags.json', + query: '', + headers, + data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.ScriptTag.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/script_tags/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "display_scope": "all", "cache": false}})); + + await shopify.rest.ScriptTag.find({ + session: session, + id: 596726825, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/script_tags/596726825.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:11:04-05:00", "display_scope": "all"}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.id = 596726825; + script_tag.src = "https://somewhere-else.com/another.js"; + await script_tag.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/script_tags/596726825.json', + query: '', + headers, + data: { "script_tag": {"src": "https://somewhere-else.com/another.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ScriptTag.delete({ + session: session, + id: 596726825, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/script_tags/596726825.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shipping_zone.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shipping_zone.test.ts new file mode 100644 index 0000000000..b82a8c52ea --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shipping_zone.test.ts @@ -0,0 +1,45 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('ShippingZone resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shipping_zones": [{"id": 44570466, "name": "Downtown Ottawa", "profile_id": "gid://shopify/DeliveryProfile/690933842", "location_group_id": "gid://shopify/DeliveryLocationGroup/694323328", "admin_graphql_api_id": "gid://shopify/DeliveryZone/44570466", "countries": [{"id": 359115488, "name": "Colombia", "tax": 0.15, "code": "CO", "tax_name": "VAT", "shipping_zone_id": 44570466, "provinces": []}, {"id": 879921427, "name": "Canada", "tax": 0.05, "code": "CA", "tax_name": "GST", "shipping_zone_id": 44570466, "provinces": [{"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax": 0.09, "tax_name": "HST", "tax_type": "compounded", "tax_percentage": 9.0, "shipping_zone_id": 44570466}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax": 0.08, "tax_name": null, "tax_type": null, "tax_percentage": 8.0, "shipping_zone_id": 44570466}]}, {"id": 817138619, "name": "United States", "tax": 0.0, "code": "US", "tax_name": "Federal Tax", "shipping_zone_id": 44570466, "provinces": [{"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax": 0.065, "tax_name": null, "tax_type": null, "tax_percentage": 6.5, "shipping_zone_id": 44570466}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax": 0.04, "tax_name": null, "tax_type": null, "tax_percentage": 4.0, "shipping_zone_id": 44570466}]}], "weight_based_shipping_rates": [{"id": 522512552, "name": "Free Under 5kg", "price": "0.00", "shipping_zone_id": 44570466, "weight_low": 0.0, "weight_high": 5.0}], "price_based_shipping_rates": [{"id": 64051, "name": "Free Shipping", "price": "0.00", "shipping_zone_id": 44570466, "min_order_subtotal": null, "max_order_subtotal": "450"}], "carrier_shipping_rate_providers": [{"id": 615128020, "carrier_service_id": 260046840, "flat_modifier": "", "percent_modifier": null, "service_filter": {"*": "+"}, "shipping_zone_id": 44570466}]}]})); + + await shopify.rest.ShippingZone.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shipping_zones.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shop.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shop.test.ts new file mode 100644 index 0000000000..0cc709f10d --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/shop.test.ts @@ -0,0 +1,67 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Shop resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2025-01-02T11:35:33-05:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "finances": true, "primary_location_id": 655441491, "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "marketing_sms_consent_enabled_at_checkout": false, "transactional_sms_disabled": false}})); + + await shopify.rest.Shop.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shop.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"shop": {"province": "California", "country": "US", "address1": "1 Infinite Loop", "city": "Cupertino", "address2": "Suite 100"}})); + + await shopify.rest.Shop.all({ + session: session, + fields: "address1,address2,city,province,country", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/shop.json', + query: 'fields=address1%2Caddress2%2Ccity%2Cprovince%2Ccountry', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/smart_collection.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/smart_collection.test.ts new file mode 100644 index 0000000000..f01e0ab476 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/smart_collection.test.ts @@ -0,0 +1,547 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('SmartCollection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001328, "handle": "ipods-1", "title": "IPods", "updated_at": "2025-01-02T11:37:16-05:00", "body_html": null, "published_at": "2025-01-02T11:37:16-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001328"}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + since_id: "482865238", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: 'since_id=482865238', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001338, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:37:59-05:00", "body_html": null, "published_at": "2025-01-02T11:37:59-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001338"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + ids: "482865238,1063001338", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: 'ids=482865238%2C1063001338', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.SmartCollection.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.SmartCollection.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + await shopify.rest.SmartCollection.find({ + session: session, + id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2025-01-02T11:37:48-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.published = false; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2025-01-02T11:37:18-05:00", "updated_at": "2025-01-02T11:37:18-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.published = true; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2025-01-02T11:37:12-05:00", "id": 482865238, "title": "Smart iPods", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = ""; + smart_collection.updated_at = "2025-01-02T11:37:11-05:00"; + smart_collection.handle = "smart-ipods"; + smart_collection.title = "Smart iPods"; + smart_collection.body_html = "

The best selling ipod ever

"; + smart_collection.published_at = "2008-02-01T19:00:00-05:00"; + smart_collection.sort_order = "manual"; + smart_collection.template_suffix = null; + smart_collection.disjunctive = false; + smart_collection.rules = [ + { + "column": "type", + "relation": "equals", + "condition": "Cult Products" + } + ]; + smart_collection.published_scope = "web"; + smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": "", "updated_at": "2025-01-02T11:37:11-05:00", "handle": "smart-ipods", "title": "Smart iPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2025-01-02T11:37:31-05:00", "id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:37:31-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1735835851"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJ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XvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8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x7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2025-01-02T11:37:23-05:00", "id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2025-01-02T11:37:20-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20250102-63224-ol9r2i.gif?v=1735835843"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "alt": "Rails logo" + }; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2025-01-02T11:37:47-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2025-01-02T11:29:59-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1735835399"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.body_html = "

5000 songs in your pocket

"; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.SmartCollection.delete({ + session: session, + id: 482865238, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/smart_collections/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:37:05-05:00", "body_html": null, "published_at": "2025-01-02T11:37:03-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324", "image": {"created_at": "2025-01-02T11:37:05-05:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1735835825"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", + "alt": "iPod" + }; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001332, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:37:39-05:00", "body_html": null, "published_at": "2025-01-02T11:37:34-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001332", "image": {"created_at": "2025-01-02T11:37:36-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20250102-63224-rhkl47.gif?v=1735835859"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001327, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:37:16-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001327"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.published = false; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001336, "handle": "ipods-1", "title": "IPods", "updated_at": "2025-01-02T11:37:48-05:00", "body_html": null, "published_at": "2025-01-02T11:37:48-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001336"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "IPods"; + smart_collection.rules = [ + { + "column": "title", + "relation": "starts_with", + "condition": "iPod" + } + ]; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001330, "handle": "macbooks", "title": "Macbooks", "updated_at": "2025-01-02T11:37:24-05:00", "body_html": null, "published_at": "2025-01-02T11:37:24-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001330"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + await smart_collection.order({ + products: ["921728736", "632910392"], + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238/order.json', + query: 'products%5B%5D=921728736&products%5B%5D=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + await smart_collection.order({ + sort_order: "alpha-desc", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/smart_collections/482865238/order.json', + query: 'sort_order=alpha-desc', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/storefront_access_token.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/storefront_access_token.test.ts new file mode 100644 index 0000000000..f51c7e2c05 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/storefront_access_token.test.ts @@ -0,0 +1,88 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('StorefrontAccessToken resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "58ce44faa12e743cfcfe77d34d5a39e8", "access_scope": "unauthenticated_read_product_listings", "created_at": "2025-01-02T11:39:14-05:00", "id": 1003304090, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003304090", "title": "Test"}})); + + const storefront_access_token = new shopify.rest.StorefrontAccessToken({session: session}); + storefront_access_token.title = "Test"; + await storefront_access_token.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/storefront_access_tokens.json', + query: '', + headers, + data: { "storefront_access_token": {"title": "Test"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2025-01-02T11:38:15-05:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); + + await shopify.rest.StorefrontAccessToken.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/storefront_access_tokens.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.StorefrontAccessToken.delete({ + session: session, + id: 755357713, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/storefront_access_tokens/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/tender_transaction.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/tender_transaction.test.ts new file mode 100644 index 0000000000..0147407892 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/tender_transaction.test.ts @@ -0,0 +1,155 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('TenderTransaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222837, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222836, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222835, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + since_id: "1011222834", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: 'since_id=1011222834', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222826, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222827, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + order: "processed_at ASC", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: 'order=processed_at+ASC', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222831, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_min: "2005-08-06 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222828, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_max: "2005-08-06 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222832, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_max: "2005-08-05 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/tender_transactions.json', + query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/theme.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/theme.test.ts new file mode 100644 index 0000000000..2550ce25b2 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/theme.test.ts @@ -0,0 +1,156 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Theme resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); + + await shopify.rest.Theme.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/themes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2025-01-02T11:35:01-05:00", "updated_at": "2025-01-02T11:35:01-05:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.name = "Lemongrass"; + theme.src = "http://themes.shopify.com/theme.zip"; + theme.role = "main"; + await theme.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/themes.json', + query: '', + headers, + data: { "theme": {"name": "Lemongrass", "src": "http://themes.shopify.com/theme.zip", "role": "main"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); + + await shopify.rest.Theme.find({ + session: session, + id: 828155753, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/themes/828155753.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:59-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.id = 752253240; + theme.role = "main"; + await theme.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/752253240.json', + query: '', + headers, + data: { "theme": {"role": "main"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:34:58-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.id = 752253240; + theme.name = "Experimental"; + await theme.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/themes/752253240.json', + query: '', + headers, + data: { "theme": {"name": "Experimental"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2025-01-02T11:29:59-05:00", "updated_at": "2025-01-02T11:29:59-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); + + await shopify.rest.Theme.delete({ + session: session, + id: 752253240, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/themes/752253240.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/transaction.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/transaction.test.ts new file mode 100644 index 0000000000..6cef9ae78a --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/transaction.test.ts @@ -0,0 +1,213 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Transaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "#1001.1", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "#1001.2", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); + + await shopify.rest.Transaction.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278506, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:34:39-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2025-01-02T11:34:39-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "338.0", "currency": "USD"}, "shop_money": {"amount": "338.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278506"}]})); + + await shopify.rest.Transaction.all({ + session: session, + order_id: 450789469, + since_id: "801038806", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: 'since_id=801038806', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278510, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:34:43-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2025-01-02T11:34:43-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "588.94", "currency": "USD"}, "shop_money": {"amount": "588.94", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278510"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "capture"; + transaction.parent_id = 389404469; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "capture", "parent_id": 389404469} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278515, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:34:49-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2025-01-02T11:34:49-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "0.0", "currency": "USD"}, "shop_money": {"amount": "0.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278515"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.kind = "capture"; + transaction.authorization = "authorization-key"; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"kind": "capture", "authorization": "authorization-key"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278505, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:34:39-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2025-01-02T11:34:39-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "588.94", "currency": "USD"}, "shop_money": {"amount": "588.94", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278505"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "capture"; + transaction.parent_id = 389404469; + transaction.test = true; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "capture", "parent_id": 389404469, "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278518, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2025-01-02T11:34:51-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2025-01-02T11:34:51-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "total_unsettled_set": {"presentment_money": {"amount": "0.0", "currency": "USD"}, "shop_money": {"amount": "0.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278518"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "void"; + transaction.parent_id = 389404469; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "void", "parent_id": 389404469} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Transaction.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"transaction": {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "buyer_action_info": null, "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null, "payment_method_name": "visa"}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "authorization_expires_at": null, "extended_authorization_attributes": {}, "payment_id": "#1001.1", "total_unsettled_set": {"presentment_money": {"amount": "348.0", "currency": "USD"}, "shop_money": {"amount": "348.0", "currency": "USD"}}, "manual_payment_gateway": false, "amount_rounding": null, "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}})); + + await shopify.rest.Transaction.find({ + session: session, + order_id: 450789469, + id: 389404469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/orders/450789469/transactions/389404469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/usage_charge.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/usage_charge.test.ts new file mode 100644 index 0000000000..b9fd0b8dce --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/usage_charge.test.ts @@ -0,0 +1,92 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('UsageCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618212, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2025-01-02T11:20:36-05:00", "currency": "USD", "balance_used": "11.0", "balance_remaining": "89.00", "risk_level": 0}})); + + const usage_charge = new shopify.rest.UsageCharge({session: session}); + usage_charge.recurring_application_charge_id = 455696195; + usage_charge.description = "Super Mega Plan 1000 emails"; + usage_charge.price = "1.00"; + await usage_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195/usage_charges.json', + query: '', + headers, + data: { "usage_charge": {"description": "Super Mega Plan 1000 emails", "price": "1.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618207, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2025-01-02T11:20:34-05:00", "currency": "USD", "balance_used": "10.0", "balance_remaining": "90.00", "risk_level": 0}]})); + + await shopify.rest.UsageCharge.all({ + session: session, + recurring_application_charge_id: 455696195, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195/usage_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618209, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2025-01-02T11:20:35-05:00", "currency": "USD", "balance_used": "10.0", "balance_remaining": "90.00", "risk_level": 0}})); + + await shopify.rest.UsageCharge.find({ + session: session, + recurring_application_charge_id: 455696195, + id: 1034618209, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/recurring_application_charges/455696195/usage_charges/1034618209.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/user.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/user.test.ts new file mode 100644 index 0000000000..40db16d46b --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/user.test.ts @@ -0,0 +1,88 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('User resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "create_store_credit_account_transactions", "create_and_edit_files", "create_files", "custom_pixels_management", "custom_pixels_view", "customers", "create_and_edit_customers", "delete_customers", "export_customers", "merge_customers", "dashboard", "delete_products", "delete_files", "domains", "draft_orders", "create_and_edit_draft_orders", "apply_discounts_to_draft_orders", "mark_draft_orders_as_paid", "set_payment_terms_for_draft_orders", "delete_draft_orders", "pay_draft_orders_by_vaulted_card", "edit_files", "edit_orders", "edit_private_apps", "edit_product_cost", "edit_product_price", "edit_theme_code", "gift_cards", "create_and_edit_gift_cards", "deactivate_gift_cards", "export_gift_cards", "links", "locations", "manage_delivery_settings", "manage_inventory", "manage_policies", "manage_product_tags", "manage_products", "manage_store_credit_settings", "manage_taxes_settings", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_all_shopify_credit_transactions", "view_balance_bank_accounts", "view_files", "view_private_apps", "view_product_costs", "view_store_credit_account_transactions", "apply_discounts_to_orders", "fulfill_and_ship_orders", "buy_shipping_labels", "return_orders", "manage_abandoned_checkouts", "cancel_orders", "delete_orders", "manage_orders_information", "set_payment_terms_for_orders", "mark_orders_as_paid", "capture_payments_for_orders", "view_companies", "create_and_edit_companies", "delete_companies", "manage_company_location_assignments", "third_party_money_movement", "export_draft_orders", "export_orders", "export_products", "manage_checkout_customer_accounts_editor", "manage_checkout_settings", "view_markets", "create_and_edit_markets", "delete_markets", "manage_customer_identity_providers", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "domains_transfer_out", "enable_private_apps", "experiments_management", "manage_all_shopify_credit_cards", "manage_tap_to_pay", "payment_settings", "upgrade_to_plus_plan", "shopify_payments", "sqlite_bulk_data_transfer", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "third_party_gateways", "collaborator_request_management", "collaborator_request_settings", "view_price_lists", "delete_price_lists", "create_and_edit_price_lists", "view_catalogs", "delete_catalogs", "create_and_edit_catalogs"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/AdminUserSerializer/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/AdminUserSerializer/930143300", "tfa_enabled?": false}]})); + + await shopify.rest.User.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/users.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "create_store_credit_account_transactions", "create_and_edit_files", "create_files", "custom_pixels_management", "custom_pixels_view", "customers", "create_and_edit_customers", "delete_customers", "export_customers", "merge_customers", "dashboard", "delete_products", "delete_files", "domains", "draft_orders", "create_and_edit_draft_orders", "apply_discounts_to_draft_orders", "mark_draft_orders_as_paid", "set_payment_terms_for_draft_orders", "delete_draft_orders", "pay_draft_orders_by_vaulted_card", "edit_files", "edit_orders", "edit_private_apps", "edit_product_cost", "edit_product_price", "edit_theme_code", "gift_cards", "create_and_edit_gift_cards", "deactivate_gift_cards", "export_gift_cards", "links", "locations", "manage_delivery_settings", "manage_inventory", "manage_policies", "manage_product_tags", "manage_products", "manage_store_credit_settings", "manage_taxes_settings", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_all_shopify_credit_transactions", "view_balance_bank_accounts", "view_files", "view_private_apps", "view_product_costs", "view_store_credit_account_transactions", "apply_discounts_to_orders", "fulfill_and_ship_orders", "buy_shipping_labels", "return_orders", "manage_abandoned_checkouts", "cancel_orders", "delete_orders", "manage_orders_information", "set_payment_terms_for_orders", "mark_orders_as_paid", "capture_payments_for_orders", "view_companies", "create_and_edit_companies", "delete_companies", "manage_company_location_assignments", "third_party_money_movement", "export_draft_orders", "export_orders", "export_products", "manage_checkout_customer_accounts_editor", "manage_checkout_settings", "view_markets", "create_and_edit_markets", "delete_markets", "manage_customer_identity_providers", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "domains_transfer_out", "enable_private_apps", "experiments_management", "manage_all_shopify_credit_cards", "manage_tap_to_pay", "payment_settings", "upgrade_to_plus_plan", "shopify_payments", "sqlite_bulk_data_transfer", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "third_party_gateways", "collaborator_request_management", "collaborator_request_settings", "view_price_lists", "delete_price_lists", "create_and_edit_price_lists", "view_catalogs", "delete_catalogs", "create_and_edit_catalogs"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/AdminUserSerializer/548380009", "tfa_enabled?": false}})); + + await shopify.rest.User.find({ + session: session, + id: 548380009, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/users/548380009.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "create_store_credit_account_transactions", "create_and_edit_files", "create_files", "custom_pixels_management", "custom_pixels_view", "customers", "create_and_edit_customers", "delete_customers", "export_customers", "merge_customers", "dashboard", "delete_products", "delete_files", "domains", "draft_orders", "create_and_edit_draft_orders", "apply_discounts_to_draft_orders", "mark_draft_orders_as_paid", "set_payment_terms_for_draft_orders", "delete_draft_orders", "pay_draft_orders_by_vaulted_card", "edit_files", "edit_orders", "edit_private_apps", "edit_product_cost", "edit_product_price", "edit_theme_code", "gift_cards", "create_and_edit_gift_cards", "deactivate_gift_cards", "export_gift_cards", "links", "locations", "manage_delivery_settings", "manage_inventory", "manage_policies", "manage_product_tags", "manage_products", "manage_store_credit_settings", "manage_taxes_settings", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_all_shopify_credit_transactions", "view_balance_bank_accounts", "view_files", "view_private_apps", "view_product_costs", "view_store_credit_account_transactions", "apply_discounts_to_orders", "fulfill_and_ship_orders", "buy_shipping_labels", "return_orders", "manage_abandoned_checkouts", "cancel_orders", "delete_orders", "manage_orders_information", "set_payment_terms_for_orders", "mark_orders_as_paid", "capture_payments_for_orders", "view_companies", "create_and_edit_companies", "delete_companies", "manage_company_location_assignments", "third_party_money_movement", "export_draft_orders", "export_orders", "export_products", "manage_checkout_customer_accounts_editor", "manage_checkout_settings", "view_markets", "create_and_edit_markets", "delete_markets", "manage_customer_identity_providers", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "domains_transfer_out", "enable_private_apps", "experiments_management", "manage_all_shopify_credit_cards", "manage_tap_to_pay", "payment_settings", "upgrade_to_plus_plan", "shopify_payments", "sqlite_bulk_data_transfer", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "third_party_gateways", "collaborator_request_management", "collaborator_request_settings", "view_price_lists", "delete_price_lists", "create_and_edit_price_lists", "view_catalogs", "delete_catalogs", "create_and_edit_catalogs"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/AdminUserSerializer/548380009", "tfa_enabled?": false}})); + + await shopify.rest.User.current({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/users/current.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/variant.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/variant.test.ts new file mode 100644 index 0000000000..7d579fa3be --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/variant.test.ts @@ -0,0 +1,309 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Variant resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + since_id: "49148385", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: 'since_id=49148385', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "option1": "Green", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_green", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008GREEN", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856", "image_id": null}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "option1": "Red", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_red", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008RED", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385", "image_id": null}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "option1": "Black", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_black", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008BLACK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702", "image_id": null}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + presentment_currencies: "USD,CAD", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: 'presentment_currencies=USD%2CCAD', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 1070325042, "product_id": 632910392, "title": "Yellow", "price": "1.00", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "option1": "Yellow", "option2": null, "option3": null, "created_at": "2025-01-02T11:39:09-05:00", "updated_at": "2025-01-02T11:39:10-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": "shopify", "requires_shipping": true, "sku": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325042, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325042", "image_id": null}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Yellow"; + variant.price = "1.00"; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"option1": "Yellow", "price": "1.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 1070325039, "product_id": 632910392, "title": "Blue", "price": "0.00", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "option1": "Blue", "option2": null, "option3": null, "created_at": "2025-01-02T11:39:01-05:00", "updated_at": "2025-01-02T11:39:01-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": "shopify", "requires_shipping": true, "sku": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325039, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325039", "image_id": null}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Blue"; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 1070325040, "product_id": 632910392, "title": "Purple", "price": "0.00", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "option1": "Purple", "option2": null, "option3": null, "created_at": "2025-01-02T11:39:02-05:00", "updated_at": "2025-01-02T11:39:02-05:00", "taxable": true, "barcode": null, "fulfillment_service": "manual", "grams": 0, "inventory_management": "shopify", "requires_shipping": true, "sku": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325040, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325040", "image_id": 850703190}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.image_id = 850703190; + variant.option1 = "Purple"; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"image_id": 850703190, "option1": "Purple"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Variant.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/products/632910392/variants/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}})); + + await shopify.rest.Variant.find({ + session: session, + id: 808950810, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/variants/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:38:15-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:39:08-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.image_id = 562641783; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"image_id": 562641783} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2025-01-02T11:38:15-05:00", "updated_at": "2025-01-02T11:39:07-05:00", "taxable": true, "barcode": "1234_pink", "fulfillment_service": "manual", "grams": 567, "inventory_management": "shopify", "requires_shipping": true, "sku": "IPOD2008PINK", "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810", "image_id": 562641783}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.option1 = "Not Pink"; + variant.price = "99.00"; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"option1": "Not Pink", "price": "99.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Variant.delete({ + session: session, + product_id: 632910392, + id: 808950810, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/products/632910392/variants/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-api/rest/admin/__tests__/2025-01/webhook.test.ts b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/webhook.test.ts new file mode 100644 index 0000000000..12cf403971 --- /dev/null +++ b/packages/apps/shopify-api/rest/admin/__tests__/2025-01/webhook.test.ts @@ -0,0 +1,249 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {testConfig} from '../../../../lib/__tests__/test-config'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi} from '../../../../lib'; + +import {restResources} from '../../2025-01'; + +describe('Webhook resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhooks": [{"id": 4759306, "address": "https://apple.com", "topic": "orders/create", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 892403750, "address": "https://example.org/fully_loaded_1", "topic": "orders/cancelled", "created_at": "2021-12-01T05:23:43-05:00", "updated_at": "2021-12-01T05:23:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 901431826, "address": "https://apple.com/uninstall", "topic": "app/uninstalled", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 1014196360, "address": "https://example.org/app_uninstalled", "topic": "app/uninstalled", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}]})); + + await shopify.rest.Webhook.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/webhooks.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhooks": [{"id": 1014196360, "address": "https://example.org/app_uninstalled", "topic": "app/uninstalled", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}]})); + + await shopify.rest.Webhook.all({ + session: session, + since_id: "901431826", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/webhooks.json', + query: 'since_id=901431826', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhook": {"id": 8589935176, "address": "pubsub://projectName:topicName", "topic": "customers/update", "created_at": "2025-01-02T11:19:46-05:00", "updated_at": "2025-01-02T11:19:46-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.address = "pubsub://projectName:topicName"; + webhook.topic = "customers/update"; + webhook.format = "json"; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"address": "pubsub://projectName:topicName", "topic": "customers/update", "format": "json"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhook": {"id": 8589935044, "address": "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source", "topic": "customers/update", "created_at": "2025-01-02T11:18:01-05:00", "updated_at": "2025-01-02T11:18:01-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.address = "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source"; + webhook.topic = "customers/update"; + webhook.format = "json"; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"address": "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source", "topic": "customers/update", "format": "json"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhook": {"id": 8589935145, "address": "https://example.hostname.com/", "topic": "orders/create", "created_at": "2025-01-02T11:19:24-05:00", "updated_at": "2025-01-02T11:19:24-05:00", "format": "json", "fields": ["id", "note"], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.topic = "orders/create"; + webhook.address = "https://example.hostname.com/"; + webhook.format = "json"; + webhook.fields = [ + "id", + "note" + ]; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2025-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"topic": "orders/create", "address": "https://example.hostname.com/", "format": "json", "fields": ["id", "note"]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Webhook.count({ + session: session, + topic: "orders/create", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/webhooks/count.json', + query: 'topic=orders%2Fcreate', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Webhook.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/webhooks/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhook": {"id": 4759306, "address": "https://apple.com", "topic": "orders/create", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:09:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + await shopify.rest.Webhook.find({ + session: session, + id: 4759306, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2025-01/webhooks/4759306.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({"webhook": {"address": "https://somewhere-else.com/", "id": 4759306, "topic": "orders/create", "created_at": "2025-01-02T11:09:43-05:00", "updated_at": "2025-01-02T11:18:33-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.id = 4759306; + webhook.address = "https://somewhere-else.com/"; + await webhook.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2025-01/webhooks/4759306.json', + query: '', + headers, + data: { "webhook": {"address": "https://somewhere-else.com/"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + const shopify = shopifyApi( + testConfig({apiVersion: ApiVersion.January25, restResources}), + ); + + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Webhook.delete({ + session: session, + id: 4759306, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2025-01/webhooks/4759306.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/packages/apps/shopify-app-express/CHANGELOG.md b/packages/apps/shopify-app-express/CHANGELOG.md index 0f968c4e87..600978eae6 100644 --- a/packages/apps/shopify-app-express/CHANGELOG.md +++ b/packages/apps/shopify-app-express/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 5.0.10 + +### Patch Changes + +- 6b71f39: Updated `express` dependencies +- Updated dependencies [6b71f39] +- Updated dependencies [6681802] +- Updated dependencies [dc6b8ad] + - @shopify/shopify-api@11.7.0 + - @shopify/shopify-app-session-storage@3.0.10 + - @shopify/shopify-app-session-storage-memory@4.0.10 + ## 5.0.9 ### Patch Changes diff --git a/packages/apps/shopify-app-express/package.json b/packages/apps/shopify-app-express/package.json index f30ff486f9..8a51f3d759 100644 --- a/packages/apps/shopify-app-express/package.json +++ b/packages/apps/shopify-app-express/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-express", - "version": "5.0.9", + "version": "5.0.10", "description": "Shopify Express Middleware - to simplify the building of Shopify Apps with Express", "repository": { "type": "git", @@ -42,9 +42,9 @@ "Storefront API" ], "dependencies": { - "@shopify/shopify-api": "^11.6.1", - "@shopify/shopify-app-session-storage": "^3.0.9", - "@shopify/shopify-app-session-storage-memory": "^4.0.9", + "@shopify/shopify-api": "^11.7.0", + "@shopify/shopify-app-session-storage": "^3.0.10", + "@shopify/shopify-app-session-storage-memory": "^4.0.10", "cookie-parser": "^1.4.7", "express": "^4.21.2", "semver": "^7.6.2" diff --git a/packages/apps/shopify-app-express/src/middlewares/ensure-installed-on-shop.ts b/packages/apps/shopify-app-express/src/middlewares/ensure-installed-on-shop.ts index a1363c056b..f8d2593217 100644 --- a/packages/apps/shopify-app-express/src/middlewares/ensure-installed-on-shop.ts +++ b/packages/apps/shopify-app-express/src/middlewares/ensure-installed-on-shop.ts @@ -19,7 +19,7 @@ export function ensureInstalled({ }: EnsureInstalledParams): EnsureInstalledMiddleware { return function ensureInstalledOnShop() { return async (req: Request, res: Response, next: NextFunction) => { - config.logger.info('Running ensureInstalledOnShop'); + config.logger.debug('Running ensureInstalledOnShop'); if (!api.config.isEmbeddedApp) { config.logger.warning( @@ -65,7 +65,7 @@ export function ensureInstalled({ addCSPHeader(api, req, res); - config.logger.info('App is installed and ready to load', {shop}); + config.logger.debug('App is installed and ready to load', {shop}); return next(); }; diff --git a/packages/apps/shopify-app-express/src/version.ts b/packages/apps/shopify-app-express/src/version.ts index 1bbdc03fa2..6a06d6490e 100644 --- a/packages/apps/shopify-app-express/src/version.ts +++ b/packages/apps/shopify-app-express/src/version.ts @@ -1 +1 @@ -export const SHOPIFY_EXPRESS_LIBRARY_VERSION = '5.0.9'; +export const SHOPIFY_EXPRESS_LIBRARY_VERSION = '5.0.10'; diff --git a/packages/apps/shopify-app-remix/CHANGELOG.md b/packages/apps/shopify-app-remix/CHANGELOG.md index 3e403f1e37..dc428e4bb7 100644 --- a/packages/apps/shopify-app-remix/CHANGELOG.md +++ b/packages/apps/shopify-app-remix/CHANGELOG.md @@ -1,5 +1,20 @@ # @shopify/shopify-app-remix +## 3.6.0 + +### Minor Changes + +- 34fc75d: Add Shop context to logging + +### Patch Changes + +- 6681802: Updated `isbot` dependencies +- Updated dependencies [6b71f39] +- Updated dependencies [6681802] +- Updated dependencies [dc6b8ad] + - @shopify/shopify-api@11.7.0 + - @shopify/shopify-app-session-storage@3.0.10 + ## 3.5.1 ### Patch Changes diff --git a/packages/apps/shopify-app-remix/package.json b/packages/apps/shopify-app-remix/package.json index 59036c4c1e..98477aa55e 100644 --- a/packages/apps/shopify-app-remix/package.json +++ b/packages/apps/shopify-app-remix/package.json @@ -1,6 +1,6 @@ { "name": "@shopify/shopify-app-remix", - "version": "3.5.1", + "version": "3.6.0", "description": "Shopify Remix - to simplify the building of Shopify Apps with Remix", "repository": { "type": "git", @@ -77,26 +77,26 @@ "Storefront API" ], "devDependencies": { - "@remix-run/node": "^2.15.1", - "@remix-run/react": "^2.11.2", - "@remix-run/testing": "^2.11.2", + "@remix-run/node": "^2.15.2", + "@remix-run/react": "^2.15.2", + "@remix-run/testing": "^2.15.2", "@shopify/generate-docs": "^0.16.4", "@shopify/polaris": "^12.18.0", "@shopify/react-testing": "^5.4.0", - "@shopify/shopify-app-session-storage-memory": "^4.0.9", + "@shopify/shopify-app-session-storage-memory": "^4.0.10", "@types/jsonwebtoken": "^9.0.7", - "@types/react": "^18.3.12", + "@types/react": "^19.0.7", "@types/semver": "^7.5.8", "jest-fetch-mock": "^3.0.3", "jsonwebtoken": "^9.0.2" }, "dependencies": { - "@remix-run/server-runtime": "^2.12.1", + "@remix-run/server-runtime": "^2.15.2", "@shopify/admin-api-client": "^1.0.4", - "@shopify/shopify-api": "^11.6.1", - "@shopify/shopify-app-session-storage": "^3.0.9", + "@shopify/shopify-api": "^11.7.0", + "@shopify/shopify-app-session-storage": "^3.0.10", "@shopify/storefront-api-client": "^1.0.3", - "isbot": "^5.1.18", + "isbot": "^5.1.21", "semver": "^7.6.2" }, "peerDependencies": { diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/authenticate.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/authenticate.ts index 20737415a6..11b05a810c 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/authenticate.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/authenticate.ts @@ -9,6 +9,7 @@ import { respondToBotRequest, respondToOptionsRequest, validateSessionToken, + getShopFromRequest, } from '../helpers'; import { @@ -60,7 +61,9 @@ export function authStrategyFactory< const url = new URL(request.url); if (url.pathname === config.auth.patchSessionTokenPath) { - logger.debug('Rendering bounce page'); + logger.debug('Rendering bounce page', { + shop: getShopFromRequest(request), + }); throw renderAppBridge({config, logger, api}, request); } } @@ -71,7 +74,10 @@ export function authStrategyFactory< if (url.pathname === config.auth.exitIframePath) { const destination = url.searchParams.get('exitIframe')!; - logger.debug('Rendering exit iframe page', {destination}); + logger.debug('Rendering exit iframe page', { + shop: getShopFromRequest(request), + destination, + }); throw renderAppBridge({config, logger, api}, request, {url: destination}); } } @@ -154,12 +160,14 @@ export function authStrategyFactory< await ensureSessionTokenSearchParamIfRequired(params, request); } - logger.info('Authenticating admin request'); + logger.info('Authenticating admin request', { + shop: getShopFromRequest(request), + }); const {payload, shop, sessionId, sessionToken} = await getSessionTokenContext(params, request); - logger.debug('Loading session from storage', {sessionId}); + logger.debug('Loading session from storage', {shop, sessionId}); const existingSession = sessionId ? await config.sessionStorage!.loadSession(sessionId) : undefined; @@ -173,7 +181,9 @@ export function authStrategyFactory< return createContext(request, session, strategy, payload); } catch (errorOrResponse) { if (errorOrResponse instanceof Response) { - logger.debug('Authenticate returned a response'); + logger.debug('Authenticate returned a response', { + shop: getShopFromRequest(request), + }); ensureCORSHeadersFactory(params, request)(errorOrResponse); } @@ -193,6 +203,7 @@ async function getSessionTokenContext( const sessionToken = (headerSessionToken || searchParamSessionToken)!; logger.debug('Attempting to authenticate session token', { + shop: getShopFromRequest(request), sessionToken: JSON.stringify({ header: headerSessionToken, search: searchParamSessionToken, @@ -204,7 +215,7 @@ async function getSessionTokenContext( const dest = new URL(payload.dest); const shop = dest.hostname; - logger.debug('Session token is valid', {shop, payload}); + logger.debug('Session token is valid - authenticated', {shop, payload}); const sessionId = config.useOnlineTokens ? api.session.getJwtSessionId(shop, payload.sub) : api.session.getOfflineId(shop); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/billing/helpers.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/billing/helpers.ts index ca137c530a..3b234aef7e 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/billing/helpers.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/billing/helpers.ts @@ -11,7 +11,7 @@ export function redirectOutOfApp( ): never { const {config, logger} = params; - logger.debug('Redirecting out of app', {url}); + logger.debug('Redirecting out of app', {shop, url}); const requestUrl = new URL(request.url); const isEmbeddedRequest = requestUrl.searchParams.get('embedded') === '1'; diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/handle-client-error.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/handle-client-error.ts index fda47f8092..c9d22f1721 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/handle-client-error.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/handle-client-error.ts @@ -15,6 +15,7 @@ export function handleClientErrorFactory({ if (error instanceof HttpResponseError !== true) { params.logger.debug( `Got a response error from the API: ${error.message}`, + {shop: session.shop}, ); throw error; } @@ -22,6 +23,7 @@ export function handleClientErrorFactory({ params.logger.debug( `Got an HTTP response error from the API: ${error.message}`, { + shop: session.shop, code: error.response.code, statusText: error.response.statusText, body: JSON.stringify(error.response.body), diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/redirect.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/redirect.ts index a8b5ca9a1a..8cdb1964cc 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/redirect.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/redirect.ts @@ -46,7 +46,7 @@ export function redirectFactory( init, }); - logger.debug('Redirecting', {url: parsedUrl.toString()}); + logger.debug('Redirecting', {shop, url: parsedUrl.toString()}); const isSameOrigin = parsedUrl.origin === config.appUrl; if (isSameOrigin || url.startsWith('/')) { diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/trigger-after-auth-hook.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/trigger-after-auth-hook.ts index 95f0b62a73..f8ff7c701c 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/trigger-after-auth-hook.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/trigger-after-auth-hook.ts @@ -18,7 +18,7 @@ export async function triggerAfterAuthHook< ) { const {config, logger} = params; if (config.hooks.afterAuth) { - logger.info('Running afterAuth hook'); + logger.info('Running afterAuth hook', {shop: session.shop}); const admin = createAdminApiContext( session, diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/validate-shop-and-host-params.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/validate-shop-and-host-params.ts index 2772d8f190..31f41e38c2 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/validate-shop-and-host-params.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/helpers/validate-shop-and-host-params.ts @@ -21,6 +21,7 @@ export function validateShopAndHostParams( const host = api.utils.sanitizeHost(url.searchParams.get('host')!); if (!host) { logger.debug('Invalid host, redirecting to login path', { + shop, host: url.searchParams.get('host'), }); throw redirectToLoginPath(request, params); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/auth-code-flow.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/auth-code-flow.ts index fb5bf9f6ae..55d9ff7746 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/auth-code-flow.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/auth-code-flow.ts @@ -190,7 +190,7 @@ export class AuthCodeFlowStrategy< ): Promise { const {api, config, logger} = this; - logger.info('Handling OAuth callback request'); + logger.info('Handling OAuth callback request', {shop}); try { const {session, headers: responseHeaders} = await api.auth.callback({ @@ -200,7 +200,9 @@ export class AuthCodeFlowStrategy< await config.sessionStorage!.storeSession(session); if (config.useOnlineTokens && !session.isOnline) { - logger.info('Requesting online access token for offline session'); + logger.info('Requesting online access token for offline session', { + shop, + }); await beginAuth({api, config, logger}, request, true, shop); } @@ -273,7 +275,7 @@ export class AuthCodeFlowStrategy< shop: string, ) { const {logger} = this; - logger.error('Error during OAuth callback', {error: error.message}); + logger.error('Error during OAuth callback', {shop, error: error.message}); if (error instanceof CookieNotFound) { return this.handleAuthBeginRequest(request, shop); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/merchant-custom-app.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/merchant-custom-app.ts index 9d0785ccab..d229759c00 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/merchant-custom-app.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/merchant-custom-app.ts @@ -10,6 +10,7 @@ import {BasicParams} from '../../../types'; import {ApiConfigWithFutureFlags, ApiFutureFlags} from '../../../future/flags'; import {HandleAdminClientError} from '../../../clients'; import {handleClientErrorFactory} from '../helpers'; +import {getShopFromRequest} from '../../helpers'; import {AuthorizationStrategy, OnErrorOptions, SessionContext} from './types'; @@ -31,8 +32,10 @@ export class MerchantCustomAuth this.logger = logger; } - public async respondToOAuthRequests(_request: Request): Promise { - this.logger.debug('Skipping OAuth request for merchant custom app'); + public async respondToOAuthRequests(request: Request): Promise { + this.logger.debug('Skipping OAuth request for merchant custom app', { + shop: getShopFromRequest(request), + }); } public async authenticate( @@ -43,6 +46,7 @@ export class MerchantCustomAuth this.logger.debug( 'Building session from configured access token for merchant custom app', + {shop}, ); const session = this.api.session.customAppSession(shop); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts index 551eb96219..ab190e4a4b 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/admin/strategies/token-exchange.ts @@ -12,6 +12,7 @@ import {BasicParams} from '../../../types'; import { respondToInvalidSessionToken, invalidateAccessToken, + getShopFromRequest, } from '../../helpers'; import {handleClientErrorFactory, triggerAfterAuthHook} from '../helpers'; import {HandleAdminClientError} from '../../../clients'; @@ -52,8 +53,8 @@ export class TokenExchangeStrategy if (!sessionToken) throw new InvalidJwtError(); if (!session || !session.isActive(undefined)) { - logger.info('No valid session found'); - logger.info('Requesting offline access token'); + logger.info('No valid session found', {shop}); + logger.info('Requesting offline access token', {shop}); const {session: offlineSession} = await this.exchangeToken({ request, sessionToken, @@ -66,7 +67,7 @@ export class TokenExchangeStrategy let newSession = offlineSession; if (config.useOnlineTokens) { - logger.info('Requesting online access token'); + logger.info('Requesting online access token', {shop}); const {session: onlineSession} = await this.exchangeToken({ request, sessionToken, @@ -113,7 +114,9 @@ export class TokenExchangeStrategy request, onError: async ({session, error}: OnErrorOptions) => { if (error.response.code === 401) { - logger.debug('Responding to invalid access token'); + logger.debug('Responding to invalid access token', { + shop: getShopFromRequest(request), + }); await invalidateAccessToken({config, api, logger}, session); respondToInvalidSessionToken({ diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/__tests__/get-shop-from-request.test.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/__tests__/get-shop-from-request.test.ts new file mode 100644 index 0000000000..ffe1208977 --- /dev/null +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/__tests__/get-shop-from-request.test.ts @@ -0,0 +1,15 @@ +import {APP_URL, TEST_SHOP} from '../../../__test-helpers'; +import {getShopFromRequest} from '../get-shop-from-request'; + +describe('getShopFromRequest', () => { + it('returns sanitized shop domain from request URL params', () => { + // GIVEN + const request = new Request(`${APP_URL}?shop=${TEST_SHOP}`); + + // WHEN + const result = getShopFromRequest(request); + + // THEN + expect(result).toBe(TEST_SHOP); + }); +}); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/create-or-load-offline-session.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/create-or-load-offline-session.ts index 0c52613b30..8ba2d399dd 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/create-or-load-offline-session.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/create-or-load-offline-session.ts @@ -5,10 +5,12 @@ export async function createOrLoadOfflineSession( {api, config, logger}: BasicParams, ) { if (config.distribution === AppDistribution.ShopifyAdmin) { - logger.debug('Creating custom app session from configured access token'); + logger.debug('Creating custom app session from configured access token', { + shop, + }); return api.session.customAppSession(shop); } else { - logger.debug('Loading offline session from session storage'); + logger.debug('Loading offline session from session storage', {shop}); const offlineSessionId = api.session.getOfflineId(shop); const session = await config.sessionStorage!.loadSession(offlineSessionId); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/get-shop-from-request.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/get-shop-from-request.ts new file mode 100644 index 0000000000..3da97cf12a --- /dev/null +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/get-shop-from-request.ts @@ -0,0 +1,4 @@ +export function getShopFromRequest(request: Request) { + const url = new URL(request.url); + return url.searchParams.get('shop')!; +} diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/index.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/index.ts index a84fcafb29..a7b3677e45 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/index.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/index.ts @@ -8,3 +8,4 @@ export * from './reject-bot-request'; export * from './respond-to-options-request'; export * from './respond-to-invalid-session-token'; export * from './create-or-load-offline-session'; +export * from './get-shop-from-request'; diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/invalidate-access-token.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/invalidate-access-token.ts index d6d2b82d41..82ae17b3e4 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/invalidate-access-token.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/invalidate-access-token.ts @@ -8,7 +8,9 @@ export async function invalidateAccessToken( ): Promise { const {logger, config} = params; - logger.debug(`Invalidating access token for session - ${session.id}`); + logger.debug(`Invalidating access token for session - ${session.id}`, { + shop: session.shop, + }); session.accessToken = undefined; await config.sessionStorage!.storeSession(session); diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/validate-session-token.ts b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/validate-session-token.ts index 3c8e90551e..3511d0ed15 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/helpers/validate-session-token.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/helpers/validate-session-token.ts @@ -3,6 +3,7 @@ import {JwtPayload} from '@shopify/shopify-api'; import type {BasicParams} from '../../types'; import {respondToInvalidSessionToken} from './respond-to-invalid-session-token'; +import {getShopFromRequest} from './get-shop-from-request'; interface ValidateSessionTokenOptions { checkAudience?: boolean; @@ -15,19 +16,23 @@ export async function validateSessionToken( {checkAudience = true}: ValidateSessionTokenOptions = {}, ): Promise { const {api, logger} = params; - logger.debug('Validating session token'); + const shop = getShopFromRequest(request); + logger.debug('Validating session token', {shop}); try { const payload = await api.session.decodeSessionToken(token, { checkAudience, }); - logger.debug('Session token is valid', { + logger.debug('Session token is valid - validated', { + shop, payload: JSON.stringify(payload), }); return payload; } catch (error) { - logger.debug(`Failed to validate session token: ${error.message}`); + logger.debug(`Failed to validate session token: ${error.message}`, { + shop, + }); throw respondToInvalidSessionToken({params, request, retryRequest: true}); } diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/public/appProxy/authenticate.ts b/packages/apps/shopify-app-remix/src/server/authenticate/public/appProxy/authenticate.ts index 6c24435e4e..e1c992f36f 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/public/appProxy/authenticate.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/public/appProxy/authenticate.ts @@ -22,19 +22,18 @@ export function authenticateAppProxyFactory< ): Promise< AppProxyContext | AppProxyContextWithSession > { - logger.info('Authenticating app proxy request'); - const url = new URL(request.url); + const shop = url.searchParams.get('shop')!; + logger.info('Authenticating app proxy request', {shop}); if (!(await validateAppProxyHmac(params, url))) { - logger.info('App proxy request has invalid signature'); + logger.info('App proxy request has invalid signature', {shop}); throw new Response(undefined, { status: 400, statusText: 'Bad Request', }); } - const shop = url.searchParams.get('shop')!; const sessionId = api.session.getOfflineId(shop); const session = await config.sessionStorage!.loadSession(sessionId); @@ -137,7 +136,8 @@ async function validateAppProxyHmac( return isValid; } catch (error) { - logger.info(error.message); + const shop = url.searchParams.get('shop')!; + logger.info(error.message, {shop}); throw new Response(undefined, {status: 400, statusText: 'Bad Request'}); } } diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/public/checkout/__tests__/authenticate.test.ts b/packages/apps/shopify-app-remix/src/server/authenticate/public/checkout/__tests__/authenticate.test.ts index 267b34a7c5..00236b035b 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/public/checkout/__tests__/authenticate.test.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/public/checkout/__tests__/authenticate.test.ts @@ -10,7 +10,8 @@ describe('JWT validation', () => { it('returns token when successful', async () => { // GIVEN const shopify = shopifyApp(testConfig()); - const {token, payload} = getJwt(); + // Checkout UI session tokens don't include the protocol + const {token, payload} = getJwt({dest: 'test-shop.myshopify.com'}); // WHEN const {sessionToken} = await shopify.authenticate.public.checkout( @@ -28,7 +29,7 @@ describe('JWT validation', () => { it('sets extra CORS allowed headers when requested from a different origin', async () => { // GIVEN const shopify = shopifyApp(testConfig()); - const {token} = getJwt(); + const {token} = getJwt({dest: 'test-shop.myshopify.com'}); // WHEN const {cors} = await shopify.authenticate.public.checkout( @@ -51,7 +52,7 @@ describe('JWT validation', () => { it('responds to preflight requests', async () => { // GIVEN const shopify = shopifyApp(testConfig()); - const {token} = getJwt(); + const {token} = getJwt({dest: 'test-shop.myshopify.com'}); // WHEN const response = await getThrownResponse( @@ -69,7 +70,7 @@ describe('JWT validation', () => { it('responds to preflight requests from a different origin with extra CORS allowed headers', async () => { // GIVEN const shopify = shopifyApp(testConfig()); - const {token} = getJwt(); + const {token} = getJwt({dest: 'test-shop.myshopify.com'}); const request = new Request(APP_URL, { method: 'OPTIONS', headers: { diff --git a/packages/apps/shopify-app-remix/src/server/authenticate/public/extension/authenticate.ts b/packages/apps/shopify-app-remix/src/server/authenticate/public/extension/authenticate.ts index 8d7d174b1a..ac90bb9269 100644 --- a/packages/apps/shopify-app-remix/src/server/authenticate/public/extension/authenticate.ts +++ b/packages/apps/shopify-app-remix/src/server/authenticate/public/extension/authenticate.ts @@ -5,6 +5,7 @@ import { getSessionTokenHeader, validateSessionToken, ensureCORSHeadersFactory, + getShopFromRequest, } from '../../helpers'; import {AuthenticateExtension, ExtensionContext} from './types'; @@ -26,10 +27,14 @@ export function authenticateExtensionFactory( const sessionTokenHeader = getSessionTokenHeader(request); - logger.info(`Authenticating ${requestType} request`); + logger.info(`Authenticating ${requestType} request`, { + shop: getShopFromRequest(request), + }); if (!sessionTokenHeader) { - logger.debug('Request did not contain a session token'); + logger.debug('Request did not contain a session token', { + shop: getShopFromRequest(request), + }); throw new Response(undefined, { status: 401, statusText: 'Unauthorized', diff --git a/packages/apps/shopify-app-remix/src/server/version.ts b/packages/apps/shopify-app-remix/src/server/version.ts index 4ebac1be75..34de280510 100644 --- a/packages/apps/shopify-app-remix/src/server/version.ts +++ b/packages/apps/shopify-app-remix/src/server/version.ts @@ -1 +1 @@ -export const SHOPIFY_REMIX_LIBRARY_VERSION = '3.5.1'; +export const SHOPIFY_REMIX_LIBRARY_VERSION = '3.6.0'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ea52aefda..0e99cda4ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,38 +24,38 @@ importers: specifier: ^2.27.11 version: 2.27.11 '@cloudflare/workers-types': - specifier: ^4.20241218.0 - version: 4.20241218.0 + specifier: ^4.20250109.0 + version: 4.20250109.0 '@jest/types': specifier: ^29.6.3 version: 29.6.3 '@rollup/plugin-babel': specifier: ^6.0.3 - version: 6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.28.1) + version: 6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.31.0) '@rollup/plugin-commonjs': specifier: ^28.0.2 - version: 28.0.2(rollup@4.28.1) + version: 28.0.2(rollup@4.31.0) '@rollup/plugin-eslint': specifier: ^9.0.3 - version: 9.0.5(rollup@4.28.1) + version: 9.0.5(rollup@4.31.0) '@rollup/plugin-node-resolve': specifier: ^16.0.0 - version: 16.0.0(rollup@4.28.1) + version: 16.0.0(rollup@4.31.0) '@rollup/plugin-replace': specifier: ^6.0.2 - version: 6.0.2(rollup@4.28.1) + version: 6.0.2(rollup@4.31.0) '@rollup/plugin-terser': specifier: ^0.4.0 - version: 0.4.4(rollup@4.28.1) + version: 0.4.4(rollup@4.31.0) '@rollup/plugin-typescript': specifier: ^12.1.2 - version: 12.1.2(rollup@4.28.1)(tslib@2.8.1)(typescript@5.7.2) + version: 12.1.2(rollup@4.31.0)(tslib@2.8.1)(typescript@5.7.3) '@shopify/babel-preset': specifier: ^25.0.0 version: 25.0.0 '@shopify/eslint-plugin': specifier: ^45.0.0 - version: 45.0.0(@babel/core@7.25.2)(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(prettier@3.4.2)(typescript@5.7.2) + version: 45.0.0(@babel/core@7.25.2)(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(prettier@3.4.2)(typescript@5.7.3) '@shopify/prettier-config': specifier: ^1.1.2 version: 1.1.2 @@ -66,8 +66,8 @@ importers: specifier: ^29.5.14 version: 29.5.14 '@types/node': - specifier: ^22.10.2 - version: 22.10.2 + specifier: ^22.10.7 + version: 22.10.7 '@types/supertest': specifier: ^6.0.2 version: 6.0.2 @@ -75,14 +75,14 @@ importers: specifier: ^8.57.1 version: 8.57.1 eslint-plugin-jest: - specifier: ^28.9.0 - version: 28.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(typescript@5.7.2) + specifier: ^28.11.0 + version: 28.11.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) eslint-plugin-prettier: - specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) + specifier: ^5.2.3 + version: 5.2.3(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + version: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -91,7 +91,7 @@ importers: version: 3.0.3(encoding@0.1.13) jest-runner-eslint: specifier: ^2.2.1 - version: 2.2.1(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2))) + version: 2.2.1(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3))) prettier: specifier: ^3.4.1 version: 3.4.2 @@ -99,23 +99,23 @@ importers: specifier: ^5.0.7 version: 5.0.10 rollup: - specifier: ^4.28.1 - version: 4.28.1 + specifier: ^4.31.0 + version: 4.31.0 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.28.1)(typescript@5.7.2) + version: 6.1.1(rollup@4.31.0)(typescript@5.7.3) rollup-plugin-exclude-dependencies-from-bundle: specifier: ^1.1.23 - version: 1.1.23(rollup@4.28.1) + version: 1.1.23(rollup@4.31.0) supertest: specifier: ^7.0.0 version: 7.0.0 ts-jest: specifier: ^29.1.3 - version: 29.2.4(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(typescript@5.7.2) + version: 29.2.4(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2) + version: 10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3) tslib: specifier: ^2.8.1 version: 2.8.1 @@ -123,8 +123,8 @@ importers: specifier: ^2.3.3 version: 2.3.3 typescript: - specifier: 5.7.2 - version: 5.7.2 + specifier: 5.7.3 + version: 5.7.3 packages/api-clients/admin-api-client: dependencies: @@ -143,7 +143,7 @@ importers: dependencies: '@graphql-codegen/cli': specifier: ^5.0.3 - version: 5.0.3(@parcel/watcher@2.5.0)(@types/node@22.10.2)(encoding@0.1.13)(enquirer@2.4.1)(graphql@16.10.0)(typescript@5.7.2) + version: 5.0.3(@parcel/watcher@2.5.0)(@types/node@22.10.7)(encoding@0.1.13)(enquirer@2.4.1)(graphql@16.10.0)(typescript@5.7.3) '@graphql-codegen/introspection': specifier: ^4.0.3 version: 4.0.3(encoding@0.1.13)(graphql@16.10.0) @@ -165,7 +165,7 @@ importers: version: 5.1.0(graphql@16.10.0) graphql-config: specifier: 5.1.3 - version: 5.1.3(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.2) + version: 5.1.3(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.3) regenerator-runtime: specifier: ^0.14.1 version: 0.14.1 @@ -182,8 +182,8 @@ importers: specifier: ^0.14.1 version: 0.14.1 web-streams-polyfill: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^4.1.0 + version: 4.1.0 packages/api-clients/storefront-api-client: dependencies: @@ -198,7 +198,7 @@ importers: packages/apps/session-storage/shopify-app-session-storage: devDependencies: '@shopify/shopify-api': - specifier: ^11.6.1 + specifier: ^11.7.0 version: link:../../shopify-api packages/apps/session-storage/shopify-app-session-storage-drizzle: @@ -217,7 +217,7 @@ importers: specifier: ^0.14.0 version: 0.14.0(encoding@0.1.13) '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils '@types/better-sqlite3': specifier: ^7.6.12 @@ -226,17 +226,17 @@ importers: specifier: ^8.11.6 version: 8.11.6 better-sqlite3: - specifier: ^11.7.0 - version: 11.7.0 + specifier: ^11.8.1 + version: 11.8.1 drizzle-kit: - specifier: ^0.30.1 - version: 0.30.1 + specifier: ^0.30.2 + version: 0.30.2 drizzle-orm: - specifier: ^0.38.2 - version: 0.38.2(@cloudflare/workers-types@4.20241218.0)(@libsql/client@0.14.0(encoding@0.1.13))(@prisma/client@5.22.0(prisma@5.22.0))(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/react@18.3.12)(better-sqlite3@11.7.0)(mysql2@3.11.5)(pg@8.12.0)(prisma@5.22.0)(react@18.3.1)(sqlite3@5.1.7) + specifier: ^0.38.4 + version: 0.38.4(@cloudflare/workers-types@4.20250109.0)(@libsql/client@0.14.0(encoding@0.1.13))(@prisma/client@6.2.1(prisma@6.2.1))(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/react@19.0.7)(better-sqlite3@11.8.1)(mysql2@3.12.0)(pg@8.12.0)(prisma@6.2.1)(react@18.3.1)(sqlite3@5.1.7) mysql2: - specifier: ^3.11.5 - version: 3.11.5 + specifier: ^3.12.0 + version: 3.12.0 pg: specifier: ^8.12.0 version: 8.12.0 @@ -244,11 +244,11 @@ importers: packages/apps/session-storage/shopify-app-session-storage-dynamodb: dependencies: '@aws-sdk/client-dynamodb': - specifier: ^3.714.0 - version: 3.714.0 + specifier: ^3.731.1 + version: 3.731.1 '@aws-sdk/util-dynamodb': - specifier: ^3.714.0 - version: 3.714.0(@aws-sdk/client-dynamodb@3.714.0) + specifier: ^3.731.1 + version: 3.731.1(@aws-sdk/client-dynamodb@3.731.1) '@shopify/shopify-api': specifier: ^11.0.0 version: link:../../shopify-api @@ -257,7 +257,7 @@ importers: version: link:../shopify-app-session-storage devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils packages/apps/session-storage/shopify-app-session-storage-kv: @@ -273,14 +273,14 @@ importers: version: 7.6.3 devDependencies: '@cloudflare/workers-types': - specifier: ^4.20241218.0 - version: 4.20241218.0 + specifier: ^4.20250109.0 + version: 4.20250109.0 '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils miniflare: - specifier: ^3.20241205.0 - version: 3.20241205.0 + specifier: ^3.20241230.2 + version: 3.20241230.2 packages/apps/session-storage/shopify-app-session-storage-memory: dependencies: @@ -292,7 +292,7 @@ importers: version: link:../shopify-app-session-storage devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils packages/apps/session-storage/shopify-app-session-storage-mongodb: @@ -308,7 +308,7 @@ importers: version: 6.12.0(socks@2.8.3) devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils packages/apps/session-storage/shopify-app-session-storage-mysql: @@ -320,11 +320,11 @@ importers: specifier: ^3.0.0 version: link:../shopify-app-session-storage mysql2: - specifier: ^3.11.5 - version: 3.11.5 + specifier: ^3.12.0 + version: 3.12.0 devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils packages/apps/session-storage/shopify-app-session-storage-postgresql: @@ -343,7 +343,7 @@ importers: version: 2.7.0 devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils '@types/pg': specifier: ^8.11.6 @@ -359,14 +359,14 @@ importers: version: link:../shopify-app-session-storage devDependencies: '@prisma/client': - specifier: ^5.22.0 - version: 5.22.0(prisma@5.22.0) + specifier: ^6.2.1 + version: 6.2.1(prisma@6.2.1) '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils prisma: - specifier: ^5.22.0 - version: 5.22.0 + specifier: ^6.2.1 + version: 6.2.1 packages/apps/session-storage/shopify-app-session-storage-redis: dependencies: @@ -381,7 +381,7 @@ importers: version: 4.7.0 devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils packages/apps/session-storage/shopify-app-session-storage-sqlite: @@ -397,7 +397,7 @@ importers: version: 5.1.7 devDependencies: '@shopify/shopify-app-session-storage-test-utils': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage-test-utils '@types/sqlite3': specifier: ^3.1.8 @@ -406,10 +406,10 @@ importers: packages/apps/session-storage/shopify-app-session-storage-test-utils: devDependencies: '@shopify/shopify-api': - specifier: ^11.6.1 + specifier: ^11.7.0 version: link:../../shopify-api '@shopify/shopify-app-session-storage': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../shopify-app-session-storage packages/apps/shopify-api: @@ -430,8 +430,8 @@ importers: specifier: ^6.1.1 version: 6.1.1 isbot: - specifier: ^5.1.18 - version: 5.1.18 + specifier: ^5.1.21 + version: 5.1.21 jose: specifier: ^5.9.6 version: 5.9.6 @@ -445,15 +445,15 @@ importers: specifier: ^2.8.1 version: 2.8.1 uuid: - specifier: ^10.0.0 - version: 10.0.0 + specifier: ^11.0.5 + version: 11.0.5 devDependencies: '@cloudflare/workers-types': - specifier: ^4.20241218.0 - version: 4.20241218.0 + specifier: ^4.20250109.0 + version: 4.20250109.0 '@swc/core': - specifier: ^1.10.1 - version: 1.10.1 + specifier: ^1.10.8 + version: 1.10.8 '@types/express': specifier: ^4.17.13 version: 4.17.21 @@ -474,30 +474,30 @@ importers: version: 4.21.2 jest-environment-miniflare: specifier: ^2.14.4 - version: 2.14.4(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2))) + version: 2.14.4(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3))) miniflare: - specifier: ^3.20241205.0 - version: 3.20241205.0 + specifier: ^3.20241230.2 + version: 3.20241230.2 rollup: - specifier: ^4.28.1 - version: 4.28.1 + specifier: ^4.31.0 + version: 4.31.0 rollup-plugin-swc: specifier: ^0.2.1 - version: 0.2.1(@swc/core@1.10.1)(rollup@4.28.1) + version: 0.2.1(@swc/core@1.10.8)(rollup@4.31.0) wrangler: - specifier: ^3.96.0 - version: 3.96.0(@cloudflare/workers-types@4.20241218.0) + specifier: ^3.103.2 + version: 3.103.2(@cloudflare/workers-types@4.20250109.0) packages/apps/shopify-app-express: dependencies: '@shopify/shopify-api': - specifier: ^11.6.1 + specifier: ^11.7.0 version: link:../shopify-api '@shopify/shopify-app-session-storage': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../session-storage/shopify-app-session-storage '@shopify/shopify-app-session-storage-memory': - specifier: ^4.0.9 + specifier: ^4.0.10 version: link:../session-storage/shopify-app-session-storage-memory cookie-parser: specifier: ^1.4.7 @@ -531,23 +531,23 @@ importers: packages/apps/shopify-app-remix: dependencies: '@remix-run/server-runtime': - specifier: ^2.12.1 - version: 2.12.1(typescript@5.7.2) + specifier: ^2.15.2 + version: 2.15.2(typescript@5.7.3) '@shopify/admin-api-client': specifier: ^1.0.4 version: link:../../api-clients/admin-api-client '@shopify/shopify-api': - specifier: ^11.6.1 + specifier: ^11.7.0 version: link:../shopify-api '@shopify/shopify-app-session-storage': - specifier: ^3.0.9 + specifier: ^3.0.10 version: link:../session-storage/shopify-app-session-storage '@shopify/storefront-api-client': specifier: ^1.0.3 version: link:../../api-clients/storefront-api-client isbot: - specifier: ^5.1.18 - version: 5.1.18 + specifier: ^5.1.21 + version: 5.1.21 react: specifier: '*' version: 18.3.1 @@ -556,14 +556,14 @@ importers: version: 7.6.3 devDependencies: '@remix-run/node': - specifier: ^2.15.1 - version: 2.15.1(typescript@5.7.2) + specifier: ^2.15.2 + version: 2.15.2(typescript@5.7.3) '@remix-run/react': - specifier: ^2.11.2 - version: 2.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) + specifier: ^2.15.2 + version: 2.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.3) '@remix-run/testing': - specifier: ^2.11.2 - version: 2.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) + specifier: ^2.15.2 + version: 2.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.3) '@shopify/generate-docs': specifier: ^0.16.4 version: 0.16.4 @@ -574,14 +574,14 @@ importers: specifier: ^5.4.0 version: 5.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@shopify/shopify-app-session-storage-memory': - specifier: ^4.0.9 + specifier: ^4.0.10 version: link:../session-storage/shopify-app-session-storage-memory '@types/jsonwebtoken': specifier: ^9.0.7 version: 9.0.7 '@types/react': - specifier: ^18.3.12 - version: 18.3.12 + specifier: ^19.0.7 + version: 19.0.7 '@types/semver': specifier: ^7.5.8 version: 7.5.8 @@ -621,118 +621,106 @@ packages: '@aws-crypto/util@5.2.0': resolution: {integrity: sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==} - '@aws-sdk/client-dynamodb@3.714.0': - resolution: {integrity: sha512-LM0Gslo3MSRTjvwn30SWJt64dau4hHQcNTXgtaI0LORwha5BnRwRZHsZGwDEHwzmOu31uZZsDHF4rcygl17kSA==} - engines: {node: '>=16.0.0'} - - '@aws-sdk/client-sso-oidc@3.714.0': - resolution: {integrity: sha512-dMvpPUaL3v01psPY1ZyCzQ/w2tOgQTH1if0zBF5r2q7Vc0oOPzbBZgNAhG1bDWlRCBW0iXmoqRFoWUwQ5rtx+A==} - engines: {node: '>=16.0.0'} - peerDependencies: - '@aws-sdk/client-sts': ^3.714.0 + '@aws-sdk/client-dynamodb@3.731.1': + resolution: {integrity: sha512-rdvGbusvbcp4NB1gAr9OGYD9cbyxXNAAaq3BopFMmtqUW1vhD+8DXcQYnZBAu93qjr8Nep1qDtysoIp+AeSOjg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/client-sso@3.714.0': - resolution: {integrity: sha512-pFtjY5Ga91qrryo0UfbjetdT2p9rOgtHofogAeEuGjxx7/rupBpdlW0WDOtD/7jhmbhM8WZEr6aH7GLzzkKfCA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/client-sso@3.731.0': + resolution: {integrity: sha512-O4C/UYGgqMsBg21MMApFdgyh8BX568hQhbdoNFmRVTBoSnCZ3w+H4a1wBPX4Gyl0NX+ab6Xxo9rId8HiyPXJ0A==} + engines: {node: '>=18.0.0'} - '@aws-sdk/client-sts@3.714.0': - resolution: {integrity: sha512-ThcXgolapPsOzeavJF4Am312umFyoFBBeiTYD8PQGIiYkbJi4hXcjoWacmtkq6moMmMZSP9iK/ellls7vwY2JQ==} - engines: {node: '>=16.0.0'} + '@aws-sdk/core@3.731.0': + resolution: {integrity: sha512-ithBN1VWASkvAIlozJmenqDvNnFddr/SZXAs58+jCnBHgy3tXLHABZGVNCjetZkHRqNdXEO1kirnoxaFeXMeDA==} + engines: {node: '>=18.0.0'} - '@aws-sdk/core@3.714.0': - resolution: {integrity: sha512-TlZ50d8MEPVp9O03SvisOmcmxjxhMDKHJJcrBgYjgDej6QmNfiFwtCRkReXDdkEeXP29ehMs7uPXtmVvPqziYw==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-env@3.731.0': + resolution: {integrity: sha512-h0WWZg4QMLgFVyIvQrC43zpVqsUWg1mPM1clpogP43B8+wEhDEQ4qWRzvFs3dQ4cqx/FLyDUZZF4cqgd94z7kw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-env@3.714.0': - resolution: {integrity: sha512-0S4nKE1a+EHXAInXUeuWkyzVnXzmwIbwLStVidAIoyl6sJF8xGdw+r3AaoTr7p0YXzdoDUsn3wBTCA6ZwgXVbA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-http@3.731.0': + resolution: {integrity: sha512-iRtrjtcYaWgbvtu2cvDhIsPWXZGvhy1Hgks4682MEBNTc9AUwlfvDrYz2EEnTtJJyrbOdEHVrYrzqD8qPyVLCg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-http@3.714.0': - resolution: {integrity: sha512-1AXEfUSQUQg+x/DpH1XJhjf2yEgTHHatM3cvYu7FZMhRXF28Q5OJDbEFPfdqrK+vmCiYRWhszDb+zuUIvz46bw==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-ini@3.731.1': + resolution: {integrity: sha512-0M0ejuqW8iHNcTH2ZXSY9m+I7Y06qVkj6k3vfQU9XaB//mTUCxxfGfqWAtgfr7Yi73egABTcPc0jyPdcvSW4Kw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-ini@3.714.0': - resolution: {integrity: sha512-w5wOcgBngfcvVev5wnYWXoc/W2ewVmGJkfRdGquhFt8pkUxktyd8eXehqkP7u31SONVlgy96EFTdSCzWpTrqOw==} - engines: {node: '>=16.0.0'} - peerDependencies: - '@aws-sdk/client-sts': ^3.714.0 + '@aws-sdk/credential-provider-node@3.731.1': + resolution: {integrity: sha512-5c0ZiagMTPmWilXNffeXJCLoCEz97jilHr3QJWwf2GaTay4tzN+Ld71rpdfEenzUR7fuxEWFfVlwQbFOzFNYHg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-node@3.714.0': - resolution: {integrity: sha512-ebho1HYNKzaw0ZfbI9kEicSW8J7tsOoV6EJajsjfFnuP+GY9J5Oi4759GEq1Qqj7GxIhrySOZFzif/hxAXPWtQ==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-process@3.731.0': + resolution: {integrity: sha512-6yNMY6q3xHLbs2f2+C6GhvMrjTgtFBiPJJqKaPLsTIhlTRvh4sK8pGm3ITcma0jOxtPDIuoPfBAV8N8XVMBlZg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-process@3.714.0': - resolution: {integrity: sha512-mHM+zYJDUiXggBx4YvQgMOhbkV07KUib8/jWPnAZbUJcRncN/yevAp/WNocjUN4VaBWkooJUgoTET/okRK+TCQ==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-sso@3.731.1': + resolution: {integrity: sha512-p1tp+rMUf5YNQLr8rVRmDgNtKGYLL0KCdq3K2hwwvFnx9MjReF1sA4lfm3xWsxBQM+j3QN9AvMQqBzDJ+NOSdw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-sso@3.714.0': - resolution: {integrity: sha512-LQyHUQd+/A0PO96m6/A3KeekRplRpG9AmwLn8VPknlmACAhhbWHehzerCTd42V8dClf5pigr25/aVqh/2p/sRw==} - engines: {node: '>=16.0.0'} + '@aws-sdk/credential-provider-web-identity@3.731.1': + resolution: {integrity: sha512-+ynAvEGWDR5ZJFxgpwwzhvlQ3WQ7BleWXU6JwpIw3yFrD4eZEn85b8DZC1aEz7C9kb1HSV6B3gpqHqlyS6wj8g==} + engines: {node: '>=18.0.0'} - '@aws-sdk/credential-provider-web-identity@3.714.0': - resolution: {integrity: sha512-piKfEJvLrGZ0bH4NPO19d1dtfCZi2p6YJUK/9vRCD1rvJidOuHNeUwIcxTnkIMovQHX12rZVvU9ub0C3CwegUQ==} - engines: {node: '>=16.0.0'} - peerDependencies: - '@aws-sdk/client-sts': ^3.714.0 + '@aws-sdk/endpoint-cache@3.723.0': + resolution: {integrity: sha512-2+a4WXRc+07uiPR+zJiPGKSOWaNJQNqitkks+6Hhm/haTLJqNVTgY2OWDh2PXvwMNpKB+AlGdhE65Oy6NzUgXg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/endpoint-cache@3.693.0': - resolution: {integrity: sha512-/zK0ZZncBf5FbTfo8rJMcQIXXk4Ibhe5zEMiwFNivVPR2uNC0+oqfwXz7vjxwY0t6BPE3Bs4h9uFEz4xuGCY6w==} - engines: {node: '>=16.0.0'} + '@aws-sdk/middleware-endpoint-discovery@3.731.0': + resolution: {integrity: sha512-LbpVOltiaDQLJV1hmH1eupnowoVXI4U7vLt3T31FQH4Ec24L4CLipYVpaHl0Al+1hgiWZ5xJ+sGTVmtvr/vOnQ==} + engines: {node: '>=18.0.0'} - '@aws-sdk/middleware-endpoint-discovery@3.714.0': - resolution: {integrity: sha512-WttOa+M6/aPCK0OHPlWPBaQDTVhfKsWYnmDNvS2d0qvoJEjZuGRyf5DxcA2gWt3MMekxwq9IxOpdA5R9T70HiA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/middleware-host-header@3.731.0': + resolution: {integrity: sha512-ndAJsm5uWPPJRZowLKpB1zuL17qWlWVtCJP4I/ynBkq1PU1DijDXBul2UZaG6Mpvsgms1NXo/h9noHuK7T3v8w==} + engines: {node: '>=18.0.0'} - '@aws-sdk/middleware-host-header@3.714.0': - resolution: {integrity: sha512-6l68kjNrh5QC8FGX3I3geBDavWN5Tg1RLHJ2HLA8ByGBtJyCwnz3hEkKfaxn0bBx0hF9DzbfjEOUF6cDqy2Kjg==} - engines: {node: '>=16.0.0'} + '@aws-sdk/middleware-logger@3.731.0': + resolution: {integrity: sha512-IIZrOdjbY2vKzPJPrwE7FoFQCIPEL6UqURi8LEaiVyCag4p2fvaTN5pgKuQtGC2+iYd/HHcGT4qn2bAqF5Jmmw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/middleware-logger@3.714.0': - resolution: {integrity: sha512-RkqHlMvQWUaRklU1bMfUuBvdWwxgUtEqpADaHXlGVj3vtEY2UgBjy+57CveC4MByqKIunNvVHBBbjrGVtwY7Lg==} - engines: {node: '>=16.0.0'} + '@aws-sdk/middleware-recursion-detection@3.731.0': + resolution: {integrity: sha512-y6FLASB1iKWuR5tUipMyo77bt0lEl3OnCrrd2xw/H24avq1HhJjjPR0HHhJE6QKJzF/FYXeV88tcyPSMe32VDw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/middleware-recursion-detection@3.714.0': - resolution: {integrity: sha512-AVU5ixnh93nqtsfgNc284oXsXaadyHGPHpql/jwgaaqQfEXjS/1/j3j9E/vpacfTTz2Vzo7hAOjnvrOXSEVDaA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/middleware-user-agent@3.731.0': + resolution: {integrity: sha512-Ngr2Gz0aec/uduoKaO3srN52SYkEHndYtFzkK/gDUyQwQzi4ha2eIisxPiuHEX6RvXT31V9ouqn/YtVkt0R76A==} + engines: {node: '>=18.0.0'} - '@aws-sdk/middleware-user-agent@3.714.0': - resolution: {integrity: sha512-OgLjJf7WxUqA2OgiqGCfIc68gsbXlIG8LjObBiF0qlMStAd0L23AGuK5VmYinJlsle9qUpwQvWgKFKaDgdQXgA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/nested-clients@3.731.1': + resolution: {integrity: sha512-/L8iVrulnXZl+kgmTn+oxRxNnhcSIbf+r12C06vGUq60w0YMidLvxJZN7vt8H9SnCAGCHqud2MS7ExCEvhc0gA==} + engines: {node: '>=18.0.0'} - '@aws-sdk/region-config-resolver@3.714.0': - resolution: {integrity: sha512-HJzsQxgMOAzZrbf/YIqEx30or4tZK1oNAk6Wm6xecUQx+23JXIaePRu1YFUOLBBERQ4QBPpISFurZWBMZ5ibAw==} - engines: {node: '>=16.0.0'} + '@aws-sdk/region-config-resolver@3.731.0': + resolution: {integrity: sha512-XlDpRNkDVHF59f07JmkuAidEv//m3hT6/JL85h0l3+zrpaRWhf8n8lVUyAPNq35ZujK8AcorYM+93u7hdWsliQ==} + engines: {node: '>=18.0.0'} - '@aws-sdk/token-providers@3.714.0': - resolution: {integrity: sha512-vKN064aLE3kl+Zl16Ony3jltHnMddMBT7JRkP1L+lLywhA0PcAKxpdvComul/sTBWnbnwLnaS5NsDUhcWySH8A==} - engines: {node: '>=16.0.0'} - peerDependencies: - '@aws-sdk/client-sso-oidc': ^3.714.0 + '@aws-sdk/token-providers@3.731.1': + resolution: {integrity: sha512-t34GOPwBZsX7zGHjiTXmMHGY3kHM7fLiQ60Jqk0On9P0ASHTDE5U75RgCXboE3u+qEv9wyKyaqMNyMWj9qQlFg==} + engines: {node: '>=18.0.0'} - '@aws-sdk/types@3.714.0': - resolution: {integrity: sha512-ZjpP2gYbSFlxxaUDa1Il5AVvfggvUPbjzzB/l3q0gIE5Thd6xKW+yzEpt2mLZ5s5UaYSABZbF94g8NUOF4CVGA==} - engines: {node: '>=16.0.0'} + '@aws-sdk/types@3.731.0': + resolution: {integrity: sha512-NrdkJg6oOUbXR2r9WvHP408CLyvST8cJfp1/jP9pemtjvjPoh6NukbCtiSFdOOb1eryP02CnqQWItfJC1p2Y/Q==} + engines: {node: '>=18.0.0'} - '@aws-sdk/util-dynamodb@3.714.0': - resolution: {integrity: sha512-R2hD9d4YCpC2d8aZA8+r6HxGK9Av5WgB5R8kXZaufvQXyWzGmvtKm6xxU4QUHm6X24c9G6lISh2aRvOzPNFRow==} - engines: {node: '>=16.0.0'} + '@aws-sdk/util-dynamodb@3.731.1': + resolution: {integrity: sha512-j7trDplvPjltdu1O95RIU6prXPHQMaU93K+ohJ7L5FE4RHreghIWhzuStEwuQzqC/oBK4CCSFjUQ2zdJaCvZ8g==} + engines: {node: '>=18.0.0'} peerDependencies: - '@aws-sdk/client-dynamodb': ^3.714.0 + '@aws-sdk/client-dynamodb': ^3.731.1 - '@aws-sdk/util-endpoints@3.714.0': - resolution: {integrity: sha512-Xv+Z2lhe7w7ZZRsgBwBMZgGTVmS+dkkj2S13uNHAx9lhB5ovM8PhK5G/j28xYf6vIibeuHkRAbb7/ozdZIGR+A==} - engines: {node: '>=16.0.0'} + '@aws-sdk/util-endpoints@3.731.0': + resolution: {integrity: sha512-riztxTAfncFS9yQWcBJffGgOgLoKSa63ph+rxWJxKl6BHAmWEvHICj1qDcVmnWfIcvJ5cClclY75l9qKaUH7rQ==} + engines: {node: '>=18.0.0'} - '@aws-sdk/util-locate-window@3.693.0': - resolution: {integrity: sha512-ttrag6haJLWABhLqtg1Uf+4LgHWIMOVSYL+VYZmAp2v4PUGOwWmWQH0Zk8RM7YuQcLfH/EoR72/Yxz6A4FKcuw==} - engines: {node: '>=16.0.0'} + '@aws-sdk/util-locate-window@3.723.0': + resolution: {integrity: sha512-Yf2CS10BqK688DRsrKI/EO6B8ff5J86NXe4C+VCysK7UOgN0l1zOTeTukZ3H8Q9tYYX3oaF1961o8vRkFm7Nmw==} + engines: {node: '>=18.0.0'} - '@aws-sdk/util-user-agent-browser@3.714.0': - resolution: {integrity: sha512-OdJJ03cP9/MgIVToPJPCPUImbpZzTcwdIgbXC0tUQPJhbD7b7cB4LdnkhNHko+MptpOrCq4CPY/33EpOjRdofw==} + '@aws-sdk/util-user-agent-browser@3.731.0': + resolution: {integrity: sha512-EnYXxTkCNCjTTBjW/pelRPv4Thsi9jepoB6qQjPMA9/ixrZ71BhhQecz9kgqzZLR9BPCwb6hgJ/Yd702jqJ4aQ==} - '@aws-sdk/util-user-agent-node@3.714.0': - resolution: {integrity: sha512-x8JoZb7yBEbNUmHUNoRAP4L++6A5uZCVf2yFLw8CZKpH4q+Cf1a68ou48OfnND3H0rbBnLXc/3uOlseRvd57/g==} - engines: {node: '>=16.0.0'} + '@aws-sdk/util-user-agent-node@3.731.0': + resolution: {integrity: sha512-Rze78Ym5Bx7aWMvmZE2iL3JPo2INNCC5N9rLVx98Gg1G0ZaxclVRUvJrh1AojNlOFxU+otkxAe7FA3Foy2iLLQ==} + engines: {node: '>=18.0.0'} peerDependencies: aws-crt: '>=1.0.0' peerDependenciesMeta: @@ -1633,38 +1621,38 @@ packages: resolution: {integrity: sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==} engines: {node: '>=16.13'} - '@cloudflare/workerd-darwin-64@1.20241205.0': - resolution: {integrity: sha512-TArEZkSZkHJyEwnlWWkSpCI99cF6lJ14OVeEoI9Um/+cD9CKZLM9vCmsLeKglKheJ0KcdCnkA+DbeD15t3VaWg==} + '@cloudflare/workerd-darwin-64@1.20241230.0': + resolution: {integrity: sha512-BZHLg4bbhNQoaY1Uan81O3FV/zcmWueC55juhnaI7NAobiQth9RppadPNpxNAmS9fK2mR5z8xrwMQSQrHmztyQ==} engines: {node: '>=16'} cpu: [x64] os: [darwin] - '@cloudflare/workerd-darwin-arm64@1.20241205.0': - resolution: {integrity: sha512-u5eqKa9QRdA8MugfgCoD+ADDjY6EpKbv3hSYJETmmUh17l7WXjWBzv4pUvOKIX67C0UzMUy4jZYwC53MymhX3w==} + '@cloudflare/workerd-darwin-arm64@1.20241230.0': + resolution: {integrity: sha512-lllxycj7EzYoJ0VOJh8M3palUgoonVrILnzGrgsworgWlIpgjfXGS7b41tEGCw6AxSxL9prmTIGtfSPUvn/rjg==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] - '@cloudflare/workerd-linux-64@1.20241205.0': - resolution: {integrity: sha512-OYA7S5zpumMamWEW+IhhBU6YojIEocyE5X/YFPiTOCrDE3dsfr9t6oqNE7hxGm1VAAu+Irtl+a/5LwmBOU681w==} + '@cloudflare/workerd-linux-64@1.20241230.0': + resolution: {integrity: sha512-Y3mHcW0KghOmWdNZyHYpEOG4Ba/ga8tht5vj1a+WXfagEjMO8Y98XhZUlCaYa9yB7Wh5jVcK5LM2jlO/BLgqpA==} engines: {node: '>=16'} cpu: [x64] os: [linux] - '@cloudflare/workerd-linux-arm64@1.20241205.0': - resolution: {integrity: sha512-qAzecONjFJGIAVJZKExQ5dlbic0f3d4A+GdKa+H6SoUJtPaWiE3K6WuePo4JOT7W3/Zfh25McmX+MmpMUUcM5Q==} + '@cloudflare/workerd-linux-arm64@1.20241230.0': + resolution: {integrity: sha512-IAjhsWPlHzhhkJ6I49sDG6XfMnhPvv0szKGXxTWQK/IWMrbGdHm4RSfNKBSoLQm67jGMIzbmcrX9UIkms27Y1g==} engines: {node: '>=16'} cpu: [arm64] os: [linux] - '@cloudflare/workerd-windows-64@1.20241205.0': - resolution: {integrity: sha512-BEab+HiUgCdl6GXAT7EI2yaRtDPiRJlB94XLvRvXi1ZcmQqsrq6awGo6apctFo4WUL29V7c09LxmN4HQ3X2Tvg==} + '@cloudflare/workerd-windows-64@1.20241230.0': + resolution: {integrity: sha512-y5SPIk9iOb2gz+yWtHxoeMnjPnkYQswiCJ480oHC6zexnJLlKTpcmBCjDH1nWCT4pQi8F25gaH8thgElf4NvXQ==} engines: {node: '>=16'} cpu: [x64] os: [win32] - '@cloudflare/workers-types@4.20241218.0': - resolution: {integrity: sha512-Y0brjmJHcAZBXOPI7lU5hbiXglQWniA1kQjot2ata+HFimyjPPcz+4QWBRrmWcMPo0OadR2Vmac7WStDLpvz0w==} + '@cloudflare/workers-types@4.20250109.0': + resolution: {integrity: sha512-Y1zgSaEOOevl9ORpzgMcm4j535p3nK2lrblHHvYM2yxR50SBKGh+wvkRFAIxWRfjUGZEU+Fp6923EGioDBbobA==} '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} @@ -2745,29 +2733,29 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@prisma/client@5.22.0': - resolution: {integrity: sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==} - engines: {node: '>=16.13'} + '@prisma/client@6.2.1': + resolution: {integrity: sha512-msKY2iRLISN8t5X0Tj7hU0UWet1u0KuxSPHWuf3IRkB4J95mCvGpyQBfQ6ufcmvKNOMQSq90O2iUmJEN2e5fiA==} + engines: {node: '>=18.18'} peerDependencies: prisma: '*' peerDependenciesMeta: prisma: optional: true - '@prisma/debug@5.22.0': - resolution: {integrity: sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==} + '@prisma/debug@6.2.1': + resolution: {integrity: sha512-0KItvt39CmQxWkEw6oW+RQMD6RZ43SJWgEUnzxN8VC9ixMysa7MzZCZf22LCK5DSooiLNf8vM3LHZm/I/Ni7bQ==} - '@prisma/engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2': - resolution: {integrity: sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==} + '@prisma/engines-version@6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69': + resolution: {integrity: sha512-7tw1qs/9GWSX6qbZs4He09TOTg1ff3gYsB3ubaVNN0Pp1zLm9NC5C5MZShtkz7TyQjx7blhpknB7HwEhlG+PrQ==} - '@prisma/engines@5.22.0': - resolution: {integrity: sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==} + '@prisma/engines@6.2.1': + resolution: {integrity: sha512-lTBNLJBCxVT9iP5I7Mn6GlwqAxTpS5qMERrhebkUhtXpGVkBNd/jHnNJBZQW4kGDCKaQg/r2vlJYkzOHnAb7ZQ==} - '@prisma/fetch-engine@5.22.0': - resolution: {integrity: sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==} + '@prisma/fetch-engine@6.2.1': + resolution: {integrity: sha512-OO7O9d6Mrx2F9i+Gu1LW+DGXXyUFkP7OE5aj9iBfA/2jjDXEJjqa9X0ZmM9NZNo8Uo7ql6zKm6yjDcbAcRrw1A==} - '@prisma/get-platform@5.22.0': - resolution: {integrity: sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==} + '@prisma/get-platform@6.2.1': + resolution: {integrity: sha512-zp53yvroPl5m5/gXYLz7tGCNG33bhG+JYCm74ohxOq1pPnrL47VQYFfF3RbTZ7TzGWCrR3EtoiYMywUBw7UK6Q==} '@redis/bloom@1.2.0': resolution: {integrity: sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==} @@ -2798,17 +2786,8 @@ packages: peerDependencies: '@redis/client': ^1.0.0 - '@remix-run/node@2.11.2': - resolution: {integrity: sha512-gRNFM61EOYWNmYgf+pvBt6MrirWlkDz1G6RQsJNowtRqbYoy05AdDe5HiHGF5w8ZMAZVeXnZiwbL0Nt7ykYBCA==} - engines: {node: '>=18.0.0'} - peerDependencies: - typescript: ^5.1.0 - peerDependenciesMeta: - typescript: - optional: true - - '@remix-run/node@2.15.1': - resolution: {integrity: sha512-23xWN3/yOohNUr27KS7hEcDMbtufMkniXfXkcLx8Dz2wUVNfJYGpICjeV48Ue/INtpiUCCzOYwkL9VRjIMEJbA==} + '@remix-run/node@2.15.2': + resolution: {integrity: sha512-NS/h5uxje7DYCNgcKqKAiUhf0r2HVnoYUBWLyIIMmCUP1ddWurBP6xTPcWzGhEvV/EvguniYi1wJZ5+X8sonWw==} engines: {node: '>=18.0.0'} peerDependencies: typescript: ^5.1.0 @@ -2816,8 +2795,8 @@ packages: typescript: optional: true - '@remix-run/react@2.11.2': - resolution: {integrity: sha512-SjjuK3aD/9wnIC5r0ZBNCpVSwEwt67YOQM7DCXhHiS8BtCvAxWEC4k4t8CvO9IwBG0gczqxzSqASH7U1RVtWqw==} + '@remix-run/react@2.15.2': + resolution: {integrity: sha512-NAAMsSgoC/sdOgovUewwRCE/RUm3F+MBxxZKfwu3POCNeHaplY5qGkH/y8PUXvdN1EBG7Z0Ko43dyzCfcEy5PA==} engines: {node: '>=18.0.0'} peerDependencies: react: ^18.0.0 @@ -2827,29 +2806,12 @@ packages: typescript: optional: true - '@remix-run/router@1.19.1': - resolution: {integrity: sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==} - engines: {node: '>=14.0.0'} - - '@remix-run/router@1.19.2': - resolution: {integrity: sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==} - engines: {node: '>=14.0.0'} - '@remix-run/router@1.21.0': resolution: {integrity: sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==} engines: {node: '>=14.0.0'} - '@remix-run/server-runtime@2.11.2': - resolution: {integrity: sha512-abG6ENj0X3eHqDxqO2thWM2NSEiPnqyt58z1BbiQCv+t8g0Zuqd5QHbB4wzdNvfS0vKhg+jJiigcJneAc4sZzw==} - engines: {node: '>=18.0.0'} - peerDependencies: - typescript: ^5.1.0 - peerDependenciesMeta: - typescript: - optional: true - - '@remix-run/server-runtime@2.12.1': - resolution: {integrity: sha512-iuj9ju34f0LztPpd5dVuTXgt4x/MJeRsBiLuEx02nDSMGoNCAIx2LdeNYvE+XXdsf1Ht2NMlpRU+HBPCz3QLZg==} + '@remix-run/server-runtime@2.15.2': + resolution: {integrity: sha512-OqiPcvEnnU88B8b1LIWHHkQ3Tz2GDAmQ1RihFNQsbrFKpDsQLkw0lJlnfgKA/uHd0CEEacpfV7C9qqJT3V6Z2g==} engines: {node: '>=18.0.0'} peerDependencies: typescript: ^5.1.0 @@ -2857,17 +2819,8 @@ packages: typescript: optional: true - '@remix-run/server-runtime@2.15.1': - resolution: {integrity: sha512-TDM3rzax//N2F5uNMV5pNTWAop8cYul6hteDu+Xmfwys/eRGlbzEf7YJzyRj6Kcsg2TFVHI7+xEPItGAVm1hHA==} - engines: {node: '>=18.0.0'} - peerDependencies: - typescript: ^5.1.0 - peerDependenciesMeta: - typescript: - optional: true - - '@remix-run/testing@2.11.2': - resolution: {integrity: sha512-Wmi/TXWlngkbLFFDYbWPB2WH7jZDcd55MIZyRmBIVtva7mSzK5GKX+LWdoaTFcL6IxXvJtOszuJpneC0Sf75HA==} + '@remix-run/testing@2.15.2': + resolution: {integrity: sha512-f3HCTQyguMogKLSET6VYPcoCveZ6BH+0yWGimIPrXb4gfnw9AyNg/bsdnHb7/u6Zw/LmB0QfOUWAtJCwREcfcQ==} engines: {node: '>=18.0.0'} peerDependencies: react: ^18.0.0 @@ -2988,98 +2941,98 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.28.1': - resolution: {integrity: sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==} + '@rollup/rollup-android-arm-eabi@4.31.0': + resolution: {integrity: sha512-9NrR4033uCbUBRgvLcBrJofa2KY9DzxL2UKZ1/4xA/mnTNyhZCWBuD8X3tPm1n4KxcgaraOYgrFKSgwjASfmlA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.28.1': - resolution: {integrity: sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==} + '@rollup/rollup-android-arm64@4.31.0': + resolution: {integrity: sha512-iBbODqT86YBFHajxxF8ebj2hwKm1k8PTBQSojSt3d1FFt1gN+xf4CowE47iN0vOSdnd+5ierMHBbu/rHc7nq5g==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.28.1': - resolution: {integrity: sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==} + '@rollup/rollup-darwin-arm64@4.31.0': + resolution: {integrity: sha512-WHIZfXgVBX30SWuTMhlHPXTyN20AXrLH4TEeH/D0Bolvx9PjgZnn4H677PlSGvU6MKNsjCQJYczkpvBbrBnG6g==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.28.1': - resolution: {integrity: sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==} + '@rollup/rollup-darwin-x64@4.31.0': + resolution: {integrity: sha512-hrWL7uQacTEF8gdrQAqcDy9xllQ0w0zuL1wk1HV8wKGSGbKPVjVUv/DEwT2+Asabf8Dh/As+IvfdU+H8hhzrQQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.28.1': - resolution: {integrity: sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==} + '@rollup/rollup-freebsd-arm64@4.31.0': + resolution: {integrity: sha512-S2oCsZ4hJviG1QjPY1h6sVJLBI6ekBeAEssYKad1soRFv3SocsQCzX6cwnk6fID6UQQACTjeIMB+hyYrFacRew==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.28.1': - resolution: {integrity: sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==} + '@rollup/rollup-freebsd-x64@4.31.0': + resolution: {integrity: sha512-pCANqpynRS4Jirn4IKZH4tnm2+2CqCNLKD7gAdEjzdLGbH1iO0zouHz4mxqg0uEMpO030ejJ0aA6e1PJo2xrPA==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.28.1': - resolution: {integrity: sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==} + '@rollup/rollup-linux-arm-gnueabihf@4.31.0': + resolution: {integrity: sha512-0O8ViX+QcBd3ZmGlcFTnYXZKGbFu09EhgD27tgTdGnkcYXLat4KIsBBQeKLR2xZDCXdIBAlWLkiXE1+rJpCxFw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.28.1': - resolution: {integrity: sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==} + '@rollup/rollup-linux-arm-musleabihf@4.31.0': + resolution: {integrity: sha512-w5IzG0wTVv7B0/SwDnMYmbr2uERQp999q8FMkKG1I+j8hpPX2BYFjWe69xbhbP6J9h2gId/7ogesl9hwblFwwg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.28.1': - resolution: {integrity: sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==} + '@rollup/rollup-linux-arm64-gnu@4.31.0': + resolution: {integrity: sha512-JyFFshbN5xwy6fulZ8B/8qOqENRmDdEkcIMF0Zz+RsfamEW+Zabl5jAb0IozP/8UKnJ7g2FtZZPEUIAlUSX8cA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.28.1': - resolution: {integrity: sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==} + '@rollup/rollup-linux-arm64-musl@4.31.0': + resolution: {integrity: sha512-kpQXQ0UPFeMPmPYksiBL9WS/BDiQEjRGMfklVIsA0Sng347H8W2iexch+IEwaR7OVSKtr2ZFxggt11zVIlZ25g==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.28.1': - resolution: {integrity: sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==} + '@rollup/rollup-linux-loongarch64-gnu@4.31.0': + resolution: {integrity: sha512-pMlxLjt60iQTzt9iBb3jZphFIl55a70wexvo8p+vVFK+7ifTRookdoXX3bOsRdmfD+OKnMozKO6XM4zR0sHRrQ==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': - resolution: {integrity: sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==} + '@rollup/rollup-linux-powerpc64le-gnu@4.31.0': + resolution: {integrity: sha512-D7TXT7I/uKEuWiRkEFbed1UUYZwcJDU4vZQdPTcepK7ecPhzKOYk4Er2YR4uHKme4qDeIh6N3XrLfpuM7vzRWQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.28.1': - resolution: {integrity: sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==} + '@rollup/rollup-linux-riscv64-gnu@4.31.0': + resolution: {integrity: sha512-wal2Tc8O5lMBtoePLBYRKj2CImUCJ4UNGJlLwspx7QApYny7K1cUYlzQ/4IGQBLmm+y0RS7dwc3TDO/pmcneTw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.28.1': - resolution: {integrity: sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==} + '@rollup/rollup-linux-s390x-gnu@4.31.0': + resolution: {integrity: sha512-O1o5EUI0+RRMkK9wiTVpk2tyzXdXefHtRTIjBbmFREmNMy7pFeYXCFGbhKFwISA3UOExlo5GGUuuj3oMKdK6JQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.28.1': - resolution: {integrity: sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==} + '@rollup/rollup-linux-x64-gnu@4.31.0': + resolution: {integrity: sha512-zSoHl356vKnNxwOWnLd60ixHNPRBglxpv2g7q0Cd3Pmr561gf0HiAcUBRL3S1vPqRC17Zo2CX/9cPkqTIiai1g==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.28.1': - resolution: {integrity: sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==} + '@rollup/rollup-linux-x64-musl@4.31.0': + resolution: {integrity: sha512-ypB/HMtcSGhKUQNiFwqgdclWNRrAYDH8iMYH4etw/ZlGwiTVxBz2tDrGRrPlfZu6QjXwtd+C3Zib5pFqID97ZA==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.28.1': - resolution: {integrity: sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==} + '@rollup/rollup-win32-arm64-msvc@4.31.0': + resolution: {integrity: sha512-JuhN2xdI/m8Hr+aVO3vspO7OQfUFO6bKLIRTAy0U15vmWjnZDLrEgCZ2s6+scAYaQVpYSh9tZtRijApw9IXyMw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.28.1': - resolution: {integrity: sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==} + '@rollup/rollup-win32-ia32-msvc@4.31.0': + resolution: {integrity: sha512-U1xZZXYkvdf5MIWmftU8wrM5PPXzyaY1nGCI4KI4BFfoZxHamsIe+BtnPLIvvPykvQWlVbqUXdLa4aJUuilwLQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.28.1': - resolution: {integrity: sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==} + '@rollup/rollup-win32-x64-msvc@4.31.0': + resolution: {integrity: sha512-ul8rnCsUumNln5YWwz0ted2ZHFhzhRRnkpBZ+YRuHoRAlUji9KChpOUOndY7uykrPEPXVbHLlsdo6v5yXo/TXw==} cpu: [x64] os: [win32] @@ -3151,236 +3104,240 @@ packages: '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - '@smithy/abort-controller@3.1.9': - resolution: {integrity: sha512-yiW0WI30zj8ZKoSYNx90no7ugVn3khlyH/z5W8qtKBtVE6awRALbhSG+2SAHA1r6bO/6M9utxYKVZ3PCJ1rWxw==} - engines: {node: '>=16.0.0'} + '@smithy/abort-controller@4.0.1': + resolution: {integrity: sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==} + engines: {node: '>=18.0.0'} - '@smithy/config-resolver@3.0.13': - resolution: {integrity: sha512-Gr/qwzyPaTL1tZcq8WQyHhTZREER5R1Wytmz4WnVGL4onA3dNk6Btll55c8Vr58pLdvWZmtG8oZxJTw3t3q7Jg==} - engines: {node: '>=16.0.0'} + '@smithy/config-resolver@4.0.1': + resolution: {integrity: sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==} + engines: {node: '>=18.0.0'} - '@smithy/core@2.5.5': - resolution: {integrity: sha512-G8G/sDDhXA7o0bOvkc7bgai6POuSld/+XhNnWAbpQTpLv2OZPvyqQ58tLPPlz0bSNsXktldDDREIv1LczFeNEw==} - engines: {node: '>=16.0.0'} + '@smithy/core@3.1.1': + resolution: {integrity: sha512-hhUZlBWYuh9t6ycAcN90XOyG76C1AzwxZZgaCVPMYpWqqk9uMFo7HGG5Zu2cEhCJn7DdOi5krBmlibWWWPgdsw==} + engines: {node: '>=18.0.0'} - '@smithy/credential-provider-imds@3.2.8': - resolution: {integrity: sha512-ZCY2yD0BY+K9iMXkkbnjo+08T2h8/34oHd0Jmh6BZUSZwaaGlGCyBT/3wnS7u7Xl33/EEfN4B6nQr3Gx5bYxgw==} - engines: {node: '>=16.0.0'} + '@smithy/credential-provider-imds@4.0.1': + resolution: {integrity: sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==} + engines: {node: '>=18.0.0'} - '@smithy/fetch-http-handler@4.1.2': - resolution: {integrity: sha512-R7rU7Ae3ItU4rC0c5mB2sP5mJNbCfoDc8I5XlYjIZnquyUwec7fEo78F6DA3SmgJgkU1qTMcZJuGblxZsl10ZA==} + '@smithy/fetch-http-handler@5.0.1': + resolution: {integrity: sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==} + engines: {node: '>=18.0.0'} - '@smithy/hash-node@3.0.11': - resolution: {integrity: sha512-emP23rwYyZhQBvklqTtwetkQlqbNYirDiEEwXl2v0GYWMnCzxst7ZaRAnWuy28njp5kAH54lvkdG37MblZzaHA==} - engines: {node: '>=16.0.0'} + '@smithy/hash-node@4.0.1': + resolution: {integrity: sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==} + engines: {node: '>=18.0.0'} - '@smithy/invalid-dependency@3.0.11': - resolution: {integrity: sha512-NuQmVPEJjUX6c+UELyVz8kUx8Q539EDeNwbRyu4IIF8MeV7hUtq1FB3SHVyki2u++5XLMFqngeMKk7ccspnNyQ==} + '@smithy/invalid-dependency@4.0.1': + resolution: {integrity: sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==} + engines: {node: '>=18.0.0'} '@smithy/is-array-buffer@2.2.0': resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} engines: {node: '>=14.0.0'} - '@smithy/is-array-buffer@3.0.0': - resolution: {integrity: sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==} - engines: {node: '>=16.0.0'} + '@smithy/is-array-buffer@4.0.0': + resolution: {integrity: sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==} + engines: {node: '>=18.0.0'} - '@smithy/middleware-content-length@3.0.13': - resolution: {integrity: sha512-zfMhzojhFpIX3P5ug7jxTjfUcIPcGjcQYzB9t+rv0g1TX7B0QdwONW+ATouaLoD7h7LOw/ZlXfkq4xJ/g2TrIw==} - engines: {node: '>=16.0.0'} + '@smithy/middleware-content-length@4.0.1': + resolution: {integrity: sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==} + engines: {node: '>=18.0.0'} - '@smithy/middleware-endpoint@3.2.5': - resolution: {integrity: sha512-VhJNs/s/lyx4weiZdXSloBgoLoS8osV0dKIain8nGmx7of3QFKu5BSdEuk1z/U8x9iwes1i+XCiNusEvuK1ijg==} - engines: {node: '>=16.0.0'} + '@smithy/middleware-endpoint@4.0.2': + resolution: {integrity: sha512-Z9m67CXizGpj8CF/AW/7uHqYNh1VXXOn9Ap54fenWsCa0HnT4cJuE61zqG3cBkTZJDCy0wHJphilI41co/PE5g==} + engines: {node: '>=18.0.0'} - '@smithy/middleware-retry@3.0.30': - resolution: {integrity: sha512-6323RL2BvAR3VQpTjHpa52kH/iSHyxd/G9ohb2MkBk2Ucu+oMtRXT8yi7KTSIS9nb58aupG6nO0OlXnQOAcvmQ==} - engines: {node: '>=16.0.0'} + '@smithy/middleware-retry@4.0.3': + resolution: {integrity: sha512-TiKwwQTwUDeDtwWW8UWURTqu7s6F3wN2pmziLU215u7bqpVT9Mk2oEvURjpRLA+5XeQhM68R5BpAGzVtomsqgA==} + engines: {node: '>=18.0.0'} - '@smithy/middleware-serde@3.0.11': - resolution: {integrity: sha512-KzPAeySp/fOoQA82TpnwItvX8BBURecpx6ZMu75EZDkAcnPtO6vf7q4aH5QHs/F1s3/snQaSFbbUMcFFZ086Mw==} - engines: {node: '>=16.0.0'} + '@smithy/middleware-serde@4.0.1': + resolution: {integrity: sha512-Fh0E2SOF+S+P1+CsgKyiBInAt3o2b6Qk7YOp2W0Qx2XnfTdfMuSDKUEcnrtpxCzgKJnqXeLUZYqtThaP0VGqtA==} + engines: {node: '>=18.0.0'} - '@smithy/middleware-stack@3.0.11': - resolution: {integrity: sha512-1HGo9a6/ikgOMrTrWL/WiN9N8GSVYpuRQO5kjstAq4CvV59bjqnh7TbdXGQ4vxLD3xlSjfBjq5t1SOELePsLnA==} - engines: {node: '>=16.0.0'} + '@smithy/middleware-stack@4.0.1': + resolution: {integrity: sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==} + engines: {node: '>=18.0.0'} - '@smithy/node-config-provider@3.1.12': - resolution: {integrity: sha512-O9LVEu5J/u/FuNlZs+L7Ikn3lz7VB9hb0GtPT9MQeiBmtK8RSY3ULmsZgXhe6VAlgTw0YO+paQx4p8xdbs43vQ==} - engines: {node: '>=16.0.0'} + '@smithy/node-config-provider@4.0.1': + resolution: {integrity: sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==} + engines: {node: '>=18.0.0'} - '@smithy/node-http-handler@3.3.2': - resolution: {integrity: sha512-t4ng1DAd527vlxvOfKFYEe6/QFBcsj7WpNlWTyjorwXXcKw3XlltBGbyHfSJ24QT84nF+agDha9tNYpzmSRZPA==} - engines: {node: '>=16.0.0'} + '@smithy/node-http-handler@4.0.2': + resolution: {integrity: sha512-X66H9aah9hisLLSnGuzRYba6vckuFtGE+a5DcHLliI/YlqKrGoxhisD5XbX44KyoeRzoNlGr94eTsMVHFAzPOw==} + engines: {node: '>=18.0.0'} - '@smithy/property-provider@3.1.11': - resolution: {integrity: sha512-I/+TMc4XTQ3QAjXfOcUWbSS073oOEAxgx4aZy8jHaf8JQnRkq2SZWw8+PfDtBvLUjcGMdxl+YwtzWe6i5uhL/A==} - engines: {node: '>=16.0.0'} + '@smithy/property-provider@4.0.1': + resolution: {integrity: sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==} + engines: {node: '>=18.0.0'} - '@smithy/protocol-http@4.1.8': - resolution: {integrity: sha512-hmgIAVyxw1LySOwkgMIUN0kjN8TG9Nc85LJeEmEE/cNEe2rkHDUWhnJf2gxcSRFLWsyqWsrZGw40ROjUogg+Iw==} - engines: {node: '>=16.0.0'} + '@smithy/protocol-http@5.0.1': + resolution: {integrity: sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==} + engines: {node: '>=18.0.0'} - '@smithy/querystring-builder@3.0.11': - resolution: {integrity: sha512-u+5HV/9uJaeLj5XTb6+IEF/dokWWkEqJ0XiaRRogyREmKGUgZnNecLucADLdauWFKUNbQfulHFEZEdjwEBjXRg==} - engines: {node: '>=16.0.0'} + '@smithy/querystring-builder@4.0.1': + resolution: {integrity: sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==} + engines: {node: '>=18.0.0'} - '@smithy/querystring-parser@3.0.11': - resolution: {integrity: sha512-Je3kFvCsFMnso1ilPwA7GtlbPaTixa3WwC+K21kmMZHsBEOZYQaqxcMqeFFoU7/slFjKDIpiiPydvdJm8Q/MCw==} - engines: {node: '>=16.0.0'} + '@smithy/querystring-parser@4.0.1': + resolution: {integrity: sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==} + engines: {node: '>=18.0.0'} - '@smithy/service-error-classification@3.0.11': - resolution: {integrity: sha512-QnYDPkyewrJzCyaeI2Rmp7pDwbUETe+hU8ADkXmgNusO1bgHBH7ovXJiYmba8t0fNfJx75fE8dlM6SEmZxheog==} - engines: {node: '>=16.0.0'} + '@smithy/service-error-classification@4.0.1': + resolution: {integrity: sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==} + engines: {node: '>=18.0.0'} - '@smithy/shared-ini-file-loader@3.1.12': - resolution: {integrity: sha512-1xKSGI+U9KKdbG2qDvIR9dGrw3CNx+baqJfyr0igKEpjbHL5stsqAesYBzHChYHlelWtb87VnLWlhvfCz13H8Q==} - engines: {node: '>=16.0.0'} + '@smithy/shared-ini-file-loader@4.0.1': + resolution: {integrity: sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==} + engines: {node: '>=18.0.0'} - '@smithy/signature-v4@4.2.4': - resolution: {integrity: sha512-5JWeMQYg81TgU4cG+OexAWdvDTs5JDdbEZx+Qr1iPbvo91QFGzjy0IkXAKaXUHqmKUJgSHK0ZxnCkgZpzkeNTA==} - engines: {node: '>=16.0.0'} + '@smithy/signature-v4@5.0.1': + resolution: {integrity: sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==} + engines: {node: '>=18.0.0'} - '@smithy/smithy-client@3.5.0': - resolution: {integrity: sha512-Y8FeOa7gbDfCWf7njrkoRATPa5eNLUEjlJS5z5rXatYuGkCb80LbHcu8AQR8qgAZZaNHCLyo2N+pxPsV7l+ivg==} - engines: {node: '>=16.0.0'} + '@smithy/smithy-client@4.1.2': + resolution: {integrity: sha512-0yApeHWBqocelHGK22UivZyShNxFbDNrgREBllGh5Ws0D0rg/yId/CJfeoKKpjbfY2ju8j6WgDUGZHYQmINZ5w==} + engines: {node: '>=18.0.0'} - '@smithy/types@3.7.2': - resolution: {integrity: sha512-bNwBYYmN8Eh9RyjS1p2gW6MIhSO2rl7X9QeLM8iTdcGRP+eDiIWDt66c9IysCc22gefKszZv+ubV9qZc7hdESg==} - engines: {node: '>=16.0.0'} + '@smithy/types@4.1.0': + resolution: {integrity: sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==} + engines: {node: '>=18.0.0'} - '@smithy/url-parser@3.0.11': - resolution: {integrity: sha512-TmlqXkSk8ZPhfc+SQutjmFr5FjC0av3GZP4B/10caK1SbRwe/v+Wzu/R6xEKxoNqL+8nY18s1byiy6HqPG37Aw==} + '@smithy/url-parser@4.0.1': + resolution: {integrity: sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==} + engines: {node: '>=18.0.0'} - '@smithy/util-base64@3.0.0': - resolution: {integrity: sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==} - engines: {node: '>=16.0.0'} + '@smithy/util-base64@4.0.0': + resolution: {integrity: sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==} + engines: {node: '>=18.0.0'} - '@smithy/util-body-length-browser@3.0.0': - resolution: {integrity: sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ==} + '@smithy/util-body-length-browser@4.0.0': + resolution: {integrity: sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==} + engines: {node: '>=18.0.0'} - '@smithy/util-body-length-node@3.0.0': - resolution: {integrity: sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA==} - engines: {node: '>=16.0.0'} + '@smithy/util-body-length-node@4.0.0': + resolution: {integrity: sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==} + engines: {node: '>=18.0.0'} '@smithy/util-buffer-from@2.2.0': resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} engines: {node: '>=14.0.0'} - '@smithy/util-buffer-from@3.0.0': - resolution: {integrity: sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==} - engines: {node: '>=16.0.0'} + '@smithy/util-buffer-from@4.0.0': + resolution: {integrity: sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==} + engines: {node: '>=18.0.0'} - '@smithy/util-config-provider@3.0.0': - resolution: {integrity: sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ==} - engines: {node: '>=16.0.0'} + '@smithy/util-config-provider@4.0.0': + resolution: {integrity: sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==} + engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-browser@3.0.30': - resolution: {integrity: sha512-nLuGmgfcr0gzm64pqF2UT4SGWVG8UGviAdayDlVzJPNa6Z4lqvpDzdRXmLxtOdEjVlTOEdpZ9dd3ZMMu488mzg==} - engines: {node: '>= 10.0.0'} + '@smithy/util-defaults-mode-browser@4.0.3': + resolution: {integrity: sha512-7c5SF1fVK0EOs+2EOf72/qF199zwJflU1d02AevwKbAUPUZyE9RUZiyJxeUmhVxfKDWdUKaaVojNiaDQgnHL9g==} + engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-node@3.0.30': - resolution: {integrity: sha512-OD63eWoH68vp75mYcfYyuVH+p7Li/mY4sYOROnauDrtObo1cS4uWfsy/zhOTW8F8ZPxQC1ZXZKVxoxvMGUv2Ow==} - engines: {node: '>= 10.0.0'} + '@smithy/util-defaults-mode-node@4.0.3': + resolution: {integrity: sha512-CVnD42qYD3JKgDlImZ9+On+MqJHzq9uJgPbMdeBE8c2x8VJ2kf2R3XO/yVFx+30ts5lD/GlL0eFIShY3x9ROgQ==} + engines: {node: '>=18.0.0'} - '@smithy/util-endpoints@2.1.7': - resolution: {integrity: sha512-tSfcqKcN/Oo2STEYCABVuKgJ76nyyr6skGl9t15hs+YaiU06sgMkN7QYjo0BbVw+KT26zok3IzbdSOksQ4YzVw==} - engines: {node: '>=16.0.0'} + '@smithy/util-endpoints@3.0.1': + resolution: {integrity: sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==} + engines: {node: '>=18.0.0'} - '@smithy/util-hex-encoding@3.0.0': - resolution: {integrity: sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==} - engines: {node: '>=16.0.0'} + '@smithy/util-hex-encoding@4.0.0': + resolution: {integrity: sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==} + engines: {node: '>=18.0.0'} - '@smithy/util-middleware@3.0.11': - resolution: {integrity: sha512-dWpyc1e1R6VoXrwLoLDd57U1z6CwNSdkM69Ie4+6uYh2GC7Vg51Qtan7ITzczuVpqezdDTKJGJB95fFvvjU/ow==} - engines: {node: '>=16.0.0'} + '@smithy/util-middleware@4.0.1': + resolution: {integrity: sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==} + engines: {node: '>=18.0.0'} - '@smithy/util-retry@3.0.11': - resolution: {integrity: sha512-hJUC6W7A3DQgaee3Hp9ZFcOxVDZzmBIRBPlUAk8/fSOEl7pE/aX7Dci0JycNOnm9Mfr0KV2XjIlUOcGWXQUdVQ==} - engines: {node: '>=16.0.0'} + '@smithy/util-retry@4.0.1': + resolution: {integrity: sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==} + engines: {node: '>=18.0.0'} - '@smithy/util-stream@3.3.2': - resolution: {integrity: sha512-sInAqdiVeisUGYAv/FrXpmJ0b4WTFmciTRqzhb7wVuem9BHvhIG7tpiYHLDWrl2stOokNZpTTGqz3mzB2qFwXg==} - engines: {node: '>=16.0.0'} + '@smithy/util-stream@4.0.2': + resolution: {integrity: sha512-0eZ4G5fRzIoewtHtwaYyl8g2C+osYOT4KClXgfdNEDAgkbe2TYPqcnw4GAWabqkZCax2ihRGPe9LZnsPdIUIHA==} + engines: {node: '>=18.0.0'} - '@smithy/util-uri-escape@3.0.0': - resolution: {integrity: sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==} - engines: {node: '>=16.0.0'} + '@smithy/util-uri-escape@4.0.0': + resolution: {integrity: sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==} + engines: {node: '>=18.0.0'} '@smithy/util-utf8@2.3.0': resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} engines: {node: '>=14.0.0'} - '@smithy/util-utf8@3.0.0': - resolution: {integrity: sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==} - engines: {node: '>=16.0.0'} + '@smithy/util-utf8@4.0.0': + resolution: {integrity: sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==} + engines: {node: '>=18.0.0'} - '@smithy/util-waiter@3.2.0': - resolution: {integrity: sha512-PpjSboaDUE6yl+1qlg3Si57++e84oXdWGbuFUSAciXsVfEZJJJupR2Nb0QuXHiunt2vGR+1PTizOMvnUPaG2Qg==} - engines: {node: '>=16.0.0'} + '@smithy/util-waiter@4.0.2': + resolution: {integrity: sha512-piUTHyp2Axx3p/kc2CIJkYSv0BAaheBQmbACZgQSSfWUumWNW+R1lL+H9PDBxKJkvOeEX+hKYEFiwO8xagL8AQ==} + engines: {node: '>=18.0.0'} - '@swc/core-darwin-arm64@1.10.1': - resolution: {integrity: sha512-NyELPp8EsVZtxH/mEqvzSyWpfPJ1lugpTQcSlMduZLj1EASLO4sC8wt8hmL1aizRlsbjCX+r0PyL+l0xQ64/6Q==} + '@swc/core-darwin-arm64@1.10.8': + resolution: {integrity: sha512-FtacTu9zS5YuepujQqujveNw8BQ8ESJ+pN1Z7C+WrKCHlCl+5dh0n6gMAlEj+3iRvY6UAYqkzTVeiX/bOMoJKA==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.10.1': - resolution: {integrity: sha512-L4BNt1fdQ5ZZhAk5qoDfUnXRabDOXKnXBxMDJ+PWLSxOGBbWE6aJTnu4zbGjJvtot0KM46m2LPAPY8ttknqaZA==} + '@swc/core-darwin-x64@1.10.8': + resolution: {integrity: sha512-nfk+iq7EKQwADaCERzZLSi9ovzjJcqDWaO4e2ztyCNaLFi6fP1m6+ij21aki5KAd8AXoY4fue4Mo2fuYbesX9Q==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.10.1': - resolution: {integrity: sha512-Y1u9OqCHgvVp2tYQAJ7hcU9qO5brDMIrA5R31rwWQIAKDkJKtv3IlTHF0hrbWk1wPR0ZdngkQSJZple7G+Grvw==} + '@swc/core-linux-arm-gnueabihf@1.10.8': + resolution: {integrity: sha512-CL2zfbnrEc6nIiWbgshOz0mjn/zY8JcYqO12vGcTxmZOrh0n+mmHN2ejX91pYWQnQDtbhCmFTaEndExFpA7Gww==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.10.1': - resolution: {integrity: sha512-tNQHO/UKdtnqjc7o04iRXng1wTUXPgVd8Y6LI4qIbHVoVPwksZydISjMcilKNLKIwOoUQAkxyJ16SlOAeADzhQ==} + '@swc/core-linux-arm64-gnu@1.10.8': + resolution: {integrity: sha512-quS8F18DDScW3B7qnbWkz95abZ5p0xp/W8N498NAAls/YQj4jQIlf8WlAWoxVVjY/SmSus5kN5tuwhHD8t0NPw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.10.1': - resolution: {integrity: sha512-x0L2Pd9weQ6n8dI1z1Isq00VHFvpBClwQJvrt3NHzmR+1wCT/gcYl1tp9P5xHh3ldM8Cn4UjWCw+7PaUgg8FcQ==} + '@swc/core-linux-arm64-musl@1.10.8': + resolution: {integrity: sha512-wI0Hny8fHbBK/OjJ7eFYP0uDKiCMMMr5OBWGKMRRUvWs2zlGeJQZbwUeCnWuLLXzDfL+feMfh5TieYlqKTTtRw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.10.1': - resolution: {integrity: sha512-yyYEwQcObV3AUsC79rSzN9z6kiWxKAVJ6Ntwq2N9YoZqSPYph+4/Am5fM1xEQYf/kb99csj0FgOelomJSobxQA==} + '@swc/core-linux-x64-gnu@1.10.8': + resolution: {integrity: sha512-24FCRUFO8gzPP2eu3soHTm3lk+ktcsIhdM2DTOlXGA+2TBYFWgAZX/yZV+eeRrtIZYSr4OcOWsNWnQ5Ma4budA==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.10.1': - resolution: {integrity: sha512-tcaS43Ydd7Fk7sW5ROpaf2Kq1zR+sI5K0RM+0qYLYYurvsJruj3GhBCaiN3gkzd8m/8wkqNqtVklWaQYSDsyqA==} + '@swc/core-linux-x64-musl@1.10.8': + resolution: {integrity: sha512-mBo7M/FmUhoWpUG17MLbS98iRA7t6ThxQBWDJZd322whkN1GqrvumYm2wvvjmoMTeDOPwAL3hIIa5H+Q4vb1zA==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.10.1': - resolution: {integrity: sha512-D3Qo1voA7AkbOzQ2UGuKNHfYGKL6eejN8VWOoQYtGHHQi1p5KK/Q7V1ku55oxXBsj79Ny5FRMqiRJpVGad7bjQ==} + '@swc/core-win32-arm64-msvc@1.10.8': + resolution: {integrity: sha512-rXJ9y77JZZXoZkgFR0mObKa3TethRBJ6Exs/pwhScl9pz4qsfxhj/bQbEu1g1i/ihmd0l+IKZwGSC7Ibh3HA2Q==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.10.1': - resolution: {integrity: sha512-WalYdFoU3454Og+sDKHM1MrjvxUGwA2oralknXkXL8S0I/8RkWZOB++p3pLaGbTvOO++T+6znFbQdR8KRaa7DA==} + '@swc/core-win32-ia32-msvc@1.10.8': + resolution: {integrity: sha512-n6ekYFJEBPvTpRIqJiu6EHXVzVnuCtDTpFnn/0KVGJI1yQHriGVEovnb/+qyLh8Rwx2AZM9qgZVgMhVtfcFQJg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.10.1': - resolution: {integrity: sha512-JWobfQDbTnoqaIwPKQ3DVSywihVXlQMbDuwik/dDWlj33A8oEHcjPOGs4OqcA3RHv24i+lfCQpM3Mn4FAMfacA==} + '@swc/core-win32-x64-msvc@1.10.8': + resolution: {integrity: sha512-vplXxtH/lFc/epELnAyvdCvqlDJrM+OKtkphYcbPqq50g/dEZYZ8FYHU5Df9Uo19UooWSo1LaxPk4R7n6i1Axw==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.10.1': - resolution: {integrity: sha512-rQ4dS6GAdmtzKiCRt3LFVxl37FaY1cgL9kSUTnhQ2xc3fmHOd7jdJK/V4pSZMG1ruGTd0bsi34O2R0Olg9Zo/w==} + '@swc/core@1.10.8': + resolution: {integrity: sha512-I3G+n9qbHNu6KNraaAG1+Z1S1x5S7MGRA6OEppT8Pt3Z9uD5a/kYAGU33eXy7zY+BoKuKA2X1H0r4vSimAgU8w==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -3497,17 +3454,14 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node-forge@1.3.11': - resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} - '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@22.10.1': - resolution: {integrity: sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==} + '@types/node@22.10.5': + resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} - '@types/node@22.10.2': - resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/node@22.10.7': + resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==} '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} @@ -3533,6 +3487,9 @@ packages: '@types/react@18.3.12': resolution: {integrity: sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==} + '@types/react@19.0.7': + resolution: {integrity: sha512-MoFsEJKkAtZCrC1r6CM8U22GzhG7u2Wir8ons/aCKH6MBdD1ibV24zOSSkdZVUKqN5i396zG5VKLYZ3yaUZdLA==} + '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -3943,8 +3900,8 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - better-sqlite3@11.7.0: - resolution: {integrity: sha512-mXpa5jnIKKHeoGzBrUJrc65cXFKcILGZpU3FXR0pradUEm9MA7UZz02qfEejaMcm9iXrSOCenwwYMJ/tZ1y5Ig==} + better-sqlite3@11.8.1: + resolution: {integrity: sha512-9BxNaBkblMjhJW8sMRZxnxVTRgbRmssZW0Oxc1MPBTfiR+WW21e2Mk4qu8CzrcZb1LwPCnFsfDEzq+SNcBU8eg==} bindings@1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} @@ -4061,10 +4018,6 @@ packages: chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - chokidar@4.0.1: - resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} - engines: {node: '>= 14.16.0'} - chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} @@ -4164,6 +4117,9 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} @@ -4300,9 +4256,6 @@ packages: dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} - date-fns@4.1.0: - resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} - debounce@1.2.1: resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} @@ -4482,12 +4435,12 @@ packages: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} - drizzle-kit@0.30.1: - resolution: {integrity: sha512-HmA/NeewvHywhJ2ENXD3KvOuM/+K2dGLJfxVfIHsGwaqKICJnS+Ke2L6UcSrSrtMJLJaT0Im1Qv4TFXfaZShyw==} + drizzle-kit@0.30.2: + resolution: {integrity: sha512-vhdLrxWA32WNVF77NabpSnX7pQBornx64VDQDmKddRonOB2Xe/yY4glQ7rECoa+ogqcQNo7VblLUbeBK6Zn9Ow==} hasBin: true - drizzle-orm@0.38.2: - resolution: {integrity: sha512-eCE3yPRAskLo1WpM9OHpFaM70tBEDsWhwR/0M3CKyztAXKR9Qs3asZlcJOEliIcUSg8GuwrlY0dmYDgmm6y5GQ==} + drizzle-orm@0.38.4: + resolution: {integrity: sha512-s7/5BpLKO+WJRHspvpqTydxFob8i1vo2rEx4pY6TGY7QSMuUfWUuzaY0DIpXCkgHOo37BaFC+SJQb99dDUXT3Q==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' '@cloudflare/workers-types': '>=4' @@ -4785,8 +4738,8 @@ packages: peerDependencies: eslint: '>=0.8.0' - eslint-plugin-jest@28.9.0: - resolution: {integrity: sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==} + eslint-plugin-jest@28.11.0: + resolution: {integrity: sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -4810,8 +4763,8 @@ packages: peerDependencies: eslint: '>=5.16.0' - eslint-plugin-prettier@5.2.1: - resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + eslint-plugin-prettier@5.2.3: + resolution: {integrity: sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -5568,8 +5521,8 @@ packages: isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - isbot@5.1.18: - resolution: {integrity: sha512-df9RdChv1DheItzN5pNKtblc9/otzJYmxjf9GhCZG/f0TCcGCbQFmtM3e+SD0e8EI3/O2tIXPYVaG4FUaIIa6Q==} + isbot@5.1.21: + resolution: {integrity: sha512-0q3naRVpENL0ReKHeNcwn/G7BDynp0DqZUckKyFtM9+hmpnPqgm8+8wbjiVZ0XNhq1wPQV28/Pb8Snh5adeUHA==} engines: {node: '>=18'} isexe@2.0.0: @@ -5607,9 +5560,6 @@ packages: iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} - itty-time@1.0.6: - resolution: {integrity: sha512-+P8IZaLLBtFv8hCkIjcymZOp4UJ+xW6bSlQsXGqrkmJh7vSiMFSlNne0mCYagEE0N7HDNR5jJBRxwN0oYv61Rw==} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -6103,8 +6053,8 @@ packages: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} - miniflare@3.20241205.0: - resolution: {integrity: sha512-Z0cTtIf6ZrcAJ3SrOI9EUM3s4dkGhNeU6Ubl8sroYhsPVD+rtz3m5+p6McHFWCkcMff1o60X5XEKVTmkz0gbpA==} + miniflare@3.20241230.2: + resolution: {integrity: sha512-gFC3IaUKrLGdtA6y6PLpC/QE5YAjB5ITCfBZHkosRyFZ9ApaCHKcHRvrEFMc/R19QxxtHD+G3tExEHp7MmtsYQ==} engines: {node: '>=16.13'} hasBin: true @@ -6166,6 +6116,9 @@ packages: engines: {node: '>=10'} hasBin: true + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + mnemonist@0.38.3: resolution: {integrity: sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw==} @@ -6223,19 +6176,14 @@ packages: mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} - mysql2@3.11.5: - resolution: {integrity: sha512-0XFu8rUmFN9vC0ME36iBvCUObftiMHItrYFhlCRvFWbLgpNqtC4Br/NmZX1HNCszxT0GGy5QtP+k3Q3eCJPaYA==} + mysql2@3.12.0: + resolution: {integrity: sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==} engines: {node: '>= 8.0'} named-placeholders@1.1.3: resolution: {integrity: sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==} engines: {node: '>=12.0.0'} - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} @@ -6249,8 +6197,8 @@ packages: no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} - node-abi@3.71.0: - resolution: {integrity: sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==} + node-abi@3.73.0: + resolution: {integrity: sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg==} engines: {node: '>=10'} node-addon-api@7.1.1: @@ -6265,10 +6213,6 @@ packages: encoding: optional: true - node-forge@1.3.1: - resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} - engines: {node: '>= 6.13.0'} - node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} @@ -6503,6 +6447,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathe@2.0.2: + resolution: {integrity: sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==} + pg-cloudflare@1.1.1: resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} @@ -6575,6 +6522,9 @@ packages: resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} engines: {node: '>=10'} + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} @@ -6652,9 +6602,9 @@ packages: printable-characters@1.0.42: resolution: {integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==} - prisma@5.22.0: - resolution: {integrity: sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==} - engines: {node: '>=16.13'} + prisma@6.2.1: + resolution: {integrity: sha512-hhyM0H13pQleQ+br4CkzGizS5I0oInoeTw3JfLw1BRZduBSQxPILlJLwi+46wZzj9Je7ndyQEMGw/n5cN2fknA==} + engines: {node: '>=18.18'} hasBin: true promise-inflight@1.0.1: @@ -6750,15 +6700,15 @@ packages: peerDependencies: react: ^18.1.0 - react-router-dom@6.26.1: - resolution: {integrity: sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==} + react-router-dom@6.28.1: + resolution: {integrity: sha512-YraE27C/RdjcZwl5UCqF/ffXnZDxpJdk9Q6jw38SZHjXs7NNdpViq2l2c7fO7+4uWaEfcwfGCv3RSg4e1By/fQ==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' - react-router@6.26.1: - resolution: {integrity: sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==} + react-router@6.28.1: + resolution: {integrity: sha512-2omQTA3rkMljmrvvo6WtewGdVh45SpL9hGiCI9uUrwGGfNFDIvGK4gYJsKlJoNVi6AQZcopSCballL+QGOm7fA==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' @@ -6781,10 +6731,6 @@ packages: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} - readdirp@4.0.2: - resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} - engines: {node: '>= 14.16.0'} - redis@4.7.0: resolution: {integrity: sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==} @@ -6926,8 +6872,8 @@ packages: rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} - rollup@4.28.1: - resolution: {integrity: sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==} + rollup@4.31.0: + resolution: {integrity: sha512-9cCE8P4rZLx9+PjoyqHLs31V9a9Vpvfo4qNcs6JCiGWYhw2gijSetFbH6SSy1whnkgcefnUwr8sad7tgqsGvnw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -6968,10 +6914,6 @@ packages: scuid@1.1.0: resolution: {integrity: sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg==} - selfsigned@2.4.1: - resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} - engines: {node: '>=10'} - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -7260,12 +7202,12 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - synckit@0.9.1: - resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} + synckit@0.9.2: + resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} engines: {node: ^14.18.0 || >=16.0.0} - tar-fs@2.1.1: - resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + tar-fs@2.1.2: + resolution: {integrity: sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==} tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} @@ -7419,9 +7361,6 @@ packages: cpu: [arm64] os: [linux] - turbo-stream@2.3.0: - resolution: {integrity: sha512-PhEr9mdexoVv+rJkQ3c8TjrN3DUghX37GNJkSMksoPR4KrXIPnM2MnqRt07sViIqX9IdlhrgtTSyjoVOASq6cg==} - turbo-stream@2.4.0: resolution: {integrity: sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==} @@ -7479,13 +7418,13 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.7.2: + resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} hasBin: true - typescript@5.7.2: - resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} + typescript@5.7.3: + resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} engines: {node: '>=14.17'} hasBin: true @@ -7513,8 +7452,8 @@ packages: resolution: {integrity: sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==} engines: {node: '>=18.17'} - unenv-nightly@2.0.0-20241204-140205-a5d5190: - resolution: {integrity: sha512-jpmAytLeiiW01pl5bhVn9wYJ4vtiLdhGe10oXlJBuQEX8mxjxO8BlEXGHU4vr4yEikjFP1wsomTHt/CLU8kUwg==} + unenv-nightly@2.0.0-20250109-100802-88ad671: + resolution: {integrity: sha512-Uij6gODNNNNsNBoDlnaMvZI99I6YlVJLRfYH8AOLMlbFrW7k2w872v9VLuIdch2vF8QBeSC4EftIh5sG4ibzdA==} unicode-canonical-property-names-ecmascript@2.0.1: resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} @@ -7588,8 +7527,8 @@ packages: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} - uuid@10.0.0: - resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + uuid@11.0.5: + resolution: {integrity: sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==} hasBin: true uuid@9.0.1: @@ -7632,8 +7571,8 @@ packages: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} - web-streams-polyfill@4.0.0: - resolution: {integrity: sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==} + web-streams-polyfill@4.1.0: + resolution: {integrity: sha512-A7Jxrg7+eV+eZR/CIdESDnRGFb6/bcKukGvJBB5snI6cw3is1c2qamkYstC1bY1p08TyMRlN9eTMkxmnKJBPBw==} engines: {node: '>= 8'} webidl-conversions@3.0.1: @@ -7692,17 +7631,17 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - workerd@1.20241205.0: - resolution: {integrity: sha512-vso/2n0c5SdBDWiD+Sx5gM7unA6SiZXRVUHDqH1euoP/9mFVHZF8icoYsNLB87b/TX8zNgpae+I5N/xFpd9v0g==} + workerd@1.20241230.0: + resolution: {integrity: sha512-EgixXP0JGXGq6J9lz17TKIZtfNDUvJNG+cl9paPMfZuYWT920fFpBx+K04YmnbQRLnglsivF1GT9pxh1yrlWhg==} engines: {node: '>=16'} hasBin: true - wrangler@3.96.0: - resolution: {integrity: sha512-KjbHTUnwTa5eKl3hzv2h6nHBfAsbUkdurL7f6Y288/Bdn6tcEis13jLVR/nw/eWa3tNCBG1xOMZJboUyzWcC1g==} + wrangler@3.103.2: + resolution: {integrity: sha512-eYcnubPhPBU1QMZYTam+vfCLpaQx+x1EWA6nFbLhid1eqNDAk1dNwNlbo+ZryrOHDEX3XlOxn2Z3Fx8vVv3hKw==} engines: {node: '>=16.17.0'} hasBin: true peerDependencies: - '@cloudflare/workers-types': ^4.20241205.0 + '@cloudflare/workers-types': ^4.20241230.0 peerDependenciesMeta: '@cloudflare/workers-types': optional: true @@ -7749,9 +7688,6 @@ packages: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} - xxhash-wasm@1.0.2: - resolution: {integrity: sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==} - y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} @@ -7849,15 +7785,15 @@ snapshots: '@aws-crypto/sha256-js': 5.2.0 '@aws-crypto/supports-web-crypto': 5.2.0 '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-locate-window': 3.693.0 + '@aws-sdk/types': 3.731.0 + '@aws-sdk/util-locate-window': 3.723.0 '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 '@aws-crypto/sha256-js@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.714.0 + '@aws-sdk/types': 3.731.0 tslib: 2.8.1 '@aws-crypto/supports-web-crypto@5.2.0': @@ -7866,394 +7802,345 @@ snapshots: '@aws-crypto/util@5.2.0': dependencies: - '@aws-sdk/types': 3.714.0 + '@aws-sdk/types': 3.731.0 '@smithy/util-utf8': 2.3.0 tslib: 2.8.1 - '@aws-sdk/client-dynamodb@3.714.0': + '@aws-sdk/client-dynamodb@3.731.1': dependencies: '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/client-sso-oidc': 3.714.0(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/client-sts': 3.714.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/credential-provider-node': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/middleware-endpoint-discovery': 3.714.0 - '@aws-sdk/middleware-host-header': 3.714.0 - '@aws-sdk/middleware-logger': 3.714.0 - '@aws-sdk/middleware-recursion-detection': 3.714.0 - '@aws-sdk/middleware-user-agent': 3.714.0 - '@aws-sdk/region-config-resolver': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-endpoints': 3.714.0 - '@aws-sdk/util-user-agent-browser': 3.714.0 - '@aws-sdk/util-user-agent-node': 3.714.0 - '@smithy/config-resolver': 3.0.13 - '@smithy/core': 2.5.5 - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/hash-node': 3.0.11 - '@smithy/invalid-dependency': 3.0.11 - '@smithy/middleware-content-length': 3.0.13 - '@smithy/middleware-endpoint': 3.2.5 - '@smithy/middleware-retry': 3.0.30 - '@smithy/middleware-serde': 3.0.11 - '@smithy/middleware-stack': 3.0.11 - '@smithy/node-config-provider': 3.1.12 - '@smithy/node-http-handler': 3.3.2 - '@smithy/protocol-http': 4.1.8 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 - '@smithy/util-base64': 3.0.0 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-body-length-node': 3.0.0 - '@smithy/util-defaults-mode-browser': 3.0.30 - '@smithy/util-defaults-mode-node': 3.0.30 - '@smithy/util-endpoints': 2.1.7 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-retry': 3.0.11 - '@smithy/util-utf8': 3.0.0 - '@smithy/util-waiter': 3.2.0 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/credential-provider-node': 3.731.1 + '@aws-sdk/middleware-endpoint-discovery': 3.731.0 + '@aws-sdk/middleware-host-header': 3.731.0 + '@aws-sdk/middleware-logger': 3.731.0 + '@aws-sdk/middleware-recursion-detection': 3.731.0 + '@aws-sdk/middleware-user-agent': 3.731.0 + '@aws-sdk/region-config-resolver': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@aws-sdk/util-endpoints': 3.731.0 + '@aws-sdk/util-user-agent-browser': 3.731.0 + '@aws-sdk/util-user-agent-node': 3.731.0 + '@smithy/config-resolver': 4.0.1 + '@smithy/core': 3.1.1 + '@smithy/fetch-http-handler': 5.0.1 + '@smithy/hash-node': 4.0.1 + '@smithy/invalid-dependency': 4.0.1 + '@smithy/middleware-content-length': 4.0.1 + '@smithy/middleware-endpoint': 4.0.2 + '@smithy/middleware-retry': 4.0.3 + '@smithy/middleware-serde': 4.0.1 + '@smithy/middleware-stack': 4.0.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/node-http-handler': 4.0.2 + '@smithy/protocol-http': 5.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/url-parser': 4.0.1 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.3 + '@smithy/util-defaults-mode-node': 4.0.3 + '@smithy/util-endpoints': 3.0.1 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-retry': 4.0.1 + '@smithy/util-utf8': 4.0.0 + '@smithy/util-waiter': 4.0.2 '@types/uuid': 9.0.8 tslib: 2.8.1 uuid: 9.0.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0)': + '@aws-sdk/client-sso@3.731.0': dependencies: '@aws-crypto/sha256-browser': 5.2.0 '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/client-sts': 3.714.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/credential-provider-node': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/middleware-host-header': 3.714.0 - '@aws-sdk/middleware-logger': 3.714.0 - '@aws-sdk/middleware-recursion-detection': 3.714.0 - '@aws-sdk/middleware-user-agent': 3.714.0 - '@aws-sdk/region-config-resolver': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-endpoints': 3.714.0 - '@aws-sdk/util-user-agent-browser': 3.714.0 - '@aws-sdk/util-user-agent-node': 3.714.0 - '@smithy/config-resolver': 3.0.13 - '@smithy/core': 2.5.5 - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/hash-node': 3.0.11 - '@smithy/invalid-dependency': 3.0.11 - '@smithy/middleware-content-length': 3.0.13 - '@smithy/middleware-endpoint': 3.2.5 - '@smithy/middleware-retry': 3.0.30 - '@smithy/middleware-serde': 3.0.11 - '@smithy/middleware-stack': 3.0.11 - '@smithy/node-config-provider': 3.1.12 - '@smithy/node-http-handler': 3.3.2 - '@smithy/protocol-http': 4.1.8 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 - '@smithy/util-base64': 3.0.0 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-body-length-node': 3.0.0 - '@smithy/util-defaults-mode-browser': 3.0.30 - '@smithy/util-defaults-mode-node': 3.0.30 - '@smithy/util-endpoints': 2.1.7 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-retry': 3.0.11 - '@smithy/util-utf8': 3.0.0 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/middleware-host-header': 3.731.0 + '@aws-sdk/middleware-logger': 3.731.0 + '@aws-sdk/middleware-recursion-detection': 3.731.0 + '@aws-sdk/middleware-user-agent': 3.731.0 + '@aws-sdk/region-config-resolver': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@aws-sdk/util-endpoints': 3.731.0 + '@aws-sdk/util-user-agent-browser': 3.731.0 + '@aws-sdk/util-user-agent-node': 3.731.0 + '@smithy/config-resolver': 4.0.1 + '@smithy/core': 3.1.1 + '@smithy/fetch-http-handler': 5.0.1 + '@smithy/hash-node': 4.0.1 + '@smithy/invalid-dependency': 4.0.1 + '@smithy/middleware-content-length': 4.0.1 + '@smithy/middleware-endpoint': 4.0.2 + '@smithy/middleware-retry': 4.0.3 + '@smithy/middleware-serde': 4.0.1 + '@smithy/middleware-stack': 4.0.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/node-http-handler': 4.0.2 + '@smithy/protocol-http': 5.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/url-parser': 4.0.1 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.3 + '@smithy/util-defaults-mode-node': 4.0.3 + '@smithy/util-endpoints': 3.0.1 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-retry': 4.0.1 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 transitivePeerDependencies: - aws-crt - '@aws-sdk/client-sso@3.714.0': - dependencies: - '@aws-crypto/sha256-browser': 5.2.0 - '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/middleware-host-header': 3.714.0 - '@aws-sdk/middleware-logger': 3.714.0 - '@aws-sdk/middleware-recursion-detection': 3.714.0 - '@aws-sdk/middleware-user-agent': 3.714.0 - '@aws-sdk/region-config-resolver': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-endpoints': 3.714.0 - '@aws-sdk/util-user-agent-browser': 3.714.0 - '@aws-sdk/util-user-agent-node': 3.714.0 - '@smithy/config-resolver': 3.0.13 - '@smithy/core': 2.5.5 - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/hash-node': 3.0.11 - '@smithy/invalid-dependency': 3.0.11 - '@smithy/middleware-content-length': 3.0.13 - '@smithy/middleware-endpoint': 3.2.5 - '@smithy/middleware-retry': 3.0.30 - '@smithy/middleware-serde': 3.0.11 - '@smithy/middleware-stack': 3.0.11 - '@smithy/node-config-provider': 3.1.12 - '@smithy/node-http-handler': 3.3.2 - '@smithy/protocol-http': 4.1.8 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 - '@smithy/util-base64': 3.0.0 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-body-length-node': 3.0.0 - '@smithy/util-defaults-mode-browser': 3.0.30 - '@smithy/util-defaults-mode-node': 3.0.30 - '@smithy/util-endpoints': 2.1.7 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-retry': 3.0.11 - '@smithy/util-utf8': 3.0.0 - tslib: 2.8.1 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/client-sts@3.714.0': - dependencies: - '@aws-crypto/sha256-browser': 5.2.0 - '@aws-crypto/sha256-js': 5.2.0 - '@aws-sdk/client-sso-oidc': 3.714.0(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/core': 3.714.0 - '@aws-sdk/credential-provider-node': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/middleware-host-header': 3.714.0 - '@aws-sdk/middleware-logger': 3.714.0 - '@aws-sdk/middleware-recursion-detection': 3.714.0 - '@aws-sdk/middleware-user-agent': 3.714.0 - '@aws-sdk/region-config-resolver': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-endpoints': 3.714.0 - '@aws-sdk/util-user-agent-browser': 3.714.0 - '@aws-sdk/util-user-agent-node': 3.714.0 - '@smithy/config-resolver': 3.0.13 - '@smithy/core': 2.5.5 - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/hash-node': 3.0.11 - '@smithy/invalid-dependency': 3.0.11 - '@smithy/middleware-content-length': 3.0.13 - '@smithy/middleware-endpoint': 3.2.5 - '@smithy/middleware-retry': 3.0.30 - '@smithy/middleware-serde': 3.0.11 - '@smithy/middleware-stack': 3.0.11 - '@smithy/node-config-provider': 3.1.12 - '@smithy/node-http-handler': 3.3.2 - '@smithy/protocol-http': 4.1.8 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 - '@smithy/util-base64': 3.0.0 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-body-length-node': 3.0.0 - '@smithy/util-defaults-mode-browser': 3.0.30 - '@smithy/util-defaults-mode-node': 3.0.30 - '@smithy/util-endpoints': 2.1.7 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-retry': 3.0.11 - '@smithy/util-utf8': 3.0.0 - tslib: 2.8.1 - transitivePeerDependencies: - - aws-crt - - '@aws-sdk/core@3.714.0': - dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/core': 2.5.5 - '@smithy/node-config-provider': 3.1.12 - '@smithy/property-provider': 3.1.11 - '@smithy/protocol-http': 4.1.8 - '@smithy/signature-v4': 4.2.4 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/util-middleware': 3.0.11 + '@aws-sdk/core@3.731.0': + dependencies: + '@aws-sdk/types': 3.731.0 + '@smithy/core': 3.1.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/property-provider': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/signature-v4': 5.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/util-middleware': 4.0.1 fast-xml-parser: 4.4.1 tslib: 2.8.1 - '@aws-sdk/credential-provider-env@3.714.0': + '@aws-sdk/credential-provider-env@3.731.0': dependencies: - '@aws-sdk/core': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@smithy/property-provider': 3.1.11 - '@smithy/types': 3.7.2 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@smithy/property-provider': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-http@3.714.0': - dependencies: - '@aws-sdk/core': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/node-http-handler': 3.3.2 - '@smithy/property-provider': 3.1.11 - '@smithy/protocol-http': 4.1.8 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/util-stream': 3.3.2 + '@aws-sdk/credential-provider-http@3.731.0': + dependencies: + '@aws-sdk/core': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@smithy/fetch-http-handler': 5.0.1 + '@smithy/node-http-handler': 4.0.2 + '@smithy/property-provider': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/util-stream': 4.0.2 tslib: 2.8.1 - '@aws-sdk/credential-provider-ini@3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0)': - dependencies: - '@aws-sdk/client-sts': 3.714.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/credential-provider-env': 3.714.0 - '@aws-sdk/credential-provider-http': 3.714.0 - '@aws-sdk/credential-provider-process': 3.714.0 - '@aws-sdk/credential-provider-sso': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0)) - '@aws-sdk/credential-provider-web-identity': 3.714.0(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/types': 3.714.0 - '@smithy/credential-provider-imds': 3.2.8 - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/credential-provider-ini@3.731.1': + dependencies: + '@aws-sdk/core': 3.731.0 + '@aws-sdk/credential-provider-env': 3.731.0 + '@aws-sdk/credential-provider-http': 3.731.0 + '@aws-sdk/credential-provider-process': 3.731.0 + '@aws-sdk/credential-provider-sso': 3.731.1 + '@aws-sdk/credential-provider-web-identity': 3.731.1 + '@aws-sdk/nested-clients': 3.731.1 + '@aws-sdk/types': 3.731.0 + '@smithy/credential-provider-imds': 4.0.1 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-node@3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0)': - dependencies: - '@aws-sdk/credential-provider-env': 3.714.0 - '@aws-sdk/credential-provider-http': 3.714.0 - '@aws-sdk/credential-provider-ini': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/credential-provider-process': 3.714.0 - '@aws-sdk/credential-provider-sso': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0)) - '@aws-sdk/credential-provider-web-identity': 3.714.0(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/types': 3.714.0 - '@smithy/credential-provider-imds': 3.2.8 - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/credential-provider-node@3.731.1': + dependencies: + '@aws-sdk/credential-provider-env': 3.731.0 + '@aws-sdk/credential-provider-http': 3.731.0 + '@aws-sdk/credential-provider-ini': 3.731.1 + '@aws-sdk/credential-provider-process': 3.731.0 + '@aws-sdk/credential-provider-sso': 3.731.1 + '@aws-sdk/credential-provider-web-identity': 3.731.1 + '@aws-sdk/types': 3.731.0 + '@smithy/credential-provider-imds': 4.0.1 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - '@aws-sdk/client-sts' - aws-crt - '@aws-sdk/credential-provider-process@3.714.0': + '@aws-sdk/credential-provider-process@3.731.0': dependencies: - '@aws-sdk/core': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-sso@3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))': + '@aws-sdk/credential-provider-sso@3.731.1': dependencies: - '@aws-sdk/client-sso': 3.714.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/token-providers': 3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0)) - '@aws-sdk/types': 3.714.0 - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/client-sso': 3.731.0 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/token-providers': 3.731.1 + '@aws-sdk/types': 3.731.0 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-web-identity@3.714.0(@aws-sdk/client-sts@3.714.0)': + '@aws-sdk/credential-provider-web-identity@3.731.1': dependencies: - '@aws-sdk/client-sts': 3.714.0 - '@aws-sdk/core': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@smithy/property-provider': 3.1.11 - '@smithy/types': 3.7.2 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/nested-clients': 3.731.1 + '@aws-sdk/types': 3.731.0 + '@smithy/property-provider': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt - '@aws-sdk/endpoint-cache@3.693.0': + '@aws-sdk/endpoint-cache@3.723.0': dependencies: mnemonist: 0.38.3 tslib: 2.8.1 - '@aws-sdk/middleware-endpoint-discovery@3.714.0': + '@aws-sdk/middleware-endpoint-discovery@3.731.0': dependencies: - '@aws-sdk/endpoint-cache': 3.693.0 - '@aws-sdk/types': 3.714.0 - '@smithy/node-config-provider': 3.1.12 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 + '@aws-sdk/endpoint-cache': 3.723.0 + '@aws-sdk/types': 3.731.0 + '@smithy/node-config-provider': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/middleware-host-header@3.714.0': + '@aws-sdk/middleware-host-header@3.731.0': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 + '@aws-sdk/types': 3.731.0 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/middleware-logger@3.714.0': + '@aws-sdk/middleware-logger@3.731.0': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/types': 3.7.2 + '@aws-sdk/types': 3.731.0 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/middleware-recursion-detection@3.714.0': + '@aws-sdk/middleware-recursion-detection@3.731.0': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 + '@aws-sdk/types': 3.731.0 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/middleware-user-agent@3.714.0': + '@aws-sdk/middleware-user-agent@3.731.0': dependencies: - '@aws-sdk/core': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@aws-sdk/util-endpoints': 3.714.0 - '@smithy/core': 2.5.5 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@aws-sdk/util-endpoints': 3.731.0 + '@smithy/core': 3.1.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/region-config-resolver@3.714.0': + '@aws-sdk/nested-clients@3.731.1': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/node-config-provider': 3.1.12 - '@smithy/types': 3.7.2 - '@smithy/util-config-provider': 3.0.0 - '@smithy/util-middleware': 3.0.11 + '@aws-crypto/sha256-browser': 5.2.0 + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/core': 3.731.0 + '@aws-sdk/middleware-host-header': 3.731.0 + '@aws-sdk/middleware-logger': 3.731.0 + '@aws-sdk/middleware-recursion-detection': 3.731.0 + '@aws-sdk/middleware-user-agent': 3.731.0 + '@aws-sdk/region-config-resolver': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@aws-sdk/util-endpoints': 3.731.0 + '@aws-sdk/util-user-agent-browser': 3.731.0 + '@aws-sdk/util-user-agent-node': 3.731.0 + '@smithy/config-resolver': 4.0.1 + '@smithy/core': 3.1.1 + '@smithy/fetch-http-handler': 5.0.1 + '@smithy/hash-node': 4.0.1 + '@smithy/invalid-dependency': 4.0.1 + '@smithy/middleware-content-length': 4.0.1 + '@smithy/middleware-endpoint': 4.0.2 + '@smithy/middleware-retry': 4.0.3 + '@smithy/middleware-serde': 4.0.1 + '@smithy/middleware-stack': 4.0.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/node-http-handler': 4.0.2 + '@smithy/protocol-http': 5.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/url-parser': 4.0.1 + '@smithy/util-base64': 4.0.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-body-length-node': 4.0.0 + '@smithy/util-defaults-mode-browser': 4.0.3 + '@smithy/util-defaults-mode-node': 4.0.3 + '@smithy/util-endpoints': 3.0.1 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-retry': 4.0.1 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt - '@aws-sdk/token-providers@3.714.0(@aws-sdk/client-sso-oidc@3.714.0(@aws-sdk/client-sts@3.714.0))': + '@aws-sdk/region-config-resolver@3.731.0': dependencies: - '@aws-sdk/client-sso-oidc': 3.714.0(@aws-sdk/client-sts@3.714.0) - '@aws-sdk/types': 3.714.0 - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/types': 3.731.0 + '@smithy/node-config-provider': 4.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-config-provider': 4.0.0 + '@smithy/util-middleware': 4.0.1 tslib: 2.8.1 - '@aws-sdk/types@3.714.0': + '@aws-sdk/token-providers@3.731.1': dependencies: - '@smithy/types': 3.7.2 + '@aws-sdk/nested-clients': 3.731.1 + '@aws-sdk/types': 3.731.0 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 + transitivePeerDependencies: + - aws-crt - '@aws-sdk/util-dynamodb@3.714.0(@aws-sdk/client-dynamodb@3.714.0)': + '@aws-sdk/types@3.731.0': dependencies: - '@aws-sdk/client-dynamodb': 3.714.0 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@aws-sdk/util-endpoints@3.714.0': + '@aws-sdk/util-dynamodb@3.731.1(@aws-sdk/client-dynamodb@3.731.1)': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/types': 3.7.2 - '@smithy/util-endpoints': 2.1.7 + '@aws-sdk/client-dynamodb': 3.731.1 tslib: 2.8.1 - '@aws-sdk/util-locate-window@3.693.0': + '@aws-sdk/util-endpoints@3.731.0': dependencies: + '@aws-sdk/types': 3.731.0 + '@smithy/types': 4.1.0 + '@smithy/util-endpoints': 3.0.1 tslib: 2.8.1 - '@aws-sdk/util-user-agent-browser@3.714.0': + '@aws-sdk/util-locate-window@3.723.0': dependencies: - '@aws-sdk/types': 3.714.0 - '@smithy/types': 3.7.2 + tslib: 2.8.1 + + '@aws-sdk/util-user-agent-browser@3.731.0': + dependencies: + '@aws-sdk/types': 3.731.0 + '@smithy/types': 4.1.0 bowser: 2.11.0 tslib: 2.8.1 - '@aws-sdk/util-user-agent-node@3.714.0': + '@aws-sdk/util-user-agent-node@3.731.0': dependencies: - '@aws-sdk/middleware-user-agent': 3.714.0 - '@aws-sdk/types': 3.714.0 - '@smithy/node-config-provider': 3.1.12 - '@smithy/types': 3.7.2 + '@aws-sdk/middleware-user-agent': 3.731.0 + '@aws-sdk/types': 3.731.0 + '@smithy/node-config-provider': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 '@babel/code-frame@7.24.7': @@ -9669,22 +9556,22 @@ snapshots: dependencies: mime: 3.0.0 - '@cloudflare/workerd-darwin-64@1.20241205.0': + '@cloudflare/workerd-darwin-64@1.20241230.0': optional: true - '@cloudflare/workerd-darwin-arm64@1.20241205.0': + '@cloudflare/workerd-darwin-arm64@1.20241230.0': optional: true - '@cloudflare/workerd-linux-64@1.20241205.0': + '@cloudflare/workerd-linux-64@1.20241230.0': optional: true - '@cloudflare/workerd-linux-arm64@1.20241205.0': + '@cloudflare/workerd-linux-arm64@1.20241230.0': optional: true - '@cloudflare/workerd-windows-64@1.20241205.0': + '@cloudflare/workerd-windows-64@1.20241230.0': optional: true - '@cloudflare/workers-types@4.20241218.0': {} + '@cloudflare/workers-types@4.20250109.0': {} '@cspotcode/source-map-support@0.8.1': dependencies: @@ -9952,7 +9839,7 @@ snapshots: graphql: 16.10.0 tslib: 2.6.3 - '@graphql-codegen/cli@5.0.3(@parcel/watcher@2.5.0)(@types/node@22.10.2)(encoding@0.1.13)(enquirer@2.4.1)(graphql@16.10.0)(typescript@5.7.2)': + '@graphql-codegen/cli@5.0.3(@parcel/watcher@2.5.0)(@types/node@22.10.7)(encoding@0.1.13)(enquirer@2.4.1)(graphql@16.10.0)(typescript@5.7.3)': dependencies: '@babel/generator': 7.25.9 '@babel/template': 7.25.9 @@ -9963,20 +9850,20 @@ snapshots: '@graphql-tools/apollo-engine-loader': 8.0.1(encoding@0.1.13)(graphql@16.10.0) '@graphql-tools/code-file-loader': 8.1.3(graphql@16.10.0) '@graphql-tools/git-loader': 8.0.7(graphql@16.10.0) - '@graphql-tools/github-loader': 8.0.1(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0) + '@graphql-tools/github-loader': 8.0.1(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0) '@graphql-tools/graphql-file-loader': 8.0.1(graphql@16.10.0) '@graphql-tools/json-file-loader': 8.0.1(graphql@16.10.0) '@graphql-tools/load': 8.0.2(graphql@16.10.0) - '@graphql-tools/prisma-loader': 8.0.4(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0) - '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0) + '@graphql-tools/prisma-loader': 8.0.4(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0) + '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0) '@graphql-tools/utils': 10.5.4(graphql@16.10.0) '@whatwg-node/fetch': 0.9.20 chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.7.2) + cosmiconfig: 8.3.6(typescript@5.7.3) debounce: 1.2.1 detect-indent: 6.1.0 graphql: 16.10.0 - graphql-config: 5.1.3(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.2) + graphql-config: 5.1.3(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.3) inquirer: 8.2.6 is-glob: 4.0.3 jiti: 1.21.6 @@ -10244,14 +10131,14 @@ snapshots: - bufferutil - utf-8-validate - '@graphql-tools/executor-http@1.1.5(@types/node@22.10.2)(graphql@16.10.0)': + '@graphql-tools/executor-http@1.1.5(@types/node@22.10.7)(graphql@16.10.0)': dependencies: '@graphql-tools/utils': 10.5.6(graphql@16.10.0) '@repeaterjs/repeater': 3.0.6 '@whatwg-node/fetch': 0.9.20 extract-files: 11.0.0 graphql: 16.10.0 - meros: 1.3.0(@types/node@22.10.2) + meros: 1.3.0(@types/node@22.10.7) tslib: 2.8.1 value-or-promise: 1.0.12 transitivePeerDependencies: @@ -10290,10 +10177,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@graphql-tools/github-loader@8.0.1(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)': + '@graphql-tools/github-loader@8.0.1(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)': dependencies: '@ardatan/sync-fetch': 0.0.1(encoding@0.1.13) - '@graphql-tools/executor-http': 1.1.5(@types/node@22.10.2)(graphql@16.10.0) + '@graphql-tools/executor-http': 1.1.5(@types/node@22.10.7)(graphql@16.10.0) '@graphql-tools/graphql-tag-pluck': 8.3.2(graphql@16.10.0) '@graphql-tools/utils': 10.5.4(graphql@16.10.0) '@whatwg-node/fetch': 0.9.20 @@ -10361,9 +10248,9 @@ snapshots: graphql: 16.10.0 tslib: 2.8.1 - '@graphql-tools/prisma-loader@8.0.4(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)': + '@graphql-tools/prisma-loader@8.0.4(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)': dependencies: - '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0) + '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0) '@graphql-tools/utils': 10.5.4(graphql@16.10.0) '@types/js-yaml': 4.0.9 '@whatwg-node/fetch': 0.9.20 @@ -10415,12 +10302,12 @@ snapshots: tslib: 2.8.1 value-or-promise: 1.0.12 - '@graphql-tools/url-loader@8.0.2(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)': + '@graphql-tools/url-loader@8.0.2(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)': dependencies: '@ardatan/sync-fetch': 0.0.1(encoding@0.1.13) '@graphql-tools/delegate': 10.0.19(graphql@16.10.0) '@graphql-tools/executor-graphql-ws': 1.2.0(graphql@16.10.0) - '@graphql-tools/executor-http': 1.1.5(@types/node@22.10.2)(graphql@16.10.0) + '@graphql-tools/executor-http': 1.1.5(@types/node@22.10.7)(graphql@16.10.0) '@graphql-tools/executor-legacy-ws': 1.1.0(graphql@16.10.0) '@graphql-tools/utils': 10.5.4(graphql@16.10.0) '@graphql-tools/wrap': 10.0.5(graphql@16.10.0) @@ -10502,27 +10389,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest-config: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -10547,7 +10434,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -10565,7 +10452,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -10587,7 +10474,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -10656,7 +10543,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/yargs': 15.0.19 chalk: 4.1.2 @@ -10665,7 +10552,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.10.2 + '@types/node': 22.10.7 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -10831,7 +10718,7 @@ snapshots: '@miniflare/shared-test-environment@2.14.4': dependencies: - '@cloudflare/workers-types': 4.20241218.0 + '@cloudflare/workers-types': 4.20250109.0 '@miniflare/cache': 2.14.4 '@miniflare/core': 2.14.4 '@miniflare/d1': 2.14.4 @@ -10983,30 +10870,30 @@ snapshots: '@pkgr/core@0.1.1': {} - '@prisma/client@5.22.0(prisma@5.22.0)': + '@prisma/client@6.2.1(prisma@6.2.1)': optionalDependencies: - prisma: 5.22.0 + prisma: 6.2.1 - '@prisma/debug@5.22.0': {} + '@prisma/debug@6.2.1': {} - '@prisma/engines-version@5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2': {} + '@prisma/engines-version@6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69': {} - '@prisma/engines@5.22.0': + '@prisma/engines@6.2.1': dependencies: - '@prisma/debug': 5.22.0 - '@prisma/engines-version': 5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2 - '@prisma/fetch-engine': 5.22.0 - '@prisma/get-platform': 5.22.0 + '@prisma/debug': 6.2.1 + '@prisma/engines-version': 6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69 + '@prisma/fetch-engine': 6.2.1 + '@prisma/get-platform': 6.2.1 - '@prisma/fetch-engine@5.22.0': + '@prisma/fetch-engine@6.2.1': dependencies: - '@prisma/debug': 5.22.0 - '@prisma/engines-version': 5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2 - '@prisma/get-platform': 5.22.0 + '@prisma/debug': 6.2.1 + '@prisma/engines-version': 6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69 + '@prisma/get-platform': 6.2.1 - '@prisma/get-platform@5.22.0': + '@prisma/get-platform@6.2.1': dependencies: - '@prisma/debug': 5.22.0 + '@prisma/debug': 6.2.1 '@redis/bloom@1.2.0(@redis/client@1.6.0)': dependencies: @@ -11034,21 +10921,9 @@ snapshots: dependencies: '@redis/client': 1.6.0 - '@remix-run/node@2.11.2(typescript@5.7.2)': - dependencies: - '@remix-run/server-runtime': 2.11.2(typescript@5.7.2) - '@remix-run/web-fetch': 4.4.2 - '@web3-storage/multipart-parser': 1.0.0 - cookie-signature: 1.2.1 - source-map-support: 0.5.21 - stream-slice: 0.1.2 - undici: 6.19.7 - optionalDependencies: - typescript: 5.7.2 - - '@remix-run/node@2.15.1(typescript@5.7.2)': + '@remix-run/node@2.15.2(typescript@5.7.3)': dependencies: - '@remix-run/server-runtime': 2.15.1(typescript@5.7.2) + '@remix-run/server-runtime': 2.15.2(typescript@5.7.3) '@remix-run/web-fetch': 4.4.2 '@web3-storage/multipart-parser': 1.0.0 cookie-signature: 1.2.1 @@ -11056,51 +10931,23 @@ snapshots: stream-slice: 0.1.2 undici: 6.19.7 optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 - '@remix-run/react@2.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)': + '@remix-run/react@2.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.3)': dependencies: - '@remix-run/router': 1.19.1 - '@remix-run/server-runtime': 2.11.2(typescript@5.7.2) + '@remix-run/router': 1.21.0 + '@remix-run/server-runtime': 2.15.2(typescript@5.7.3) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-router: 6.26.1(react@18.3.1) - react-router-dom: 6.26.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - turbo-stream: 2.3.0 + react-router: 6.28.1(react@18.3.1) + react-router-dom: 6.28.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + turbo-stream: 2.4.0 optionalDependencies: - typescript: 5.7.2 - - '@remix-run/router@1.19.1': {} - - '@remix-run/router@1.19.2': {} + typescript: 5.7.3 '@remix-run/router@1.21.0': {} - '@remix-run/server-runtime@2.11.2(typescript@5.7.2)': - dependencies: - '@remix-run/router': 1.19.1 - '@types/cookie': 0.6.0 - '@web3-storage/multipart-parser': 1.0.0 - cookie: 0.6.0 - set-cookie-parser: 2.7.0 - source-map: 0.7.4 - turbo-stream: 2.3.0 - optionalDependencies: - typescript: 5.7.2 - - '@remix-run/server-runtime@2.12.1(typescript@5.7.2)': - dependencies: - '@remix-run/router': 1.19.2 - '@types/cookie': 0.6.0 - '@web3-storage/multipart-parser': 1.0.0 - cookie: 0.6.0 - set-cookie-parser: 2.7.0 - source-map: 0.7.4 - turbo-stream: 2.4.0 - optionalDependencies: - typescript: 5.7.2 - - '@remix-run/server-runtime@2.15.1(typescript@5.7.2)': + '@remix-run/server-runtime@2.15.2(typescript@5.7.3)': dependencies: '@remix-run/router': 1.21.0 '@types/cookie': 0.6.0 @@ -11110,17 +10957,17 @@ snapshots: source-map: 0.7.4 turbo-stream: 2.4.0 optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 - '@remix-run/testing@2.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2)': + '@remix-run/testing@2.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.3)': dependencies: - '@remix-run/node': 2.11.2(typescript@5.7.2) - '@remix-run/react': 2.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) - '@remix-run/router': 1.19.1 + '@remix-run/node': 2.15.2(typescript@5.7.3) + '@remix-run/react': 2.15.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.3) + '@remix-run/router': 1.21.0 react: 18.3.1 - react-router-dom: 6.26.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 6.28.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - react-dom @@ -11154,20 +11001,20 @@ snapshots: '@repeaterjs/repeater@3.0.6': {} - '@rollup/plugin-babel@6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.28.1)': + '@rollup/plugin-babel@6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.31.0)': dependencies: '@babel/core': 7.25.2 '@babel/helper-module-imports': 7.24.7 - '@rollup/pluginutils': 5.1.0(rollup@4.28.1) + '@rollup/pluginutils': 5.1.0(rollup@4.31.0) optionalDependencies: '@types/babel__core': 7.20.5 - rollup: 4.28.1 + rollup: 4.31.0 transitivePeerDependencies: - supports-color - '@rollup/plugin-commonjs@28.0.2(rollup@4.28.1)': + '@rollup/plugin-commonjs@28.0.2(rollup@4.31.0)': dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.28.1) + '@rollup/pluginutils': 5.1.3(rollup@4.31.0) commondir: 1.0.1 estree-walker: 2.0.2 fdir: 6.4.0(picomatch@4.0.2) @@ -11175,49 +11022,49 @@ snapshots: magic-string: 0.30.11 picomatch: 4.0.2 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/plugin-eslint@9.0.5(rollup@4.28.1)': + '@rollup/plugin-eslint@9.0.5(rollup@4.31.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.28.1) + '@rollup/pluginutils': 5.1.0(rollup@4.31.0) eslint: 8.57.1 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 transitivePeerDependencies: - supports-color - '@rollup/plugin-node-resolve@16.0.0(rollup@4.28.1)': + '@rollup/plugin-node-resolve@16.0.0(rollup@4.31.0)': dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.28.1) + '@rollup/pluginutils': 5.1.3(rollup@4.31.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/plugin-replace@6.0.2(rollup@4.28.1)': + '@rollup/plugin-replace@6.0.2(rollup@4.31.0)': dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.28.1) + '@rollup/pluginutils': 5.1.3(rollup@4.31.0) magic-string: 0.30.11 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/plugin-terser@0.4.4(rollup@4.28.1)': + '@rollup/plugin-terser@0.4.4(rollup@4.31.0)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.31.6 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/plugin-typescript@12.1.2(rollup@4.28.1)(tslib@2.8.1)(typescript@5.7.2)': + '@rollup/plugin-typescript@12.1.2(rollup@4.31.0)(tslib@2.8.1)(typescript@5.7.3)': dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.28.1) + '@rollup/pluginutils': 5.1.3(rollup@4.31.0) resolve: 1.22.8 - typescript: 5.7.2 + typescript: 5.7.3 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 tslib: 2.8.1 '@rollup/pluginutils@4.2.1': @@ -11225,77 +11072,77 @@ snapshots: estree-walker: 2.0.2 picomatch: 2.3.1 - '@rollup/pluginutils@5.1.0(rollup@4.28.1)': + '@rollup/pluginutils@5.1.0(rollup@4.31.0)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/pluginutils@5.1.3(rollup@4.28.1)': + '@rollup/pluginutils@5.1.3(rollup@4.31.0)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 4.0.2 optionalDependencies: - rollup: 4.28.1 + rollup: 4.31.0 - '@rollup/rollup-android-arm-eabi@4.28.1': + '@rollup/rollup-android-arm-eabi@4.31.0': optional: true - '@rollup/rollup-android-arm64@4.28.1': + '@rollup/rollup-android-arm64@4.31.0': optional: true - '@rollup/rollup-darwin-arm64@4.28.1': + '@rollup/rollup-darwin-arm64@4.31.0': optional: true - '@rollup/rollup-darwin-x64@4.28.1': + '@rollup/rollup-darwin-x64@4.31.0': optional: true - '@rollup/rollup-freebsd-arm64@4.28.1': + '@rollup/rollup-freebsd-arm64@4.31.0': optional: true - '@rollup/rollup-freebsd-x64@4.28.1': + '@rollup/rollup-freebsd-x64@4.31.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.28.1': + '@rollup/rollup-linux-arm-gnueabihf@4.31.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.28.1': + '@rollup/rollup-linux-arm-musleabihf@4.31.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.28.1': + '@rollup/rollup-linux-arm64-gnu@4.31.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.28.1': + '@rollup/rollup-linux-arm64-musl@4.31.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.28.1': + '@rollup/rollup-linux-loongarch64-gnu@4.31.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.31.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.28.1': + '@rollup/rollup-linux-riscv64-gnu@4.31.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.28.1': + '@rollup/rollup-linux-s390x-gnu@4.31.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.28.1': + '@rollup/rollup-linux-x64-gnu@4.31.0': optional: true - '@rollup/rollup-linux-x64-musl@4.28.1': + '@rollup/rollup-linux-x64-musl@4.31.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.28.1': + '@rollup/rollup-win32-arm64-msvc@4.31.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.28.1': + '@rollup/rollup-win32-ia32-msvc@4.31.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.28.1': + '@rollup/rollup-win32-x64-msvc@4.31.0': optional: true '@shopify/babel-preset@25.0.0': @@ -11320,25 +11167,25 @@ snapshots: transitivePeerDependencies: - supports-color - '@shopify/eslint-plugin@45.0.0(@babel/core@7.25.2)(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(prettier@3.4.2)(typescript@5.7.2)': + '@shopify/eslint-plugin@45.0.0(@babel/core@7.25.2)(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(prettier@3.4.2)(typescript@5.7.3)': dependencies: '@babel/eslint-parser': 7.25.1(@babel/core@7.25.2)(eslint@8.57.1) '@babel/eslint-plugin': 7.25.1(@babel/eslint-parser@7.25.1(@babel/core@7.25.2)(eslint@8.57.1))(eslint@8.57.1) - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2) - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.3) change-case: 4.1.2 common-tags: 1.8.2 doctrine: 2.1.0 eslint: 8.57.1 eslint-config-prettier: 9.1.0(eslint@8.57.1) - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.1) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1) - eslint-plugin-jest: 28.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(typescript@5.7.2) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1) + eslint-plugin-jest: 28.11.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) eslint-plugin-jest-formatting: 3.1.0(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.1) eslint-plugin-node: 11.1.0(eslint@8.57.1) - eslint-plugin-prettier: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) + eslint-plugin-prettier: 5.2.3(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) eslint-plugin-promise: 6.6.0(eslint@8.57.1) eslint-plugin-react: 7.35.0(eslint@8.57.1) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) @@ -11361,7 +11208,7 @@ snapshots: dependencies: '@types/react': 18.3.12 globby: 11.1.0 - typescript: 5.6.2 + typescript: 5.7.2 '@shopify/graphql-codegen@0.1.0(encoding@0.1.13)(graphql@16.10.0)': dependencies: @@ -11388,7 +11235,7 @@ snapshots: dependencies: '@shopify/polaris-icons': 8.11.1(react@18.3.1) '@shopify/polaris-tokens': 8.10.0 - '@types/react': 18.3.12 + '@types/react': 19.0.7 '@types/react-dom': 18.3.0 '@types/react-transition-group': 4.4.11 react: 18.3.1 @@ -11421,192 +11268,192 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 - '@smithy/abort-controller@3.1.9': + '@smithy/abort-controller@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/config-resolver@3.0.13': + '@smithy/config-resolver@4.0.1': dependencies: - '@smithy/node-config-provider': 3.1.12 - '@smithy/types': 3.7.2 - '@smithy/util-config-provider': 3.0.0 - '@smithy/util-middleware': 3.0.11 + '@smithy/node-config-provider': 4.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-config-provider': 4.0.0 + '@smithy/util-middleware': 4.0.1 tslib: 2.8.1 - '@smithy/core@2.5.5': + '@smithy/core@3.1.1': dependencies: - '@smithy/middleware-serde': 3.0.11 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 - '@smithy/util-body-length-browser': 3.0.0 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-stream': 3.3.2 - '@smithy/util-utf8': 3.0.0 + '@smithy/middleware-serde': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-body-length-browser': 4.0.0 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-stream': 4.0.2 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 - '@smithy/credential-provider-imds@3.2.8': + '@smithy/credential-provider-imds@4.0.1': dependencies: - '@smithy/node-config-provider': 3.1.12 - '@smithy/property-provider': 3.1.11 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 + '@smithy/node-config-provider': 4.0.1 + '@smithy/property-provider': 4.0.1 + '@smithy/types': 4.1.0 + '@smithy/url-parser': 4.0.1 tslib: 2.8.1 - '@smithy/fetch-http-handler@4.1.2': + '@smithy/fetch-http-handler@5.0.1': dependencies: - '@smithy/protocol-http': 4.1.8 - '@smithy/querystring-builder': 3.0.11 - '@smithy/types': 3.7.2 - '@smithy/util-base64': 3.0.0 + '@smithy/protocol-http': 5.0.1 + '@smithy/querystring-builder': 4.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-base64': 4.0.0 tslib: 2.8.1 - '@smithy/hash-node@3.0.11': + '@smithy/hash-node@4.0.1': dependencies: - '@smithy/types': 3.7.2 - '@smithy/util-buffer-from': 3.0.0 - '@smithy/util-utf8': 3.0.0 + '@smithy/types': 4.1.0 + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 - '@smithy/invalid-dependency@3.0.11': + '@smithy/invalid-dependency@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 '@smithy/is-array-buffer@2.2.0': dependencies: tslib: 2.8.1 - '@smithy/is-array-buffer@3.0.0': + '@smithy/is-array-buffer@4.0.0': dependencies: tslib: 2.8.1 - '@smithy/middleware-content-length@3.0.13': + '@smithy/middleware-content-length@4.0.1': dependencies: - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/middleware-endpoint@3.2.5': + '@smithy/middleware-endpoint@4.0.2': dependencies: - '@smithy/core': 2.5.5 - '@smithy/middleware-serde': 3.0.11 - '@smithy/node-config-provider': 3.1.12 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 - '@smithy/url-parser': 3.0.11 - '@smithy/util-middleware': 3.0.11 + '@smithy/core': 3.1.1 + '@smithy/middleware-serde': 4.0.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 + '@smithy/url-parser': 4.0.1 + '@smithy/util-middleware': 4.0.1 tslib: 2.8.1 - '@smithy/middleware-retry@3.0.30': + '@smithy/middleware-retry@4.0.3': dependencies: - '@smithy/node-config-provider': 3.1.12 - '@smithy/protocol-http': 4.1.8 - '@smithy/service-error-classification': 3.0.11 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-retry': 3.0.11 + '@smithy/node-config-provider': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/service-error-classification': 4.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-retry': 4.0.1 tslib: 2.8.1 uuid: 9.0.1 - '@smithy/middleware-serde@3.0.11': + '@smithy/middleware-serde@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/middleware-stack@3.0.11': + '@smithy/middleware-stack@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/node-config-provider@3.1.12': + '@smithy/node-config-provider@4.0.1': dependencies: - '@smithy/property-provider': 3.1.11 - '@smithy/shared-ini-file-loader': 3.1.12 - '@smithy/types': 3.7.2 + '@smithy/property-provider': 4.0.1 + '@smithy/shared-ini-file-loader': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/node-http-handler@3.3.2': + '@smithy/node-http-handler@4.0.2': dependencies: - '@smithy/abort-controller': 3.1.9 - '@smithy/protocol-http': 4.1.8 - '@smithy/querystring-builder': 3.0.11 - '@smithy/types': 3.7.2 + '@smithy/abort-controller': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/querystring-builder': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/property-provider@3.1.11': + '@smithy/property-provider@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/protocol-http@4.1.8': + '@smithy/protocol-http@5.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/querystring-builder@3.0.11': + '@smithy/querystring-builder@4.0.1': dependencies: - '@smithy/types': 3.7.2 - '@smithy/util-uri-escape': 3.0.0 + '@smithy/types': 4.1.0 + '@smithy/util-uri-escape': 4.0.0 tslib: 2.8.1 - '@smithy/querystring-parser@3.0.11': + '@smithy/querystring-parser@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/service-error-classification@3.0.11': + '@smithy/service-error-classification@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 - '@smithy/shared-ini-file-loader@3.1.12': + '@smithy/shared-ini-file-loader@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/signature-v4@4.2.4': + '@smithy/signature-v4@5.0.1': dependencies: - '@smithy/is-array-buffer': 3.0.0 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 - '@smithy/util-hex-encoding': 3.0.0 - '@smithy/util-middleware': 3.0.11 - '@smithy/util-uri-escape': 3.0.0 - '@smithy/util-utf8': 3.0.0 + '@smithy/is-array-buffer': 4.0.0 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-hex-encoding': 4.0.0 + '@smithy/util-middleware': 4.0.1 + '@smithy/util-uri-escape': 4.0.0 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 - '@smithy/smithy-client@3.5.0': + '@smithy/smithy-client@4.1.2': dependencies: - '@smithy/core': 2.5.5 - '@smithy/middleware-endpoint': 3.2.5 - '@smithy/middleware-stack': 3.0.11 - '@smithy/protocol-http': 4.1.8 - '@smithy/types': 3.7.2 - '@smithy/util-stream': 3.3.2 + '@smithy/core': 3.1.1 + '@smithy/middleware-endpoint': 4.0.2 + '@smithy/middleware-stack': 4.0.1 + '@smithy/protocol-http': 5.0.1 + '@smithy/types': 4.1.0 + '@smithy/util-stream': 4.0.2 tslib: 2.8.1 - '@smithy/types@3.7.2': + '@smithy/types@4.1.0': dependencies: tslib: 2.8.1 - '@smithy/url-parser@3.0.11': + '@smithy/url-parser@4.0.1': dependencies: - '@smithy/querystring-parser': 3.0.11 - '@smithy/types': 3.7.2 + '@smithy/querystring-parser': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/util-base64@3.0.0': + '@smithy/util-base64@4.0.0': dependencies: - '@smithy/util-buffer-from': 3.0.0 - '@smithy/util-utf8': 3.0.0 + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 - '@smithy/util-body-length-browser@3.0.0': + '@smithy/util-body-length-browser@4.0.0': dependencies: tslib: 2.8.1 - '@smithy/util-body-length-node@3.0.0': + '@smithy/util-body-length-node@4.0.0': dependencies: tslib: 2.8.1 @@ -11615,66 +11462,66 @@ snapshots: '@smithy/is-array-buffer': 2.2.0 tslib: 2.8.1 - '@smithy/util-buffer-from@3.0.0': + '@smithy/util-buffer-from@4.0.0': dependencies: - '@smithy/is-array-buffer': 3.0.0 + '@smithy/is-array-buffer': 4.0.0 tslib: 2.8.1 - '@smithy/util-config-provider@3.0.0': + '@smithy/util-config-provider@4.0.0': dependencies: tslib: 2.8.1 - '@smithy/util-defaults-mode-browser@3.0.30': + '@smithy/util-defaults-mode-browser@4.0.3': dependencies: - '@smithy/property-provider': 3.1.11 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 + '@smithy/property-provider': 4.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 bowser: 2.11.0 tslib: 2.8.1 - '@smithy/util-defaults-mode-node@3.0.30': + '@smithy/util-defaults-mode-node@4.0.3': dependencies: - '@smithy/config-resolver': 3.0.13 - '@smithy/credential-provider-imds': 3.2.8 - '@smithy/node-config-provider': 3.1.12 - '@smithy/property-provider': 3.1.11 - '@smithy/smithy-client': 3.5.0 - '@smithy/types': 3.7.2 + '@smithy/config-resolver': 4.0.1 + '@smithy/credential-provider-imds': 4.0.1 + '@smithy/node-config-provider': 4.0.1 + '@smithy/property-provider': 4.0.1 + '@smithy/smithy-client': 4.1.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/util-endpoints@2.1.7': + '@smithy/util-endpoints@3.0.1': dependencies: - '@smithy/node-config-provider': 3.1.12 - '@smithy/types': 3.7.2 + '@smithy/node-config-provider': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/util-hex-encoding@3.0.0': + '@smithy/util-hex-encoding@4.0.0': dependencies: tslib: 2.8.1 - '@smithy/util-middleware@3.0.11': + '@smithy/util-middleware@4.0.1': dependencies: - '@smithy/types': 3.7.2 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/util-retry@3.0.11': + '@smithy/util-retry@4.0.1': dependencies: - '@smithy/service-error-classification': 3.0.11 - '@smithy/types': 3.7.2 + '@smithy/service-error-classification': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@smithy/util-stream@3.3.2': + '@smithy/util-stream@4.0.2': dependencies: - '@smithy/fetch-http-handler': 4.1.2 - '@smithy/node-http-handler': 3.3.2 - '@smithy/types': 3.7.2 - '@smithy/util-base64': 3.0.0 - '@smithy/util-buffer-from': 3.0.0 - '@smithy/util-hex-encoding': 3.0.0 - '@smithy/util-utf8': 3.0.0 + '@smithy/fetch-http-handler': 5.0.1 + '@smithy/node-http-handler': 4.0.2 + '@smithy/types': 4.1.0 + '@smithy/util-base64': 4.0.0 + '@smithy/util-buffer-from': 4.0.0 + '@smithy/util-hex-encoding': 4.0.0 + '@smithy/util-utf8': 4.0.0 tslib: 2.8.1 - '@smithy/util-uri-escape@3.0.0': + '@smithy/util-uri-escape@4.0.0': dependencies: tslib: 2.8.1 @@ -11683,62 +11530,62 @@ snapshots: '@smithy/util-buffer-from': 2.2.0 tslib: 2.8.1 - '@smithy/util-utf8@3.0.0': + '@smithy/util-utf8@4.0.0': dependencies: - '@smithy/util-buffer-from': 3.0.0 + '@smithy/util-buffer-from': 4.0.0 tslib: 2.8.1 - '@smithy/util-waiter@3.2.0': + '@smithy/util-waiter@4.0.2': dependencies: - '@smithy/abort-controller': 3.1.9 - '@smithy/types': 3.7.2 + '@smithy/abort-controller': 4.0.1 + '@smithy/types': 4.1.0 tslib: 2.8.1 - '@swc/core-darwin-arm64@1.10.1': + '@swc/core-darwin-arm64@1.10.8': optional: true - '@swc/core-darwin-x64@1.10.1': + '@swc/core-darwin-x64@1.10.8': optional: true - '@swc/core-linux-arm-gnueabihf@1.10.1': + '@swc/core-linux-arm-gnueabihf@1.10.8': optional: true - '@swc/core-linux-arm64-gnu@1.10.1': + '@swc/core-linux-arm64-gnu@1.10.8': optional: true - '@swc/core-linux-arm64-musl@1.10.1': + '@swc/core-linux-arm64-musl@1.10.8': optional: true - '@swc/core-linux-x64-gnu@1.10.1': + '@swc/core-linux-x64-gnu@1.10.8': optional: true - '@swc/core-linux-x64-musl@1.10.1': + '@swc/core-linux-x64-musl@1.10.8': optional: true - '@swc/core-win32-arm64-msvc@1.10.1': + '@swc/core-win32-arm64-msvc@1.10.8': optional: true - '@swc/core-win32-ia32-msvc@1.10.1': + '@swc/core-win32-ia32-msvc@1.10.8': optional: true - '@swc/core-win32-x64-msvc@1.10.1': + '@swc/core-win32-x64-msvc@1.10.8': optional: true - '@swc/core@1.10.1': + '@swc/core@1.10.8': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.17 optionalDependencies: - '@swc/core-darwin-arm64': 1.10.1 - '@swc/core-darwin-x64': 1.10.1 - '@swc/core-linux-arm-gnueabihf': 1.10.1 - '@swc/core-linux-arm64-gnu': 1.10.1 - '@swc/core-linux-arm64-musl': 1.10.1 - '@swc/core-linux-x64-gnu': 1.10.1 - '@swc/core-linux-x64-musl': 1.10.1 - '@swc/core-win32-arm64-msvc': 1.10.1 - '@swc/core-win32-ia32-msvc': 1.10.1 - '@swc/core-win32-x64-msvc': 1.10.1 + '@swc/core-darwin-arm64': 1.10.8 + '@swc/core-darwin-x64': 1.10.8 + '@swc/core-linux-arm-gnueabihf': 1.10.8 + '@swc/core-linux-arm64-gnu': 1.10.8 + '@swc/core-linux-arm64-musl': 1.10.8 + '@swc/core-linux-x64-gnu': 1.10.8 + '@swc/core-linux-x64-musl': 1.10.8 + '@swc/core-win32-arm64-msvc': 1.10.8 + '@swc/core-win32-ia32-msvc': 1.10.8 + '@swc/core-win32-x64-msvc': 1.10.8 '@swc/counter@0.1.3': {} @@ -11782,12 +11629,12 @@ snapshots: '@types/better-sqlite3@7.6.12': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/compression@1.7.5': dependencies: @@ -11795,7 +11642,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/cookie-parser@1.4.8(@types/express@4.17.21)': dependencies: @@ -11809,7 +11656,7 @@ snapshots: '@types/express-serve-static-core@4.19.5': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/qs': 6.9.15 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -11823,7 +11670,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 '@types/http-errors@2.0.4': {} @@ -11846,7 +11693,7 @@ snapshots: '@types/jsdom@20.0.1': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 '@types/tough-cookie': 4.0.5 parse5: 7.1.2 @@ -11854,7 +11701,7 @@ snapshots: '@types/jsonwebtoken@9.0.7': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/methods@1.1.4': {} @@ -11862,20 +11709,16 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 form-data: 4.0.0 - '@types/node-forge@1.3.11': - dependencies: - '@types/node': 22.10.1 - '@types/node@12.20.55': {} - '@types/node@22.10.1': + '@types/node@22.10.5': dependencies: undici-types: 6.20.0 - '@types/node@22.10.2': + '@types/node@22.10.7': dependencies: undici-types: 6.20.0 @@ -11883,7 +11726,7 @@ snapshots: '@types/pg@8.11.6': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 pg-protocol: 1.6.1 pg-types: 4.0.2 @@ -11895,17 +11738,21 @@ snapshots: '@types/react-dom@18.3.0': dependencies: - '@types/react': 18.3.12 + '@types/react': 19.0.7 '@types/react-transition-group@4.4.11': dependencies: - '@types/react': 18.3.12 + '@types/react': 19.0.7 '@types/react@18.3.12': dependencies: '@types/prop-types': 15.7.13 csstype: 3.1.3 + '@types/react@19.0.7': + dependencies: + csstype: 3.1.3 + '@types/resolve@1.20.2': {} '@types/semver@7.5.8': {} @@ -11913,17 +11760,17 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/send': 0.17.4 '@types/sqlite3@3.1.11': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/stack-utils@2.0.3': {} @@ -11931,7 +11778,7 @@ snapshots: dependencies: '@types/cookiejar': 2.1.5 '@types/methods': 1.1.4 - '@types/node': 22.10.2 + '@types/node': 22.10.7 form-data: 4.0.0 '@types/supertest@6.0.2': @@ -11953,7 +11800,7 @@ snapshots: '@types/ws@8.5.12': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.5 '@types/yargs-parser@21.0.3': {} @@ -11965,34 +11812,34 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2)': + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.3) '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.7.2) - '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.7.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.7.3) '@typescript-eslint/visitor-keys': 7.18.0 eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.7.2) + ts-api-utils: 1.3.0(typescript@5.7.3) optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2)': + '@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3)': dependencies: '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) '@typescript-eslint/visitor-keys': 7.18.0 debug: 4.3.7 eslint: 8.57.1 optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - supports-color @@ -12006,15 +11853,15 @@ snapshots: '@typescript-eslint/types': 8.14.0 '@typescript-eslint/visitor-keys': 8.14.0 - '@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.7.2)': + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) - '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.7.3) debug: 4.3.7 eslint: 8.57.1 - ts-api-utils: 1.3.0(typescript@5.7.2) + ts-api-utils: 1.3.0(typescript@5.7.3) optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - supports-color @@ -12022,7 +11869,7 @@ snapshots: '@typescript-eslint/types@8.14.0': {} - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.7.3)': dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 @@ -12031,13 +11878,13 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.7.2) + ts-api-utils: 1.3.0(typescript@5.7.3) optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.14.0(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@8.14.0(typescript@5.7.3)': dependencies: '@typescript-eslint/types': 8.14.0 '@typescript-eslint/visitor-keys': 8.14.0 @@ -12046,29 +11893,29 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.4.0(typescript@5.7.2) + ts-api-utils: 1.4.0(typescript@5.7.3) optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.7.2)': + '@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.7.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3) eslint: 8.57.1 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.14.0(eslint@8.57.1)(typescript@5.7.2)': + '@typescript-eslint/utils@8.14.0(eslint@8.57.1)(typescript@5.7.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) '@typescript-eslint/scope-manager': 8.14.0 '@typescript-eslint/types': 8.14.0 - '@typescript-eslint/typescript-estree': 8.14.0(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 8.14.0(typescript@5.7.3) eslint: 8.57.1 transitivePeerDependencies: - supports-color @@ -12438,7 +12285,7 @@ snapshots: dependencies: is-windows: 1.0.2 - better-sqlite3@11.7.0: + better-sqlite3@11.8.1: dependencies: bindings: 1.5.0 prebuild-install: 7.1.2 @@ -12624,10 +12471,6 @@ snapshots: chardet@0.7.0: {} - chokidar@4.0.1: - dependencies: - readdirp: 4.0.2 - chownr@1.1.4: {} chownr@2.0.0: {} @@ -12704,6 +12547,8 @@ snapshots: concat-map@0.0.1: {} + confbox@0.1.8: {} + console-control-strings@1.1.0: optional: true @@ -12750,14 +12595,14 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - cosmiconfig@8.3.6(typescript@5.7.2): + cosmiconfig@8.3.6(typescript@5.7.3): dependencies: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 optionalDependencies: - typescript: 5.7.2 + typescript: 5.7.3 create-jest-runner@0.11.2: dependencies: @@ -12765,13 +12610,13 @@ snapshots: jest-worker: 28.1.3 throat: 6.0.2 - create-jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)): + create-jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest-config: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -12846,8 +12691,6 @@ snapshots: dataloader@2.2.2: {} - date-fns@4.1.0: {} - debounce@1.2.1: {} debug@2.6.9: @@ -12989,7 +12832,7 @@ snapshots: dotenv@16.4.5: {} - drizzle-kit@0.30.1: + drizzle-kit@0.30.2: dependencies: '@drizzle-team/brocli': 0.10.2 '@esbuild-kit/esm-loader': 2.6.5 @@ -12998,18 +12841,18 @@ snapshots: transitivePeerDependencies: - supports-color - drizzle-orm@0.38.2(@cloudflare/workers-types@4.20241218.0)(@libsql/client@0.14.0(encoding@0.1.13))(@prisma/client@5.22.0(prisma@5.22.0))(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/react@18.3.12)(better-sqlite3@11.7.0)(mysql2@3.11.5)(pg@8.12.0)(prisma@5.22.0)(react@18.3.1)(sqlite3@5.1.7): + drizzle-orm@0.38.4(@cloudflare/workers-types@4.20250109.0)(@libsql/client@0.14.0(encoding@0.1.13))(@prisma/client@6.2.1(prisma@6.2.1))(@types/better-sqlite3@7.6.12)(@types/pg@8.11.6)(@types/react@19.0.7)(better-sqlite3@11.8.1)(mysql2@3.12.0)(pg@8.12.0)(prisma@6.2.1)(react@18.3.1)(sqlite3@5.1.7): optionalDependencies: - '@cloudflare/workers-types': 4.20241218.0 + '@cloudflare/workers-types': 4.20250109.0 '@libsql/client': 0.14.0(encoding@0.1.13) - '@prisma/client': 5.22.0(prisma@5.22.0) + '@prisma/client': 6.2.1(prisma@6.2.1) '@types/better-sqlite3': 7.6.12 '@types/pg': 8.11.6 - '@types/react': 18.3.12 - better-sqlite3: 11.7.0 - mysql2: 3.11.5 + '@types/react': 19.0.7 + better-sqlite3: 11.8.1 + mysql2: 3.12.0 pg: 8.12.0 - prisma: 5.22.0 + prisma: 6.2.1 react: 18.3.1 sqlite3: 5.1.7 @@ -13286,11 +13129,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -13308,7 +13151,7 @@ snapshots: eslint: 8.57.1 ignore: 5.3.2 - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 @@ -13318,7 +13161,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.0 is-glob: 4.0.3 @@ -13329,7 +13172,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.7.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -13339,13 +13182,13 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-plugin-jest@28.9.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(typescript@5.7.2): + eslint-plugin-jest@28.11.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3): dependencies: - '@typescript-eslint/utils': 8.14.0(eslint@8.57.1)(typescript@5.7.2) + '@typescript-eslint/utils': 8.14.0(eslint@8.57.1)(typescript@5.7.3) eslint: 8.57.1 optionalDependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2) - jest: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.7.3))(eslint@8.57.1)(typescript@5.7.3) + jest: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) transitivePeerDependencies: - supports-color - typescript @@ -13380,12 +13223,12 @@ snapshots: resolve: 1.22.8 semver: 6.3.1 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2): + eslint-plugin-prettier@5.2.3(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2): dependencies: eslint: 8.57.1 prettier: 3.4.2 prettier-linter-helpers: 1.0.0 - synckit: 0.9.1 + synckit: 0.9.2 optionalDependencies: eslint-config-prettier: 9.1.0(eslint@8.57.1) @@ -13870,15 +13713,15 @@ snapshots: graphemer@1.4.0: {} - graphql-config@5.1.3(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.2): + graphql-config@5.1.3(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0)(typescript@5.7.3): dependencies: '@graphql-tools/graphql-file-loader': 8.0.1(graphql@16.10.0) '@graphql-tools/json-file-loader': 8.0.1(graphql@16.10.0) '@graphql-tools/load': 8.0.2(graphql@16.10.0) '@graphql-tools/merge': 9.0.6(graphql@16.10.0) - '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.2)(encoding@0.1.13)(graphql@16.10.0) + '@graphql-tools/url-loader': 8.0.2(@types/node@22.10.7)(encoding@0.1.13)(graphql@16.10.0) '@graphql-tools/utils': 10.5.4(graphql@16.10.0) - cosmiconfig: 8.3.6(typescript@5.7.2) + cosmiconfig: 8.3.6(typescript@5.7.3) graphql: 16.10.0 jiti: 2.3.3 minimatch: 9.0.5 @@ -14242,7 +14085,7 @@ snapshots: isarray@2.0.5: {} - isbot@5.1.18: {} + isbot@5.1.21: {} isexe@2.0.0: {} @@ -14299,8 +14142,6 @@ snapshots: reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 - itty-time@1.0.6: {} - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -14326,7 +14167,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3 @@ -14346,16 +14187,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)): + jest-cli@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + create-jest: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest-config: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -14365,7 +14206,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)): + jest-config@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)): dependencies: '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 @@ -14390,8 +14231,8 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 22.10.2 - ts-node: 10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2) + '@types/node': 22.10.7 + ts-node: 10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -14428,7 +14269,7 @@ snapshots: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3 @@ -14437,7 +14278,7 @@ snapshots: - supports-color - utf-8-validate - jest-environment-miniflare@2.14.4(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2))): + jest-environment-miniflare@2.14.4(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3))): dependencies: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 @@ -14446,7 +14287,7 @@ snapshots: '@miniflare/runner-vm': 2.14.4 '@miniflare/shared': 2.14.4 '@miniflare/shared-test-environment': 2.14.4 - jest: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-mock: 29.7.0 jest-util: 29.7.0 transitivePeerDependencies: @@ -14458,7 +14299,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -14477,7 +14318,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 22.10.2 + '@types/node': 22.10.7 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -14523,7 +14364,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -14551,14 +14392,14 @@ snapshots: resolve.exports: 2.0.2 slash: 3.0.0 - jest-runner-eslint@2.2.1(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2))): + jest-runner-eslint@2.2.1(eslint@8.57.1)(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3))): dependencies: chalk: 4.1.2 cosmiconfig: 7.1.0 create-jest-runner: 0.11.2 dot-prop: 6.0.1 eslint: 8.57.1 - jest: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) transitivePeerDependencies: - '@jest/test-result' - jest-runner @@ -14570,7 +14411,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -14598,7 +14439,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 cjs-module-lexer: 1.3.1 collect-v8-coverage: 1.0.2 @@ -14644,7 +14485,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -14663,7 +14504,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.10.2 + '@types/node': 22.10.7 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -14672,23 +14513,23 @@ snapshots: jest-worker@28.1.3: dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 merge-stream: 2.0.0 supports-color: 8.1.1 jest-worker@29.7.0: dependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)): + jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest-cli: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -14985,9 +14826,9 @@ snapshots: merge2@1.4.1: {} - meros@1.3.0(@types/node@22.10.2): + meros@1.3.0(@types/node@22.10.7): optionalDependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.7 methods@1.1.2: {} @@ -15019,7 +14860,7 @@ snapshots: mimic-response@3.1.0: {} - miniflare@3.20241205.0: + miniflare@3.20241230.2: dependencies: '@cspotcode/source-map-support': 0.8.1 acorn: 8.14.0 @@ -15029,7 +14870,7 @@ snapshots: glob-to-regexp: 0.4.1 stoppable: 1.1.0 undici: 5.28.4 - workerd: 1.20241205.0 + workerd: 1.20241230.0 ws: 8.18.0 youch: 3.3.4 zod: 3.23.8 @@ -15098,6 +14939,13 @@ snapshots: mkdirp@1.0.4: {} + mlly@1.7.4: + dependencies: + acorn: 8.14.0 + pathe: 2.0.2 + pkg-types: 1.3.1 + ufo: 1.5.4 + mnemonist@0.38.3: dependencies: obliterator: 1.6.1 @@ -15129,7 +14977,7 @@ snapshots: mute-stream@0.0.8: {} - mysql2@3.11.5: + mysql2@3.12.0: dependencies: aws-ssl-profiles: 1.1.2 denque: 2.1.0 @@ -15145,8 +14993,6 @@ snapshots: dependencies: lru-cache: 7.18.3 - nanoid@3.3.7: {} - napi-build-utils@1.0.2: {} natural-compare@1.4.0: {} @@ -15158,7 +15004,7 @@ snapshots: lower-case: 2.0.2 tslib: 2.8.1 - node-abi@3.71.0: + node-abi@3.73.0: dependencies: semver: 7.6.3 @@ -15170,8 +15016,6 @@ snapshots: optionalDependencies: encoding: 0.1.13 - node-forge@1.3.1: {} - node-gyp@8.4.1: dependencies: env-paths: 2.2.1 @@ -15422,6 +15266,8 @@ snapshots: pathe@1.1.2: {} + pathe@2.0.2: {} + pg-cloudflare@1.1.1: optional: true @@ -15489,6 +15335,12 @@ snapshots: dependencies: find-up: 5.0.0 + pkg-types@1.3.1: + dependencies: + confbox: 0.1.8 + mlly: 1.7.4 + pathe: 2.0.2 + pluralize@8.0.0: {} possible-typed-array-names@1.0.0: {} @@ -15523,11 +15375,11 @@ snapshots: minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 - node-abi: 3.71.0 + node-abi: 3.73.0 pump: 3.0.2 rc: 1.2.8 simple-get: 4.0.1 - tar-fs: 2.1.1 + tar-fs: 2.1.2 tunnel-agent: 0.6.0 prelude-ls@1.2.1: {} @@ -15555,9 +15407,9 @@ snapshots: printable-characters@1.0.42: {} - prisma@5.22.0: + prisma@6.2.1: dependencies: - '@prisma/engines': 5.22.0 + '@prisma/engines': 6.2.1 optionalDependencies: fsevents: 2.3.3 @@ -15653,16 +15505,16 @@ snapshots: react: 18.3.1 scheduler: 0.22.0 - react-router-dom@6.26.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-router-dom@6.28.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@remix-run/router': 1.19.1 + '@remix-run/router': 1.21.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-router: 6.26.1(react@18.3.1) + react-router: 6.28.1(react@18.3.1) - react-router@6.26.1(react@18.3.1): + react-router@6.28.1(react@18.3.1): dependencies: - '@remix-run/router': 1.19.1 + '@remix-run/router': 1.21.0 react: 18.3.1 react-transition-group@4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): @@ -15691,8 +15543,6 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 - readdirp@4.0.2: {} - redis@4.7.0: dependencies: '@redis/bloom': 1.2.0(@redis/client@1.6.0) @@ -15812,17 +15662,17 @@ snapshots: dependencies: glob: 10.4.5 - rollup-plugin-dts@6.1.1(rollup@4.28.1)(typescript@5.7.2): + rollup-plugin-dts@6.1.1(rollup@4.31.0)(typescript@5.7.3): dependencies: magic-string: 0.30.11 - rollup: 4.28.1 - typescript: 5.7.2 + rollup: 4.31.0 + typescript: 5.7.3 optionalDependencies: '@babel/code-frame': 7.26.2 - rollup-plugin-exclude-dependencies-from-bundle@1.1.23(rollup@4.28.1): + rollup-plugin-exclude-dependencies-from-bundle@1.1.23(rollup@4.31.0): dependencies: - rollup: 4.28.1 + rollup: 4.31.0 rollup-plugin-inject@3.0.2: dependencies: @@ -15834,39 +15684,39 @@ snapshots: dependencies: rollup-plugin-inject: 3.0.2 - rollup-plugin-swc@0.2.1(@swc/core@1.10.1)(rollup@4.28.1): + rollup-plugin-swc@0.2.1(@swc/core@1.10.8)(rollup@4.31.0): dependencies: '@rollup/pluginutils': 4.2.1 - '@swc/core': 1.10.1 - rollup: 4.28.1 + '@swc/core': 1.10.8 + rollup: 4.31.0 rollup-pluginutils@2.8.2: dependencies: estree-walker: 0.6.1 - rollup@4.28.1: + rollup@4.31.0: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.28.1 - '@rollup/rollup-android-arm64': 4.28.1 - '@rollup/rollup-darwin-arm64': 4.28.1 - '@rollup/rollup-darwin-x64': 4.28.1 - '@rollup/rollup-freebsd-arm64': 4.28.1 - '@rollup/rollup-freebsd-x64': 4.28.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.28.1 - '@rollup/rollup-linux-arm-musleabihf': 4.28.1 - '@rollup/rollup-linux-arm64-gnu': 4.28.1 - '@rollup/rollup-linux-arm64-musl': 4.28.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.28.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.28.1 - '@rollup/rollup-linux-riscv64-gnu': 4.28.1 - '@rollup/rollup-linux-s390x-gnu': 4.28.1 - '@rollup/rollup-linux-x64-gnu': 4.28.1 - '@rollup/rollup-linux-x64-musl': 4.28.1 - '@rollup/rollup-win32-arm64-msvc': 4.28.1 - '@rollup/rollup-win32-ia32-msvc': 4.28.1 - '@rollup/rollup-win32-x64-msvc': 4.28.1 + '@rollup/rollup-android-arm-eabi': 4.31.0 + '@rollup/rollup-android-arm64': 4.31.0 + '@rollup/rollup-darwin-arm64': 4.31.0 + '@rollup/rollup-darwin-x64': 4.31.0 + '@rollup/rollup-freebsd-arm64': 4.31.0 + '@rollup/rollup-freebsd-x64': 4.31.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.31.0 + '@rollup/rollup-linux-arm-musleabihf': 4.31.0 + '@rollup/rollup-linux-arm64-gnu': 4.31.0 + '@rollup/rollup-linux-arm64-musl': 4.31.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.31.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.31.0 + '@rollup/rollup-linux-riscv64-gnu': 4.31.0 + '@rollup/rollup-linux-s390x-gnu': 4.31.0 + '@rollup/rollup-linux-x64-gnu': 4.31.0 + '@rollup/rollup-linux-x64-musl': 4.31.0 + '@rollup/rollup-win32-arm64-msvc': 4.31.0 + '@rollup/rollup-win32-ia32-msvc': 4.31.0 + '@rollup/rollup-win32-x64-msvc': 4.31.0 fsevents: 2.3.3 run-async@2.4.1: {} @@ -15910,11 +15760,6 @@ snapshots: scuid@1.1.0: {} - selfsigned@2.4.1: - dependencies: - '@types/node-forge': 1.3.11 - node-forge: 1.3.1 - semver@6.3.1: {} semver@7.6.3: {} @@ -16258,12 +16103,12 @@ snapshots: symbol-tree@3.2.4: {} - synckit@0.9.1: + synckit@0.9.2: dependencies: '@pkgr/core': 0.1.1 tslib: 2.8.1 - tar-fs@2.1.1: + tar-fs@2.1.2: dependencies: chownr: 1.1.4 mkdirp-classic: 0.5.3 @@ -16343,26 +16188,26 @@ snapshots: dependencies: punycode: 2.3.1 - ts-api-utils@1.3.0(typescript@5.7.2): + ts-api-utils@1.3.0(typescript@5.7.3): dependencies: - typescript: 5.7.2 + typescript: 5.7.3 - ts-api-utils@1.4.0(typescript@5.7.2): + ts-api-utils@1.4.0(typescript@5.7.3): dependencies: - typescript: 5.7.2 + typescript: 5.7.3 - ts-jest@29.2.4(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)))(typescript@5.7.2): + ts-jest@29.2.4(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.2)(ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2)) + jest: 29.7.0(@types/node@22.10.7)(ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.6.3 - typescript: 5.7.2 + typescript: 5.7.3 yargs-parser: 21.1.1 optionalDependencies: '@babel/core': 7.25.2 @@ -16372,25 +16217,25 @@ snapshots: ts-log@2.2.5: {} - ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.2)(typescript@5.7.2): + ts-node@10.9.2(@swc/core@1.10.8)(@types/node@22.10.7)(typescript@5.7.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.10.2 + '@types/node': 22.10.7 acorn: 8.12.1 acorn-walk: 8.3.3 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.7.2 + typescript: 5.7.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.10.1 + '@swc/core': 1.10.8 tsconfig-paths@3.15.0: dependencies: @@ -16419,8 +16264,6 @@ snapshots: turbo-linux-arm64@2.3.3: optional: true - turbo-stream@2.3.0: {} - turbo-stream@2.4.0: {} turbo-windows-64@2.3.3: @@ -16487,10 +16330,10 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript@5.6.2: {} - typescript@5.7.2: {} + typescript@5.7.3: {} + ua-parser-js@1.0.38: {} ufo@1.5.4: {} @@ -16512,9 +16355,10 @@ snapshots: undici@6.19.7: {} - unenv-nightly@2.0.0-20241204-140205-a5d5190: + unenv-nightly@2.0.0-20250109-100802-88ad671: dependencies: defu: 6.1.4 + mlly: 1.7.4 ohash: 1.1.4 pathe: 1.1.2 ufo: 1.5.4 @@ -16589,7 +16433,7 @@ snapshots: utils-merge@1.0.1: {} - uuid@10.0.0: {} + uuid@11.0.5: {} uuid@9.0.1: {} @@ -16629,7 +16473,7 @@ snapshots: web-streams-polyfill@3.3.3: {} - web-streams-polyfill@4.0.0: {} + web-streams-polyfill@4.1.0: {} webidl-conversions@3.0.1: {} @@ -16707,35 +16551,27 @@ snapshots: word-wrap@1.2.5: {} - workerd@1.20241205.0: + workerd@1.20241230.0: optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20241205.0 - '@cloudflare/workerd-darwin-arm64': 1.20241205.0 - '@cloudflare/workerd-linux-64': 1.20241205.0 - '@cloudflare/workerd-linux-arm64': 1.20241205.0 - '@cloudflare/workerd-windows-64': 1.20241205.0 + '@cloudflare/workerd-darwin-64': 1.20241230.0 + '@cloudflare/workerd-darwin-arm64': 1.20241230.0 + '@cloudflare/workerd-linux-64': 1.20241230.0 + '@cloudflare/workerd-linux-arm64': 1.20241230.0 + '@cloudflare/workerd-windows-64': 1.20241230.0 - wrangler@3.96.0(@cloudflare/workers-types@4.20241218.0): + wrangler@3.103.2(@cloudflare/workers-types@4.20250109.0): dependencies: '@cloudflare/kv-asset-handler': 0.3.4 '@esbuild-plugins/node-globals-polyfill': 0.2.3(esbuild@0.17.19) '@esbuild-plugins/node-modules-polyfill': 0.2.2(esbuild@0.17.19) blake3-wasm: 2.1.5 - chokidar: 4.0.1 - date-fns: 4.1.0 esbuild: 0.17.19 - itty-time: 1.0.6 - miniflare: 3.20241205.0 - nanoid: 3.3.7 + miniflare: 3.20241230.2 path-to-regexp: 6.3.0 - resolve: 1.22.8 - selfsigned: 2.4.1 - source-map: 0.6.1 - unenv: unenv-nightly@2.0.0-20241204-140205-a5d5190 - workerd: 1.20241205.0 - xxhash-wasm: 1.0.2 + unenv: unenv-nightly@2.0.0-20250109-100802-88ad671 + workerd: 1.20241230.0 optionalDependencies: - '@cloudflare/workers-types': 4.20241218.0 + '@cloudflare/workers-types': 4.20250109.0 fsevents: 2.3.3 transitivePeerDependencies: - bufferutil @@ -16775,8 +16611,6 @@ snapshots: xtend@4.0.2: {} - xxhash-wasm@1.0.2: {} - y18n@4.0.3: {} y18n@5.0.8: {}