@onesub/server 0.12.1 → 0.13.0

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.
Files changed (118) hide show
  1. package/dist/__tests__/admin-customer-detail.test.js +146 -0
  2. package/dist/__tests__/admin-customer-detail.test.js.map +1 -0
  3. package/dist/__tests__/admin-list-subscriptions.test.js +192 -0
  4. package/dist/__tests__/admin-list-subscriptions.test.js.map +1 -0
  5. package/dist/__tests__/admin-subscription-detail.test.js +112 -0
  6. package/dist/__tests__/admin-subscription-detail.test.js.map +1 -0
  7. package/dist/__tests__/apple-root-ca.test.js +41 -0
  8. package/dist/__tests__/apple-root-ca.test.js.map +1 -0
  9. package/dist/__tests__/apple-status-api.test.js +345 -0
  10. package/dist/__tests__/apple-status-api.test.js.map +1 -0
  11. package/dist/__tests__/cache.test.js +34 -0
  12. package/dist/__tests__/cache.test.js.map +1 -0
  13. package/dist/__tests__/entitlements.test.js +268 -0
  14. package/dist/__tests__/entitlements.test.js.map +1 -0
  15. package/dist/__tests__/error-codes.test.js +168 -0
  16. package/dist/__tests__/error-codes.test.js.map +1 -0
  17. package/dist/__tests__/fetch-hardening.test.js +192 -0
  18. package/dist/__tests__/fetch-hardening.test.js.map +1 -0
  19. package/dist/__tests__/google-paused.test.js +126 -0
  20. package/dist/__tests__/google-paused.test.js.map +1 -0
  21. package/dist/__tests__/google-price-change.test.js +186 -0
  22. package/dist/__tests__/google-price-change.test.js.map +1 -0
  23. package/dist/__tests__/google-subscriptions-v2.test.js +206 -0
  24. package/dist/__tests__/google-subscriptions-v2.test.js.map +1 -0
  25. package/dist/__tests__/lifecycle-scenarios.test.js +579 -0
  26. package/dist/__tests__/lifecycle-scenarios.test.js.map +1 -0
  27. package/dist/__tests__/lifecycle-states.test.js +423 -0
  28. package/dist/__tests__/lifecycle-states.test.js.map +1 -0
  29. package/dist/__tests__/linked-purchase-token.test.js +227 -0
  30. package/dist/__tests__/linked-purchase-token.test.js.map +1 -0
  31. package/dist/__tests__/metrics.test.js +340 -0
  32. package/dist/__tests__/metrics.test.js.map +1 -0
  33. package/dist/__tests__/mock-provider.test.js +188 -0
  34. package/dist/__tests__/mock-provider.test.js.map +1 -0
  35. package/dist/__tests__/openapi.test.js +32 -0
  36. package/dist/__tests__/openapi.test.js.map +1 -0
  37. package/dist/__tests__/paused-auto-resume.test.js +162 -0
  38. package/dist/__tests__/paused-auto-resume.test.js.map +1 -0
  39. package/dist/__tests__/providers.test.js +321 -0
  40. package/dist/__tests__/providers.test.js.map +1 -0
  41. package/dist/__tests__/redis-store.test.js +117 -0
  42. package/dist/__tests__/redis-store.test.js.map +1 -0
  43. package/dist/__tests__/refund-policy.test.js +317 -0
  44. package/dist/__tests__/refund-policy.test.js.map +1 -0
  45. package/dist/__tests__/schema.test.js +46 -0
  46. package/dist/__tests__/schema.test.js.map +1 -0
  47. package/dist/__tests__/store.test.js +172 -0
  48. package/dist/__tests__/store.test.js.map +1 -0
  49. package/dist/__tests__/test-utils.js +30 -0
  50. package/dist/__tests__/test-utils.js.map +1 -0
  51. package/dist/__tests__/webhook-events.test.js +36 -0
  52. package/dist/__tests__/webhook-events.test.js.map +1 -0
  53. package/dist/__tests__/webhook-queue.test.js +26 -0
  54. package/dist/__tests__/webhook-queue.test.js.map +1 -0
  55. package/dist/__tests__/webhook-refund.test.js +313 -0
  56. package/dist/__tests__/webhook-refund.test.js.map +1 -0
  57. package/dist/cache.js +43 -0
  58. package/dist/cache.js.map +1 -0
  59. package/dist/errors.js +19 -0
  60. package/dist/errors.js.map +1 -0
  61. package/dist/http.js +36 -0
  62. package/dist/http.js.map +1 -0
  63. package/dist/index.cjs +231 -6
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +231 -8
  68. package/dist/index.js.map +1 -1
  69. package/dist/logger.js +20 -0
  70. package/dist/logger.js.map +1 -0
  71. package/dist/openapi.js +196 -0
  72. package/dist/openapi.js.map +1 -0
  73. package/dist/providers/apple-root-ca.js +38 -0
  74. package/dist/providers/apple-root-ca.js.map +1 -0
  75. package/dist/providers/apple.d.ts +76 -0
  76. package/dist/providers/apple.d.ts.map +1 -1
  77. package/dist/providers/apple.js +510 -0
  78. package/dist/providers/apple.js.map +1 -0
  79. package/dist/providers/google.d.ts +25 -0
  80. package/dist/providers/google.d.ts.map +1 -1
  81. package/dist/providers/google.js +522 -0
  82. package/dist/providers/google.js.map +1 -0
  83. package/dist/providers/mock.js +93 -0
  84. package/dist/providers/mock.js.map +1 -0
  85. package/dist/routes/admin.d.ts.map +1 -1
  86. package/dist/routes/admin.js +287 -0
  87. package/dist/routes/admin.js.map +1 -0
  88. package/dist/routes/apple-offer.d.ts +21 -0
  89. package/dist/routes/apple-offer.d.ts.map +1 -0
  90. package/dist/routes/entitlements.js +130 -0
  91. package/dist/routes/entitlements.js.map +1 -0
  92. package/dist/routes/metrics.js +281 -0
  93. package/dist/routes/metrics.js.map +1 -0
  94. package/dist/routes/purchase.js +187 -0
  95. package/dist/routes/purchase.js.map +1 -0
  96. package/dist/routes/status.js +55 -0
  97. package/dist/routes/status.js.map +1 -0
  98. package/dist/routes/validate.js +70 -0
  99. package/dist/routes/validate.js.map +1 -0
  100. package/dist/routes/webhook-apple.d.ts.map +1 -1
  101. package/dist/routes/webhook-google.d.ts.map +1 -1
  102. package/dist/routes/webhook.js +461 -0
  103. package/dist/routes/webhook.js.map +1 -0
  104. package/dist/store.js +145 -0
  105. package/dist/store.js.map +1 -0
  106. package/dist/stores/postgres.js +329 -0
  107. package/dist/stores/postgres.js.map +1 -0
  108. package/dist/stores/redis.js +255 -0
  109. package/dist/stores/redis.js.map +1 -0
  110. package/dist/stores/schema.js +67 -0
  111. package/dist/stores/schema.js.map +1 -0
  112. package/dist/tracing.js +74 -0
  113. package/dist/tracing.js.map +1 -0
  114. package/dist/webhook-events.js +57 -0
  115. package/dist/webhook-events.js.map +1 -0
  116. package/dist/webhook-queue.js +108 -0
  117. package/dist/webhook-queue.js.map +1 -0
  118. package/package.json +2 -2
package/dist/logger.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Process-wide logger used by @onesub/server's providers and routes.
3
+ *
4
+ * Defaults to `console`. `createOneSubMiddleware()` calls `setLogger()` once
5
+ * during setup if `config.logger` is provided. All internal call sites should
6
+ * import `log` from this module instead of calling `console.*` directly so
7
+ * operators can redirect logs (pino / winston / bunyan) with a single config
8
+ * setting.
9
+ */
10
+ let current = console;
11
+ export function setLogger(logger) {
12
+ if (logger)
13
+ current = logger;
14
+ }
15
+ export const log = {
16
+ info: (...args) => current.info(...args),
17
+ warn: (...args) => current.warn(...args),
18
+ error: (...args) => current.error(...args),
19
+ };
20
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,IAAI,OAAO,GAAiB,OAAO,CAAC;AAEpC,MAAM,UAAU,SAAS,CAAC,MAAgC;IACxD,IAAI,MAAM;QAAE,OAAO,GAAG,MAAM,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAiB;IAC/B,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAC3C,CAAC"}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * OpenAPI 3.1 spec for the onesub HTTP surface.
3
+ *
4
+ * Hand-maintained — kept in sync with the routes by a parity test (see
5
+ * __tests__/openapi.test.ts) that asserts every mounted path is described
6
+ * here. Generated clients live downstream:
7
+ *
8
+ * - swagger-typescript-api → typed fetch client
9
+ * - openapi-generator-cli → Kotlin/Swift/etc. clients
10
+ *
11
+ * Why hand-maintained instead of zod-to-openapi: the routes use zod for
12
+ * input validation but the request/response shapes the public docs need are
13
+ * a thin slice of those internal types. Hand-writing keeps the doc readable
14
+ * without coupling client output to internal validation strictness changes.
15
+ */
16
+ import { ROUTES } from '@onesub/shared';
17
+ export const ONESUB_OPENAPI = {
18
+ openapi: '3.1.0',
19
+ info: {
20
+ title: 'onesub HTTP API',
21
+ version: '1.0.0',
22
+ description: 'Receipt validation, subscription status, webhooks, and admin endpoints exposed by `createOneSubMiddleware`.',
23
+ },
24
+ servers: [
25
+ { url: 'http://localhost:4100', description: 'Local dev (examples/server)' },
26
+ ],
27
+ paths: {
28
+ [ROUTES.VALIDATE]: {
29
+ post: {
30
+ summary: 'Validate an Apple/Google receipt and persist subscription state.',
31
+ requestBody: {
32
+ required: true,
33
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/ValidateRequest' } } },
34
+ },
35
+ responses: {
36
+ 200: { description: 'Validation succeeded; subscription state persisted.', content: { 'application/json': { schema: { $ref: '#/components/schemas/ValidateResponse' } } } },
37
+ 400: { description: 'Bad request — missing fields, malformed receipt, package mismatch.' },
38
+ },
39
+ },
40
+ },
41
+ [ROUTES.STATUS]: {
42
+ get: {
43
+ summary: 'Fetch the most recent subscription state for a user.',
44
+ parameters: [{ in: 'query', name: 'userId', required: true, schema: { type: 'string' } }],
45
+ responses: {
46
+ 200: { description: 'OK', content: { 'application/json': { schema: { $ref: '#/components/schemas/StatusResponse' } } } },
47
+ },
48
+ },
49
+ },
50
+ [ROUTES.WEBHOOK_APPLE]: {
51
+ post: {
52
+ summary: 'Apple App Store Server Notification V2 receiver.',
53
+ description: 'Apple POSTs `{ signedPayload }`. JWS-verified, idempotent when `webhookEventStore` is configured.',
54
+ responses: {
55
+ 200: { description: 'Acknowledged.' },
56
+ 400: { description: 'Missing or invalid signedPayload.' },
57
+ },
58
+ },
59
+ },
60
+ [ROUTES.WEBHOOK_GOOGLE]: {
61
+ post: {
62
+ summary: 'Google Play Real-Time Developer Notification (Pub/Sub push) receiver.',
63
+ responses: {
64
+ 200: { description: 'Acknowledged.' },
65
+ 400: { description: 'Missing message.data or package mismatch.' },
66
+ 401: { description: 'pushAudience configured and JWT verification failed.' },
67
+ },
68
+ },
69
+ },
70
+ [ROUTES.ENTITLEMENTS]: {
71
+ get: {
72
+ summary: 'Evaluate every configured entitlement for a user.',
73
+ parameters: [{ in: 'query', name: 'userId', required: true, schema: { type: 'string' } }],
74
+ responses: {
75
+ 200: { description: 'Map of entitlementId → { granted, source }.' },
76
+ },
77
+ },
78
+ },
79
+ [ROUTES.ADMIN_SUBSCRIPTIONS]: {
80
+ get: {
81
+ summary: 'Filtered, paginated subscription list (admin).',
82
+ parameters: [
83
+ { in: 'header', name: 'X-Admin-Secret', required: true, schema: { type: 'string' } },
84
+ { in: 'query', name: 'userId', schema: { type: 'string' } },
85
+ { in: 'query', name: 'status', schema: { type: 'string', enum: ['active', 'grace_period', 'on_hold', 'paused', 'expired', 'canceled', 'none'] } },
86
+ { in: 'query', name: 'productId', schema: { type: 'string' } },
87
+ { in: 'query', name: 'platform', schema: { type: 'string', enum: ['apple', 'google'] } },
88
+ { in: 'query', name: 'limit', schema: { type: 'integer', minimum: 1, maximum: 200 } },
89
+ { in: 'query', name: 'offset', schema: { type: 'integer', minimum: 0 } },
90
+ ],
91
+ responses: { 200: { description: 'OK' }, 401: { description: 'Invalid admin secret' } },
92
+ },
93
+ },
94
+ '/onesub/admin/customers/{userId}': {
95
+ get: {
96
+ summary: 'Customer profile bundle: subscriptions + purchases + entitlements (admin).',
97
+ parameters: [
98
+ { in: 'header', name: 'X-Admin-Secret', required: true, schema: { type: 'string' } },
99
+ { in: 'path', name: 'userId', required: true, schema: { type: 'string' } },
100
+ ],
101
+ responses: { 200: { description: 'OK' }, 401: { description: 'Invalid admin secret' } },
102
+ },
103
+ },
104
+ '/onesub/admin/webhook-deadletters': {
105
+ get: {
106
+ summary: 'List failed webhook jobs (when a queue with DLQ support is configured).',
107
+ parameters: [{ in: 'header', name: 'X-Admin-Secret', required: true, schema: { type: 'string' } }],
108
+ responses: { 200: { description: 'OK' }, 401: { description: 'Invalid admin secret' } },
109
+ },
110
+ },
111
+ '/onesub/admin/webhook-replay/{id}': {
112
+ post: {
113
+ summary: 'Replay a dead-letter job through the webhook handler.',
114
+ parameters: [
115
+ { in: 'header', name: 'X-Admin-Secret', required: true, schema: { type: 'string' } },
116
+ { in: 'path', name: 'id', required: true, schema: { type: 'string' } },
117
+ ],
118
+ responses: { 200: { description: 'OK' }, 401: { description: 'Invalid admin secret' } },
119
+ },
120
+ },
121
+ },
122
+ components: {
123
+ schemas: {
124
+ ValidateRequest: {
125
+ type: 'object',
126
+ required: ['userId', 'platform', 'productId', 'receipt'],
127
+ properties: {
128
+ userId: { type: 'string' },
129
+ platform: { type: 'string', enum: ['apple', 'google'] },
130
+ productId: { type: 'string' },
131
+ receipt: { type: 'string', description: 'Apple JWS or Google purchaseToken' },
132
+ purchaseType: { type: 'string', enum: ['subscription', 'consumable', 'non_consumable'] },
133
+ },
134
+ },
135
+ ValidateResponse: {
136
+ type: 'object',
137
+ properties: {
138
+ valid: { type: 'boolean' },
139
+ subscription: { $ref: '#/components/schemas/SubscriptionInfo' },
140
+ purchase: { $ref: '#/components/schemas/PurchaseInfo' },
141
+ },
142
+ },
143
+ StatusResponse: {
144
+ type: 'object',
145
+ properties: {
146
+ active: { type: 'boolean' },
147
+ subscription: { $ref: '#/components/schemas/SubscriptionInfo' },
148
+ },
149
+ },
150
+ SubscriptionInfo: {
151
+ type: 'object',
152
+ properties: {
153
+ originalTransactionId: { type: 'string' },
154
+ userId: { type: 'string' },
155
+ productId: { type: 'string' },
156
+ platform: { type: 'string', enum: ['apple', 'google'] },
157
+ status: { type: 'string', enum: ['active', 'grace_period', 'on_hold', 'paused', 'expired', 'canceled', 'none'] },
158
+ expiresAt: { type: 'string', format: 'date-time' },
159
+ purchasedAt: { type: 'string', format: 'date-time' },
160
+ willRenew: { type: 'boolean' },
161
+ },
162
+ },
163
+ PurchaseInfo: {
164
+ type: 'object',
165
+ properties: {
166
+ transactionId: { type: 'string' },
167
+ userId: { type: 'string' },
168
+ productId: { type: 'string' },
169
+ platform: { type: 'string', enum: ['apple', 'google'] },
170
+ type: { type: 'string', enum: ['consumable', 'non_consumable'] },
171
+ quantity: { type: 'integer' },
172
+ purchasedAt: { type: 'string', format: 'date-time' },
173
+ },
174
+ },
175
+ },
176
+ securitySchemes: {
177
+ AdminSecret: {
178
+ type: 'apiKey',
179
+ in: 'header',
180
+ name: 'X-Admin-Secret',
181
+ },
182
+ },
183
+ },
184
+ };
185
+ /**
186
+ * Mount a route that serves the OpenAPI document. Useful for hosts that want
187
+ * to expose `/openapi.json` to API explorers / SDK generators.
188
+ *
189
+ * app.use('/openapi.json', openapiHandler());
190
+ */
191
+ export function openapiHandler() {
192
+ return (_req, res) => {
193
+ res.json(ONESUB_OPENAPI);
194
+ };
195
+ }
196
+ //# sourceMappingURL=openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.js","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAiBxC,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE;QACJ,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,OAAO;QAChB,WAAW,EACT,6GAA6G;KAChH;IACD,OAAO,EAAE;QACP,EAAE,GAAG,EAAE,uBAAuB,EAAE,WAAW,EAAE,6BAA6B,EAAE;KAC7E;IACD,KAAK,EAAE;QACL,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACjB,IAAI,EAAE;gBACJ,OAAO,EAAE,kEAAkE;gBAC3E,WAAW,EAAE;oBACX,QAAQ,EAAE,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EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC7B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;oBACvD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAAE;oBAChE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;iBACrD;aACF;SACF;QACD,eAAe,EAAE;YACf,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,EAAE,EAAE,QAAQ;gBACZ,IAAI,EAAE,gBAAgB;aACvB;SACF;KACF;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,IAA+B,EAAE,GAA+B,EAAE,EAAE;QAC1E,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3B,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Apple Root CA certificates used to verify StoreKit 2 signed transactions.
3
+ *
4
+ * Apple signs JWS transactions with an ECDSA key; the signing certificate
5
+ * chain is embedded in the JWS `x5c` header. To trust the leaf key we must
6
+ * validate the chain all the way up to one of Apple's published root CAs.
7
+ *
8
+ * Source: https://www.apple.com/certificateauthority/
9
+ * These certificates are public and static. Update this list if Apple
10
+ * publishes a new root — existing JWS signed with older roots continue to
11
+ * validate against their original root.
12
+ */
13
+ /**
14
+ * Apple Root CA - G3 (current root for StoreKit 2 / App Store Server API).
15
+ * SHA-256 fingerprint: 63343ABF B89A6A03 EB994052 C5ADBBF8 A87E2C46 81F6F0FC C8A4DA48 95F0FBBF
16
+ * Valid: 2014-04-30 — 2039-04-30
17
+ */
18
+ export const APPLE_ROOT_CA_G3_PEM = `-----BEGIN CERTIFICATE-----
19
+ MIICQzCCAcmgAwIBAgIILcX8iNLFS5UwCgYIKoZIzj0EAwMwZzEbMBkGA1UEAwwS
20
+ QXBwbGUgUm9vdCBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9u
21
+ IEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcN
22
+ MTQwNDMwMTgxOTA2WhcNMzkwNDMwMTgxOTA2WjBnMRswGQYDVQQDDBJBcHBsZSBS
23
+ b290IENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9y
24
+ aXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzB2MBAGByqGSM49
25
+ AgEGBSuBBAAiA2IABJjpLz1AcqTtkyJygRMc3RCV8cWjTnHcFBbZDuWmBSp3ZHtf
26
+ TjjTuxxEtX/1H7YyYl3J6YRbTzBPEVoA/VhYDKX1DyxNB0cTddqXl5dvMVztK517
27
+ IDvYuVTZXpmkOlEKMaNCMEAwHQYDVR0OBBYEFLuw3qFYM4iapIqZ3r6966/ayySr
28
+ MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2gA
29
+ MGUCMQCD6cHEFl4aXTQY2e3v9GwOAEZLuN+yRhHFD/3meoyhpmvOwgPUnPWTxnS4
30
+ at+qIxUCMG1mihDK1A3UT82NQz60imOlM27jbdoXt2QfyFMm+YhidDkLF1vLUagM
31
+ 6BgD56KyKA==
32
+ -----END CERTIFICATE-----`;
33
+ /**
34
+ * All Apple root CAs accepted for StoreKit 2 JWS validation.
35
+ * Currently only G3; add G4 here when Apple publishes it.
36
+ */
37
+ export const APPLE_ROOT_CA_PEMS = [APPLE_ROOT_CA_G3_PEM];
38
+ //# sourceMappingURL=apple-root-ca.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-root-ca.js","sourceRoot":"","sources":["../../src/providers/apple-root-ca.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;0BAcV,CAAC;AAE3B;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,oBAAoB,CAAC,CAAC"}
@@ -58,6 +58,19 @@ export declare function decodeAppleNotification(payload: AppleNotificationPayloa
58
58
  willRenew: boolean;
59
59
  /** May be null for non-subscription notifications (consumable refund). */
60
60
  expiresAt: string | null;
61
+ /**
62
+ * UUID the app set via setAppAccountToken at purchase time. For onesub this
63
+ * maps directly to userId. Present for both PURCHASED and FAMILY_SHARED
64
+ * ownership types when the host linked a user account at checkout time.
65
+ * Null when not set (sandbox, or host didn't call setAppAccountToken).
66
+ */
67
+ appAccountToken: string | null;
68
+ /**
69
+ * 'PURCHASED' — the user bought this directly.
70
+ * 'FAMILY_SHARED' — a family member of the purchaser. The originalTransactionId
71
+ * and appAccountToken belong to the family member, not the purchaser.
72
+ */
73
+ inAppOwnershipType: string | null;
61
74
  } | null>;
62
75
  /** Test-only: clear the Apple JWT cache. Not exported. */
63
76
  declare function clearAppleJwtCacheForTests(): void;
@@ -98,5 +111,68 @@ export declare function sendAppleConsumptionResponse(transactionId: string, body
98
111
  export declare function fetchAppleSubscriptionStatus(originalTransactionId: string, config: AppleConfig, options?: {
99
112
  sandbox?: boolean;
100
113
  }): Promise<SubscriptionInfo | null>;
114
+ /**
115
+ * Decoded lightweight transaction record from transaction history.
116
+ */
117
+ export interface AppleTransactionRecord {
118
+ originalTransactionId: string;
119
+ transactionId: string;
120
+ productId: string;
121
+ type: string;
122
+ purchasedAt: string;
123
+ expiresAt: string | null;
124
+ appAccountToken: string | null;
125
+ inAppOwnershipType: string | null;
126
+ revocationDate: string | null;
127
+ }
128
+ /**
129
+ * Fetch all transactions for an originalTransactionId from the App Store
130
+ * Transaction History API (GET /inApps/v2/history/{originalTransactionId}).
131
+ *
132
+ * Paginates automatically until `hasMore` is false. Returns all decoded
133
+ * transaction records, oldest-first (Apple's default sort).
134
+ *
135
+ * Returns null when API credentials are missing or the call fails.
136
+ */
137
+ export declare function fetchAppleTransactionHistory(originalTransactionId: string, config: AppleConfig, options?: {
138
+ sandbox?: boolean;
139
+ }): Promise<AppleTransactionRecord[] | null>;
140
+ /**
141
+ * Input for signing an Apple Promotional Offer payload.
142
+ * https://developer.apple.com/documentation/storekit/generating-a-signature-for-promotional-offers
143
+ */
144
+ export interface AppleOfferSignatureInput {
145
+ /** App Bundle ID (e.g. com.example.app) */
146
+ bundleId: string;
147
+ /** The product ID of the subscription being offered */
148
+ productId: string;
149
+ /** The promotional offer ID defined in App Store Connect */
150
+ offerId: string;
151
+ /** A unique UUID generated per request (the nonce) */
152
+ applicationUsername: string;
153
+ }
154
+ /**
155
+ * Result returned to the client so StoreKit can verify the offer.
156
+ */
157
+ export interface AppleOfferSignatureResult {
158
+ keyId: string;
159
+ nonce: string;
160
+ timestamp: number;
161
+ signature: string;
162
+ }
163
+ /**
164
+ * Sign an Apple Promotional Offer payload with ES256 (ECDSA P-256).
165
+ *
166
+ * The message to sign is:
167
+ * appBundleId + '⁣' + keyIdentifier + '⁣' + productIdentifier + '⁣'
168
+ * + offerIdentifier + '⁣' + applicationUsername + '⁣'
169
+ * + nonce (lowercase) + '⁣' + timestamp (ms, string)
170
+ *
171
+ * Requires `config.offerKeyId` and `config.offerPrivateKey` (PEM ES256 key from
172
+ * App Store Connect → Subscriptions → Promotional Offers → Keys).
173
+ *
174
+ * Throws if the required keys are not configured.
175
+ */
176
+ export declare function signApplePromotionalOffer(input: AppleOfferSignatureInput, config: AppleConfig): Promise<AppleOfferSignatureResult>;
101
177
  export {};
102
178
  //# sourceMappingURL=apple.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../src/providers/apple.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EA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