Example mapping
{
properties: {
key: { type: 'keyword' },
title: { type: 'text' },
releases: {
type: 'nested',
/*** PLP ***/ | |
{ | |
"productId": 23573080, | |
"lineNumber": "BUNDLE_AW15_02S13IBLU_3", | |
"name": "3 Piece Slim Fit Blue Tipped Suit", | |
"unitPrice": "155.00", | |
"assets": [ | |
{ | |
"assetType": "IMAGE_SMALL", | |
"index": 1, |
{ | |
/* | |
The environment this receipt is for - either "Sandbox" or "PROD", | |
one is abbreviated, the other isnt, one is in caps and one is Sentence case | |
that is not a mistake, at least, not by me. | |
*/ | |
"environment": "Sandbox", | |
/* | |
The decoded version of the receipt you sent - my advice is to completely ignore this. |
switch transaction.transactionState { | |
case .purchased: | |
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL, | |
FileManager.default.fileExists(atPath: appStoreReceiptURL.path) { | |
let rawReceiptData = Data(contentsOf: appStoreReceiptURL) | |
let receiptData = rawReceiptData.base64EncodedString(options: ...) | |
currentUser.processTransaction(receiptData) { isValid in |
async verifyReceipt(encodedReceipt) { | |
const body = JSON.stringify({ | |
'receipt-data': encodedReceipt, | |
// Set in App Store Connect | |
password: process.env.APP_STORE_SECRET, | |
// This means Apple only returns the latest receipt info instead of all transactions. | |
'exclude-old-transactions': true, |
{ | |
"notification_type": "CANCEL", | |
"environment": "Sandbox", | |
"password": "APP_STORE_SECRET", | |
/* The date in milliseconds at which the user cancelled */ | |
"cancellation_date_ms": "1528309241000", | |
/* The latest receipt information, now expired, but you should still update it in your DB */ | |
"latest_expired_receipt": "ewoJVEU1nYXhZO...UNhb2LIjsKfQ==", |
{ | |
"notification_type": "RENEWAL", | |
"environment": "Sandbox", | |
"password": "APP_STORE_SECRET", | |
/* The latest receipt information, you should update it in your DB */ | |
"latest_receipt": "ewodnNpZ25...iMCI3d37Cn0=", | |
/* The decoded information form the latest receipt - an object not array in notifications */ | |
"latest_receipt_info": { |
// Results | |
const groupStages = [ | |
['Russia', 5, 0, 'Saudi Arabia'], | |
['Egypt', 0, 1, 'Uruguay'], | |
['Morocco', 0, 1, 'Iran'], | |
['Portugal', 3, 3, 'Spain'], | |
['France', 2, 1, 'Australia'], | |
['Argentina', 1, 1, 'Iceland'], | |
['Peru', 0, 1, 'Denmark'], | |
['Croatia', 2, 0, 'Nigeria'], |
const createModelHelpers = (model) => { | |
const query = (trx) => model.query(trx).withSchema('workout'); | |
const getById = ({ trx, id }) => query(trx).findById(id); | |
const insert = async ({ trx, input }) => query(trx).insert(input).returning('*'); | |
return { | |
query, |
Example mapping
{
properties: {
key: { type: 'keyword' },
title: { type: 'text' },
releases: {
type: 'nested',
query1 = ` | |
mutation { | |
startStreamableWorkout(input: { exerciseSchemaVersion: 1.0 }) { | |
workout { | |
exerciseSchema { | |
version | |
schema | |
} | |
} | |
} |