app-store-server-api
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -108,3 +108,3 @@ "use strict"; | ||
*/ | ||
AppStoreServerAPI.prototype.getTransactionHistory = function (originalTransactionId, query) { | ||
AppStoreServerAPI.prototype.getTransactionHistory = function (transactionId, query) { | ||
if (query === void 0) { query = {}; } | ||
@@ -114,3 +114,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
path = this.addQuery("/inApps/v1/history/".concat(originalTransactionId), __assign({}, query)); | ||
path = this.addQuery("/inApps/v1/history/".concat(transactionId), __assign({}, query)); | ||
return [2 /*return*/, this.makeRequest("GET", path)]; | ||
@@ -121,8 +121,21 @@ }); | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info | ||
*/ | ||
AppStoreServerAPI.prototype.getTransactionInfo = function (transactionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeRequest("GET", "/inApps/v1/transactions/".concat(transactionId))]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses | ||
*/ | ||
AppStoreServerAPI.prototype.getSubscriptionStatuses = function (originalTransactionId) { | ||
AppStoreServerAPI.prototype.getSubscriptionStatuses = function (transactionId, query) { | ||
if (query === void 0) { query = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var path; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeRequest("GET", "/inApps/v1/subscriptions/".concat(originalTransactionId))]; | ||
path = this.addQuery("/inApps/v1/subscriptions/".concat(transactionId), __assign({}, query)); | ||
return [2 /*return*/, this.makeRequest("GET", path)]; | ||
}); | ||
@@ -282,3 +295,11 @@ }); | ||
var _b = _a[_i], key = _b[0], value = _b[1]; | ||
params.set(key, value.toString()); | ||
if (Array.isArray(value)) { | ||
for (var _c = 0, value_1 = value; _c < value_1.length; _c++) { | ||
var item = value_1[_c]; | ||
params.append(key, item.toString()); | ||
} | ||
} | ||
else { | ||
params.set(key, value.toString()); | ||
} | ||
} | ||
@@ -285,0 +306,0 @@ var queryString = params.toString(); |
@@ -25,2 +25,3 @@ "use strict"; | ||
_this.isRetryable = AppStoreError.RETRYABLE_ERRORS.includes(errorCode); | ||
_this.isRateLimitExceeded = errorCode === 4290000; | ||
return _this; | ||
@@ -27,0 +28,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CertificateValidationError = exports.AppStoreError = exports.APPLE_ROOT_CA_G3_FINGERPRINT = exports.decodeNotificationPayload = exports.decodeRenewalInfo = exports.decodeTransaction = exports.decodeTransactions = exports.FirstSendAttemptResult = exports.NotificationSubtype = exports.NotificationType = exports.OrderLookupStatus = exports.TransactionType = exports.OwnershipType = exports.PriceIncreaseStatus = exports.OfferType = exports.ExpirationIntent = exports.AutoRenewStatus = exports.SubscriptionStatus = exports.ProductTypeParameter = exports.SortParameter = exports.Environment = exports.AppStoreServerAPI = void 0; | ||
exports.CertificateValidationError = exports.AppStoreError = exports.APPLE_ROOT_CA_G3_FINGERPRINT = exports.decodeNotificationPayload = exports.decodeRenewalInfo = exports.decodeTransaction = exports.decodeTransactions = exports.SendAttemptResult = exports.NotificationSubtype = exports.NotificationType = exports.OrderLookupStatus = exports.TransactionReason = exports.TransactionType = exports.OwnershipType = exports.PriceIncreaseStatus = exports.OfferType = exports.ExpirationIntent = exports.AutoRenewStatus = exports.SubscriptionStatus = exports.ProductTypeParameter = exports.SortParameter = exports.Environment = exports.AppStoreServerAPI = void 0; | ||
var AppStoreServerAPI_1 = require("./AppStoreServerAPI"); | ||
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "AppStoreServerAPI", { enumerable: true, get: function () { return AppStoreServerAPI_1.AppStoreServerAPI; } }); | ||
Object.defineProperty(exports, "TransactionType", { enumerable: true, get: function () { return Models_1.TransactionType; } }); | ||
Object.defineProperty(exports, "TransactionReason", { enumerable: true, get: function () { return Models_1.TransactionReason; } }); | ||
Object.defineProperty(exports, "OrderLookupStatus", { enumerable: true, get: function () { return Models_1.OrderLookupStatus; } }); | ||
Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return Models_1.NotificationType; } }); | ||
Object.defineProperty(exports, "NotificationSubtype", { enumerable: true, get: function () { return Models_1.NotificationSubtype; } }); | ||
Object.defineProperty(exports, "FirstSendAttemptResult", { enumerable: true, get: function () { return Models_1.FirstSendAttemptResult; } }); | ||
Object.defineProperty(exports, "SendAttemptResult", { enumerable: true, get: function () { return Models_1.SendAttemptResult; } }); | ||
var Decoding_1 = require("./Decoding"); | ||
@@ -23,0 +24,0 @@ Object.defineProperty(exports, "decodeTransactions", { enumerable: true, get: function () { return Decoding_1.decodeTransactions; } }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FirstSendAttemptResult = exports.NotificationSubtype = exports.NotificationType = exports.OrderLookupStatus = exports.PriceIncreaseStatus = exports.OfferType = exports.ExpirationIntent = exports.AutoRenewStatus = exports.SubscriptionStatus = exports.TransactionType = exports.OwnershipType = exports.ProductTypeParameter = exports.SortParameter = exports.Environment = void 0; | ||
exports.SendAttemptResult = exports.NotificationSubtype = exports.NotificationType = exports.OrderLookupStatus = exports.PriceIncreaseStatus = exports.OfferType = exports.ExpirationIntent = exports.AutoRenewStatus = exports.SubscriptionStatus = exports.TransactionReason = exports.TransactionType = exports.OwnershipType = exports.ProductTypeParameter = exports.SortParameter = exports.Environment = void 0; | ||
var Environment; | ||
@@ -35,2 +35,8 @@ (function (Environment) { | ||
})(TransactionType = exports.TransactionType || (exports.TransactionType = {})); | ||
// https://developer.apple.com/documentation/appstoreservernotifications/transactionreason | ||
var TransactionReason; | ||
(function (TransactionReason) { | ||
TransactionReason["Purchase"] = "PURCHASE"; | ||
TransactionReason["Renewal"] = "RENEWAL"; | ||
})(TransactionReason = exports.TransactionReason || (exports.TransactionReason = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/status | ||
@@ -95,2 +101,4 @@ var SubscriptionStatus; | ||
NotificationType["Subscribed"] = "SUBSCRIBED"; | ||
NotificationType["RenewalExtension"] = "RENEWAL_EXTENSION"; | ||
NotificationType["RefundReversed"] = "REFUND_REVERSED"; | ||
})(NotificationType = exports.NotificationType || (exports.NotificationType = {})); | ||
@@ -113,16 +121,18 @@ // https://developer.apple.com/documentation/appstoreservernotifications/subtype | ||
NotificationSubtype["Accepted"] = "ACCEPTED"; | ||
NotificationSubtype["Summary"] = "SUMMARY"; | ||
NotificationSubtype["Failure"] = "FAILURE"; | ||
})(NotificationSubtype = exports.NotificationSubtype || (exports.NotificationSubtype = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/firstsendattemptresult | ||
var FirstSendAttemptResult; | ||
(function (FirstSendAttemptResult) { | ||
FirstSendAttemptResult["Success"] = "SUCCESS"; | ||
FirstSendAttemptResult["TimedOut"] = "TIMED_OUT"; | ||
FirstSendAttemptResult["SslIssue"] = "SSL_ISSUE"; | ||
FirstSendAttemptResult["CircularRedirect"] = "CIRCULAR_REDIRECT"; | ||
FirstSendAttemptResult["NoResponse"] = "NO_RESPONSE"; | ||
FirstSendAttemptResult["SocketIssue"] = "SOCKET_ISSUE"; | ||
FirstSendAttemptResult["UnsupportedCharset"] = "UNSUPPORTED_CHARSET"; | ||
FirstSendAttemptResult["InvalidResponse"] = "INVALID_RESPONSE"; | ||
FirstSendAttemptResult["PrematureClose"] = "PREMATURE_CLOSE"; | ||
FirstSendAttemptResult["Other"] = "OTHER"; | ||
})(FirstSendAttemptResult = exports.FirstSendAttemptResult || (exports.FirstSendAttemptResult = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/sendattemptresult | ||
var SendAttemptResult; | ||
(function (SendAttemptResult) { | ||
SendAttemptResult["Success"] = "SUCCESS"; | ||
SendAttemptResult["TimedOut"] = "TIMED_OUT"; | ||
SendAttemptResult["TlsIssue"] = "TLS_ISSUE"; | ||
SendAttemptResult["CircularRedirect"] = "CIRCULAR_REDIRECT"; | ||
SendAttemptResult["NoResponse"] = "NO_RESPONSE"; | ||
SendAttemptResult["SocketIssue"] = "SOCKET_ISSUE"; | ||
SendAttemptResult["UnsupportedCharset"] = "UNSUPPORTED_CHARSET"; | ||
SendAttemptResult["InvalidResponse"] = "INVALID_RESPONSE"; | ||
SendAttemptResult["PrematureClose"] = "PREMATURE_CLOSE"; | ||
SendAttemptResult["Other"] = "OTHER"; | ||
})(SendAttemptResult = exports.SendAttemptResult || (exports.SendAttemptResult = {})); |
@@ -79,3 +79,3 @@ var __assign = (this && this.__assign) || function () { | ||
*/ | ||
AppStoreServerAPI.prototype.getTransactionHistory = function (originalTransactionId, query) { | ||
AppStoreServerAPI.prototype.getTransactionHistory = function (transactionId, query) { | ||
if (query === void 0) { query = {}; } | ||
@@ -85,3 +85,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
path = this.addQuery("/inApps/v1/history/".concat(originalTransactionId), __assign({}, query)); | ||
path = this.addQuery("/inApps/v1/history/".concat(transactionId), __assign({}, query)); | ||
return [2 /*return*/, this.makeRequest("GET", path)]; | ||
@@ -92,8 +92,21 @@ }); | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info | ||
*/ | ||
AppStoreServerAPI.prototype.getTransactionInfo = function (transactionId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeRequest("GET", "/inApps/v1/transactions/".concat(transactionId))]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses | ||
*/ | ||
AppStoreServerAPI.prototype.getSubscriptionStatuses = function (originalTransactionId) { | ||
AppStoreServerAPI.prototype.getSubscriptionStatuses = function (transactionId, query) { | ||
if (query === void 0) { query = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var path; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.makeRequest("GET", "/inApps/v1/subscriptions/".concat(originalTransactionId))]; | ||
path = this.addQuery("/inApps/v1/subscriptions/".concat(transactionId), __assign({}, query)); | ||
return [2 /*return*/, this.makeRequest("GET", path)]; | ||
}); | ||
@@ -253,3 +266,11 @@ }); | ||
var _b = _a[_i], key = _b[0], value = _b[1]; | ||
params.set(key, value.toString()); | ||
if (Array.isArray(value)) { | ||
for (var _c = 0, value_1 = value; _c < value_1.length; _c++) { | ||
var item = value_1[_c]; | ||
params.append(key, item.toString()); | ||
} | ||
} | ||
else { | ||
params.set(key, value.toString()); | ||
} | ||
} | ||
@@ -256,0 +277,0 @@ var queryString = params.toString(); |
@@ -22,2 +22,3 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.isRetryable = AppStoreError.RETRYABLE_ERRORS.includes(errorCode); | ||
_this.isRateLimitExceeded = errorCode === 4290000; | ||
return _this; | ||
@@ -24,0 +25,0 @@ } |
export { AppStoreServerAPI } from "./AppStoreServerAPI"; | ||
export { Environment, SortParameter, ProductTypeParameter, SubscriptionStatus, AutoRenewStatus, ExpirationIntent, OfferType, PriceIncreaseStatus, OwnershipType, TransactionType, OrderLookupStatus, NotificationType, NotificationSubtype, FirstSendAttemptResult } from "./Models"; | ||
export { Environment, SortParameter, ProductTypeParameter, SubscriptionStatus, AutoRenewStatus, ExpirationIntent, OfferType, PriceIncreaseStatus, OwnershipType, TransactionType, TransactionReason, OrderLookupStatus, NotificationType, NotificationSubtype, SendAttemptResult } from "./Models"; | ||
export { decodeTransactions, decodeTransaction, decodeRenewalInfo, decodeNotificationPayload } from "./Decoding"; | ||
export { APPLE_ROOT_CA_G3_FINGERPRINT } from "./AppleRootCertificate"; | ||
export { AppStoreError, CertificateValidationError } from "./Errors"; |
@@ -32,2 +32,8 @@ export var Environment; | ||
})(TransactionType || (TransactionType = {})); | ||
// https://developer.apple.com/documentation/appstoreservernotifications/transactionreason | ||
export var TransactionReason; | ||
(function (TransactionReason) { | ||
TransactionReason["Purchase"] = "PURCHASE"; | ||
TransactionReason["Renewal"] = "RENEWAL"; | ||
})(TransactionReason || (TransactionReason = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/status | ||
@@ -92,2 +98,4 @@ export var SubscriptionStatus; | ||
NotificationType["Subscribed"] = "SUBSCRIBED"; | ||
NotificationType["RenewalExtension"] = "RENEWAL_EXTENSION"; | ||
NotificationType["RefundReversed"] = "REFUND_REVERSED"; | ||
})(NotificationType || (NotificationType = {})); | ||
@@ -110,16 +118,18 @@ // https://developer.apple.com/documentation/appstoreservernotifications/subtype | ||
NotificationSubtype["Accepted"] = "ACCEPTED"; | ||
NotificationSubtype["Summary"] = "SUMMARY"; | ||
NotificationSubtype["Failure"] = "FAILURE"; | ||
})(NotificationSubtype || (NotificationSubtype = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/firstsendattemptresult | ||
export var FirstSendAttemptResult; | ||
(function (FirstSendAttemptResult) { | ||
FirstSendAttemptResult["Success"] = "SUCCESS"; | ||
FirstSendAttemptResult["TimedOut"] = "TIMED_OUT"; | ||
FirstSendAttemptResult["SslIssue"] = "SSL_ISSUE"; | ||
FirstSendAttemptResult["CircularRedirect"] = "CIRCULAR_REDIRECT"; | ||
FirstSendAttemptResult["NoResponse"] = "NO_RESPONSE"; | ||
FirstSendAttemptResult["SocketIssue"] = "SOCKET_ISSUE"; | ||
FirstSendAttemptResult["UnsupportedCharset"] = "UNSUPPORTED_CHARSET"; | ||
FirstSendAttemptResult["InvalidResponse"] = "INVALID_RESPONSE"; | ||
FirstSendAttemptResult["PrematureClose"] = "PREMATURE_CLOSE"; | ||
FirstSendAttemptResult["Other"] = "OTHER"; | ||
})(FirstSendAttemptResult || (FirstSendAttemptResult = {})); | ||
// https://developer.apple.com/documentation/appstoreserverapi/sendattemptresult | ||
export var SendAttemptResult; | ||
(function (SendAttemptResult) { | ||
SendAttemptResult["Success"] = "SUCCESS"; | ||
SendAttemptResult["TimedOut"] = "TIMED_OUT"; | ||
SendAttemptResult["TlsIssue"] = "TLS_ISSUE"; | ||
SendAttemptResult["CircularRedirect"] = "CIRCULAR_REDIRECT"; | ||
SendAttemptResult["NoResponse"] = "NO_RESPONSE"; | ||
SendAttemptResult["SocketIssue"] = "SOCKET_ISSUE"; | ||
SendAttemptResult["UnsupportedCharset"] = "UNSUPPORTED_CHARSET"; | ||
SendAttemptResult["InvalidResponse"] = "INVALID_RESPONSE"; | ||
SendAttemptResult["PrematureClose"] = "PREMATURE_CLOSE"; | ||
SendAttemptResult["Other"] = "OTHER"; | ||
})(SendAttemptResult || (SendAttemptResult = {})); |
@@ -1,2 +0,2 @@ | ||
import { CheckTestNotificationResponse, Environment, HistoryResponse, NotificationHistoryQuery, NotificationHistoryRequest, NotificationHistoryResponse, OrderLookupResponse, SendTestNotificationResponse, StatusResponse, TransactionHistoryQuery } from "./Models"; | ||
import { CheckTestNotificationResponse, Environment, HistoryResponse, NotificationHistoryQuery, NotificationHistoryRequest, NotificationHistoryResponse, OrderLookupResponse, SendTestNotificationResponse, StatusResponse, SubscriptionStatusesQuery, TransactionHistoryQuery, TransactionInfoResponse } from "./Models"; | ||
export declare class AppStoreServerAPI { | ||
@@ -22,7 +22,11 @@ static readonly maxTokenAge: number; | ||
*/ | ||
getTransactionHistory(originalTransactionId: string, query?: TransactionHistoryQuery): Promise<HistoryResponse>; | ||
getTransactionHistory(transactionId: string, query?: TransactionHistoryQuery): Promise<HistoryResponse>; | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info | ||
*/ | ||
getTransactionInfo(transactionId: string): Promise<TransactionInfoResponse>; | ||
/** | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses | ||
*/ | ||
getSubscriptionStatuses(originalTransactionId: string): Promise<StatusResponse>; | ||
getSubscriptionStatuses(transactionId: string, query?: SubscriptionStatusesQuery): Promise<StatusResponse>; | ||
/** | ||
@@ -29,0 +33,0 @@ * https://developer.apple.com/documentation/appstoreserverapi/look_up_order_id |
@@ -5,2 +5,3 @@ export declare class AppStoreError extends Error { | ||
isRetryable: boolean; | ||
isRateLimitExceeded: boolean; | ||
constructor(errorCode: number, errorMessage: string); | ||
@@ -7,0 +8,0 @@ } |
export { AppStoreServerAPI } from "./AppStoreServerAPI"; | ||
export { Environment, Timestamp, SortParameter, ProductTypeParameter, TransactionHistoryQuery, SubscriptionStatus, AutoRenewStatus, ExpirationIntent, OfferType, PriceIncreaseStatus, JWSTransactionDecodedPayload, OwnershipType, TransactionType, StatusResponse, LastTransactionsItem, JWSRenewalInfoDecodedPayload, HistoryResponse, SubscriptionGroupIdentifierItem, OrderLookupResponse, OrderLookupStatus, DecodedNotificationPayload, NotificationData, NotificationType, NotificationSubtype, SendTestNotificationResponse, CheckTestNotificationResponse, FirstSendAttemptResult, NotificationHistoryQuery, NotificationHistoryRequest, NotificationHistoryResponse, NotificationHistoryResponseItem } from "./Models"; | ||
export { Environment, Timestamp, StorefrontCountryCode, SortParameter, ProductTypeParameter, TransactionHistoryQuery, SubscriptionStatus, AutoRenewStatus, ExpirationIntent, OfferType, PriceIncreaseStatus, JWSTransactionDecodedPayload, OwnershipType, TransactionType, TransactionReason, StatusResponse, SubscriptionStatusesQuery, LastTransactionsItem, JWSRenewalInfoDecodedPayload, HistoryResponse, TransactionInfoResponse, SubscriptionGroupIdentifierItem, OrderLookupResponse, OrderLookupStatus, DecodedNotificationPayload, NotificationData, NotificationSummary, NotificationType, NotificationSubtype, SendTestNotificationResponse, CheckTestNotificationResponse, SendAttemptResult, NotificationHistoryQuery, NotificationHistoryRequest, NotificationHistoryResponse, NotificationHistoryResponseItem } from "./Models"; | ||
export { decodeTransactions, decodeTransaction, decodeRenewalInfo, decodeNotificationPayload } from "./Decoding"; | ||
export { APPLE_ROOT_CA_G3_FINGERPRINT } from "./AppleRootCertificate"; | ||
export { AppStoreError, CertificateValidationError } from "./Errors"; |
@@ -9,2 +9,7 @@ export declare enum Environment { | ||
export type Timestamp = number; | ||
/** | ||
* ISO 3166-1 Alpha-3 country code | ||
* https://developer.apple.com/documentation/appstoreservernotifications/storefrontcountrycode | ||
*/ | ||
export type StorefrontCountryCode = string; | ||
export declare enum SortParameter { | ||
@@ -23,2 +28,3 @@ Ascending = "ASCENDING", | ||
* to filter results and change sort order. | ||
* https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history | ||
*/ | ||
@@ -34,3 +40,3 @@ export interface TransactionHistoryQuery { | ||
inAppOwnershipType?: OwnershipType; | ||
excludeRevoked?: boolean; | ||
revoked?: boolean; | ||
} | ||
@@ -45,2 +51,5 @@ export interface HistoryResponse { | ||
} | ||
export interface TransactionInfoResponse { | ||
signedTransactionInfo: JWSTransaction; | ||
} | ||
export type JWSTransaction = string; | ||
@@ -69,4 +78,7 @@ export interface JWSDecodedHeader { | ||
signedDate: Timestamp; | ||
storefront: StorefrontCountryCode; | ||
storefrontId: string; | ||
subscriptionGroupIdentifier?: string; | ||
transactionId: string; | ||
transactionReason: TransactionReason; | ||
type: TransactionType; | ||
@@ -85,2 +97,9 @@ webOrderLineItemId: string; | ||
} | ||
export declare enum TransactionReason { | ||
Purchase = "PURCHASE", | ||
Renewal = "RENEWAL" | ||
} | ||
export interface SubscriptionStatusesQuery { | ||
status?: SubscriptionStatus[]; | ||
} | ||
export interface StatusResponse { | ||
@@ -123,2 +142,3 @@ data: SubscriptionGroupIdentifierItem[]; | ||
recentSubscriptionStartDate: Timestamp; | ||
renewalDate: Timestamp; | ||
signedDate: Timestamp; | ||
@@ -160,2 +180,3 @@ } | ||
data: NotificationData; | ||
summary: NotificationSummary; | ||
} | ||
@@ -169,3 +190,14 @@ export interface NotificationData { | ||
signedTransactionInfo: JWSTransaction; | ||
status?: SubscriptionStatus; | ||
} | ||
export interface NotificationSummary { | ||
requestIdentifier: string; | ||
environment: Environment; | ||
appAppleId: string; | ||
bundleId: string; | ||
productId: string; | ||
storefrontCountryCodes?: StorefrontCountryCode[]; | ||
failedCount: number; | ||
succeededCount: number; | ||
} | ||
export declare enum NotificationType { | ||
@@ -185,3 +217,5 @@ ConsumptionRequest = "CONSUMPTION_REQUEST", | ||
Revoke = "REVOKE", | ||
Subscribed = "SUBSCRIBED" | ||
Subscribed = "SUBSCRIBED", | ||
RenewalExtension = "RENEWAL_EXTENSION", | ||
RefundReversed = "REFUND_REVERSED" | ||
} | ||
@@ -201,3 +235,5 @@ export declare enum NotificationSubtype { | ||
Pending = "PENDING", | ||
Accepted = "ACCEPTED" | ||
Accepted = "ACCEPTED", | ||
Summary = "SUMMARY", | ||
Failure = "FAILURE" | ||
} | ||
@@ -208,9 +244,13 @@ export interface SendTestNotificationResponse { | ||
export interface CheckTestNotificationResponse { | ||
firstSendAttemptResult: FirstSendAttemptResult; | ||
sendAttempts: SendAttempt[]; | ||
signedPayload: string; | ||
} | ||
export declare enum FirstSendAttemptResult { | ||
export interface SendAttempt { | ||
attemptDate: Timestamp; | ||
sendAttemptResult: SendAttemptResult; | ||
} | ||
export declare enum SendAttemptResult { | ||
Success = "SUCCESS", | ||
TimedOut = "TIMED_OUT", | ||
SslIssue = "SSL_ISSUE", | ||
TlsIssue = "TLS_ISSUE", | ||
CircularRedirect = "CIRCULAR_REDIRECT", | ||
@@ -230,5 +270,6 @@ NoResponse = "NO_RESPONSE", | ||
endDate: Timestamp; | ||
originalTransactionId?: string; | ||
notificationType?: NotificationType; | ||
notificationSubtype?: NotificationSubtype; | ||
onlyFailures?: boolean; | ||
transactionId?: string; | ||
} | ||
@@ -241,4 +282,4 @@ export interface NotificationHistoryResponse { | ||
export interface NotificationHistoryResponseItem { | ||
firstSendAttemptResult: FirstSendAttemptResult; | ||
sendAttempts: SendAttempt[]; | ||
signedPayload: string; | ||
} |
{ | ||
"name": "app-store-server-api", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "A client for the App Store Server API", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -163,2 +163,5 @@ # app-store-server-api | ||
## Resources | ||
- [App Store Server API changelog](https://developer.apple.com/documentation/appstoreserverapi/app_store_server_api_changelog) | ||
- [App Store Server Notifications changelog](https://developer.apple.com/documentation/appstoreservernotifications/app_store_server_notifications_changelog/) | ||
- [Apple App Store Server Node.js Library](https://github.com/apple/app-store-server-library-node) | ||
WWDC videos: | ||
@@ -169,4 +172,5 @@ - [Manage in-app purchases on your server](https://developer.apple.com/videos/play/wwdc2021/10174/) | ||
- [What's new with in-app purchase](https://developer.apple.com/videos/play/wwdc2022/10007/) | ||
- [What's new in App Store server APIs](https://developer.apple.com/videos/play/wwdc2023/10141/) | ||
## License | ||
MIT |
92109
1667
175