@carddb/client 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +26 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1041,9 +1041,13 @@ var RecordsResource = class extends BaseResource {
|
|
|
1041
1041
|
resolveLinks: options.resolveLinks,
|
|
1042
1042
|
first: options.first,
|
|
1043
1043
|
after: options.after,
|
|
1044
|
-
validateSchema: options.validateSchema
|
|
1044
|
+
validateSchema: options.validateSchema,
|
|
1045
|
+
includePricing: options.includePricing
|
|
1046
|
+
});
|
|
1047
|
+
const key = this.cacheKey("records", "search", {
|
|
1048
|
+
...variables,
|
|
1049
|
+
includePricing: options.includePricing ?? false
|
|
1045
1050
|
});
|
|
1046
|
-
const key = this.cacheKey("records", "search", variables);
|
|
1047
1051
|
const data = await this.withCache(key, "records", options, async () => {
|
|
1048
1052
|
const result = await this.connection.execute(query, variables);
|
|
1049
1053
|
return result["searchRecords"];
|
|
@@ -1061,9 +1065,12 @@ var RecordsResource = class extends BaseResource {
|
|
|
1061
1065
|
* const record = await client.records.get('550e8400-e29b-41d4-a716-446655440000')
|
|
1062
1066
|
*/
|
|
1063
1067
|
async get(id, options = {}) {
|
|
1064
|
-
const key = this.cacheKey("records", "get", {
|
|
1068
|
+
const key = this.cacheKey("records", "get", {
|
|
1069
|
+
id,
|
|
1070
|
+
includePricing: options.includePricing ?? false
|
|
1071
|
+
});
|
|
1065
1072
|
return this.withCache(key, "records", options, async () => {
|
|
1066
|
-
const { query } = core.QueryBuilder.fetchRecordById();
|
|
1073
|
+
const { query } = core.QueryBuilder.fetchRecordById({ includePricing: options.includePricing });
|
|
1067
1074
|
const result = await this.connection.execute(query, { id });
|
|
1068
1075
|
return result["fetchRecord"] ?? null;
|
|
1069
1076
|
});
|
|
@@ -1095,10 +1102,13 @@ var RecordsResource = class extends BaseResource {
|
|
|
1095
1102
|
publisherSlug,
|
|
1096
1103
|
gameKey,
|
|
1097
1104
|
datasetKey: options.datasetKey,
|
|
1098
|
-
identifier: options.identifier
|
|
1105
|
+
identifier: options.identifier,
|
|
1106
|
+
includePricing: options.includePricing ?? false
|
|
1099
1107
|
});
|
|
1100
1108
|
return this.withCache(key, "records", options, async () => {
|
|
1101
|
-
const { query } = core.QueryBuilder.fetchRecordByIdentifier(
|
|
1109
|
+
const { query } = core.QueryBuilder.fetchRecordByIdentifier({
|
|
1110
|
+
includePricing: options.includePricing
|
|
1111
|
+
});
|
|
1102
1112
|
const result = await this.connection.execute(query, {
|
|
1103
1113
|
publisherSlug,
|
|
1104
1114
|
gameKey,
|
|
@@ -1136,10 +1146,13 @@ var RecordsResource = class extends BaseResource {
|
|
|
1136
1146
|
publisherSlug,
|
|
1137
1147
|
gameKey,
|
|
1138
1148
|
datasetKey: options.datasetKey,
|
|
1139
|
-
identifiers: options.identifiers
|
|
1149
|
+
identifiers: options.identifiers,
|
|
1150
|
+
includePricing: options.includePricing ?? false
|
|
1140
1151
|
});
|
|
1141
1152
|
return this.withCache(key, "records", options, async () => {
|
|
1142
|
-
const { query } = core.QueryBuilder.fetchRecordsByIdentifier(
|
|
1153
|
+
const { query } = core.QueryBuilder.fetchRecordsByIdentifier({
|
|
1154
|
+
includePricing: options.includePricing
|
|
1155
|
+
});
|
|
1143
1156
|
const result = await this.connection.execute(query, {
|
|
1144
1157
|
publisherSlug,
|
|
1145
1158
|
gameKey,
|
|
@@ -1157,9 +1170,12 @@ var RecordsResource = class extends BaseResource {
|
|
|
1157
1170
|
*/
|
|
1158
1171
|
async getMany(ids, options = {}) {
|
|
1159
1172
|
if (ids.length === 0) return [];
|
|
1160
|
-
const key = this.cacheKey("records", "getMany", {
|
|
1173
|
+
const key = this.cacheKey("records", "getMany", {
|
|
1174
|
+
ids,
|
|
1175
|
+
includePricing: options.includePricing ?? false
|
|
1176
|
+
});
|
|
1161
1177
|
return this.withCache(key, "records", options, async () => {
|
|
1162
|
-
const { query } = core.QueryBuilder.fetchRecords();
|
|
1178
|
+
const { query } = core.QueryBuilder.fetchRecords({ includePricing: options.includePricing });
|
|
1163
1179
|
const result = await this.connection.execute(query, { ids });
|
|
1164
1180
|
return result["fetchRecords"] ?? [];
|
|
1165
1181
|
});
|