@portablecore/integrations 0.3.1 → 0.4.1
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/apple.d.ts +78 -0
- package/dist/apple.d.ts.map +1 -0
- package/dist/apple.js +181 -0
- package/dist/apple.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -8
package/dist/apple.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @portablecore/integrations — Apple Developer
|
|
3
|
+
*
|
|
4
|
+
* App Store Connect API authentication (JWT generation) and
|
|
5
|
+
* credential resolution for Apple Developer integrations.
|
|
6
|
+
*
|
|
7
|
+
* Apple's API authentication requires:
|
|
8
|
+
* 1. A .p8 private key (ECDSA P-256)
|
|
9
|
+
* 2. A Key ID (from App Store Connect)
|
|
10
|
+
* 3. An Issuer ID (from App Store Connect)
|
|
11
|
+
*
|
|
12
|
+
* These are combined into a short-lived JWT (max 20 min) signed with ES256.
|
|
13
|
+
*
|
|
14
|
+
* Reference: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests
|
|
15
|
+
*/
|
|
16
|
+
import type { AnySupabaseClient, ProviderScope, ProviderConfigResult } from "./types.js";
|
|
17
|
+
/**
|
|
18
|
+
* Configuration stored in the integration's credentials/settings for
|
|
19
|
+
* Apple Developer provider.
|
|
20
|
+
*/
|
|
21
|
+
export interface AppleDeveloperConfig {
|
|
22
|
+
/** The Key ID from App Store Connect → Users and Access → Keys */
|
|
23
|
+
key_id: string;
|
|
24
|
+
/** The Issuer ID (UUID) from App Store Connect */
|
|
25
|
+
issuer_id: string;
|
|
26
|
+
/** The Apple Developer Team ID */
|
|
27
|
+
team_id: string;
|
|
28
|
+
/** The .p8 private key contents (PEM format) */
|
|
29
|
+
p8_key: string;
|
|
30
|
+
/** Comma-separated bundle IDs this key can access */
|
|
31
|
+
bundle_ids?: string;
|
|
32
|
+
/** Vendor Number from App Store Connect (used for Sales & Trends reports) */
|
|
33
|
+
vendor_number?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A generated JWT for App Store Connect API authentication.
|
|
37
|
+
*/
|
|
38
|
+
export interface AppStoreConnectToken {
|
|
39
|
+
/** The signed JWT string */
|
|
40
|
+
token: string;
|
|
41
|
+
/** When the token expires (Unix timestamp in seconds) */
|
|
42
|
+
expiresAt: number;
|
|
43
|
+
/** The Key ID used to generate this token */
|
|
44
|
+
keyId: string;
|
|
45
|
+
/** The Issuer ID */
|
|
46
|
+
issuerId: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generates a JWT for the App Store Connect API.
|
|
50
|
+
*
|
|
51
|
+
* The token is valid for 20 minutes (the maximum allowed by Apple).
|
|
52
|
+
* Callers should cache and reuse tokens until they expire.
|
|
53
|
+
*
|
|
54
|
+
* @param config - The Apple Developer credentials (key_id, issuer_id, p8_key)
|
|
55
|
+
* @param audience - The JWT audience. Defaults to "appstoreconnect-v1".
|
|
56
|
+
* @returns The signed JWT and expiry metadata
|
|
57
|
+
*/
|
|
58
|
+
export declare function generateAppStoreConnectJWT(config: Pick<AppleDeveloperConfig, "key_id" | "issuer_id" | "p8_key">, audience?: string): AppStoreConnectToken;
|
|
59
|
+
/**
|
|
60
|
+
* Resolves Apple Developer credentials from the database using the standard
|
|
61
|
+
* integration config resolution chain.
|
|
62
|
+
*
|
|
63
|
+
* @param supabase - A Supabase client with service role access
|
|
64
|
+
* @param scope - Optional scope for credential resolution
|
|
65
|
+
* @returns The resolved Apple Developer config, or null if not configured
|
|
66
|
+
*/
|
|
67
|
+
export declare function getAppleDeveloperConfig(supabase: AnySupabaseClient, scope?: ProviderScope): Promise<ProviderConfigResult<AppleDeveloperConfig> | null>;
|
|
68
|
+
/**
|
|
69
|
+
* Convenience: resolve Apple Developer credentials and generate a fresh JWT.
|
|
70
|
+
*
|
|
71
|
+
* @param supabase - A Supabase client with service role access
|
|
72
|
+
* @param scope - Optional scope for credential resolution
|
|
73
|
+
* @returns The JWT and config source, or null if not configured
|
|
74
|
+
*/
|
|
75
|
+
export declare function getAppStoreConnectToken(supabase: AnySupabaseClient, scope?: ProviderScope): Promise<(AppStoreConnectToken & {
|
|
76
|
+
source: string;
|
|
77
|
+
}) | null>;
|
|
78
|
+
//# sourceMappingURL=apple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../src/apple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAOxF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC,EACrE,QAAQ,SAAuB,GAC9B,oBAAoB,CA2CtB;AAMD;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAE5D;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,CAU7D"}
|
package/dist/apple.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @portablecore/integrations — Apple Developer
|
|
4
|
+
*
|
|
5
|
+
* App Store Connect API authentication (JWT generation) and
|
|
6
|
+
* credential resolution for Apple Developer integrations.
|
|
7
|
+
*
|
|
8
|
+
* Apple's API authentication requires:
|
|
9
|
+
* 1. A .p8 private key (ECDSA P-256)
|
|
10
|
+
* 2. A Key ID (from App Store Connect)
|
|
11
|
+
* 3. An Issuer ID (from App Store Connect)
|
|
12
|
+
*
|
|
13
|
+
* These are combined into a short-lived JWT (max 20 min) signed with ES256.
|
|
14
|
+
*
|
|
15
|
+
* Reference: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.generateAppStoreConnectJWT = generateAppStoreConnectJWT;
|
|
19
|
+
exports.getAppleDeveloperConfig = getAppleDeveloperConfig;
|
|
20
|
+
exports.getAppStoreConnectToken = getAppStoreConnectToken;
|
|
21
|
+
const crypto_1 = require("crypto");
|
|
22
|
+
const config_js_1 = require("./config.js");
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// JWT Generation
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
/**
|
|
27
|
+
* Generates a JWT for the App Store Connect API.
|
|
28
|
+
*
|
|
29
|
+
* The token is valid for 20 minutes (the maximum allowed by Apple).
|
|
30
|
+
* Callers should cache and reuse tokens until they expire.
|
|
31
|
+
*
|
|
32
|
+
* @param config - The Apple Developer credentials (key_id, issuer_id, p8_key)
|
|
33
|
+
* @param audience - The JWT audience. Defaults to "appstoreconnect-v1".
|
|
34
|
+
* @returns The signed JWT and expiry metadata
|
|
35
|
+
*/
|
|
36
|
+
function generateAppStoreConnectJWT(config, audience = "appstoreconnect-v1") {
|
|
37
|
+
const now = Math.floor(Date.now() / 1000);
|
|
38
|
+
const expiresAt = now + 20 * 60; // 20 minutes
|
|
39
|
+
// JWT Header
|
|
40
|
+
const header = {
|
|
41
|
+
alg: "ES256",
|
|
42
|
+
kid: config.key_id,
|
|
43
|
+
typ: "JWT",
|
|
44
|
+
};
|
|
45
|
+
// JWT Payload
|
|
46
|
+
const payload = {
|
|
47
|
+
iss: config.issuer_id,
|
|
48
|
+
iat: now,
|
|
49
|
+
exp: expiresAt,
|
|
50
|
+
aud: audience,
|
|
51
|
+
};
|
|
52
|
+
// Encode header and payload
|
|
53
|
+
const encodedHeader = base64UrlEncode(JSON.stringify(header));
|
|
54
|
+
const encodedPayload = base64UrlEncode(JSON.stringify(payload));
|
|
55
|
+
const signingInput = `${encodedHeader}.${encodedPayload}`;
|
|
56
|
+
// Sign with ES256 (ECDSA P-256 + SHA-256)
|
|
57
|
+
const signer = (0, crypto_1.createSign)("SHA256");
|
|
58
|
+
signer.update(signingInput);
|
|
59
|
+
signer.end();
|
|
60
|
+
// The p8 key should be in PEM format
|
|
61
|
+
const privateKey = normalizeP8Key(config.p8_key);
|
|
62
|
+
const derSignature = signer.sign(privateKey);
|
|
63
|
+
// Convert DER-encoded signature to raw IEEE P1363 format (r || s, 64 bytes)
|
|
64
|
+
const rawSignature = derToRaw(derSignature);
|
|
65
|
+
const encodedSignature = base64UrlEncode(rawSignature);
|
|
66
|
+
return {
|
|
67
|
+
token: `${signingInput}.${encodedSignature}`,
|
|
68
|
+
expiresAt,
|
|
69
|
+
keyId: config.key_id,
|
|
70
|
+
issuerId: config.issuer_id,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Credential Resolution
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
/**
|
|
77
|
+
* Resolves Apple Developer credentials from the database using the standard
|
|
78
|
+
* integration config resolution chain.
|
|
79
|
+
*
|
|
80
|
+
* @param supabase - A Supabase client with service role access
|
|
81
|
+
* @param scope - Optional scope for credential resolution
|
|
82
|
+
* @returns The resolved Apple Developer config, or null if not configured
|
|
83
|
+
*/
|
|
84
|
+
async function getAppleDeveloperConfig(supabase, scope) {
|
|
85
|
+
return (0, config_js_1.getProviderConfig)(supabase, "apple-developer", scope);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convenience: resolve Apple Developer credentials and generate a fresh JWT.
|
|
89
|
+
*
|
|
90
|
+
* @param supabase - A Supabase client with service role access
|
|
91
|
+
* @param scope - Optional scope for credential resolution
|
|
92
|
+
* @returns The JWT and config source, or null if not configured
|
|
93
|
+
*/
|
|
94
|
+
async function getAppStoreConnectToken(supabase, scope) {
|
|
95
|
+
const result = await getAppleDeveloperConfig(supabase, scope);
|
|
96
|
+
if (!result)
|
|
97
|
+
return null;
|
|
98
|
+
// The config might be in different places depending on how it was stored
|
|
99
|
+
const config = resolveAppleConfig(result);
|
|
100
|
+
if (!config)
|
|
101
|
+
return null;
|
|
102
|
+
const jwt = generateAppStoreConnectJWT(config);
|
|
103
|
+
return { ...jwt, source: result.source };
|
|
104
|
+
}
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Internal Helpers
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
/**
|
|
109
|
+
* Resolve Apple config from the various places it could be stored
|
|
110
|
+
* in the integration record (config, credentials, settings, or access_token).
|
|
111
|
+
*/
|
|
112
|
+
function resolveAppleConfig(result) {
|
|
113
|
+
// Try the typed config first
|
|
114
|
+
if (result.config?.key_id && result.config?.issuer_id && result.config?.p8_key) {
|
|
115
|
+
return result.config;
|
|
116
|
+
}
|
|
117
|
+
// Try credentials JSONB
|
|
118
|
+
const creds = result.credentials;
|
|
119
|
+
if (creds?.key_id && creds?.issuer_id && creds?.p8_key) {
|
|
120
|
+
return creds;
|
|
121
|
+
}
|
|
122
|
+
// Try settings JSONB
|
|
123
|
+
const settings = result.settings;
|
|
124
|
+
if (settings?.key_id && settings?.issuer_id && settings?.p8_key) {
|
|
125
|
+
return settings;
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Ensure the P8 key has proper PEM formatting.
|
|
131
|
+
*/
|
|
132
|
+
function normalizeP8Key(key) {
|
|
133
|
+
const trimmed = key.trim();
|
|
134
|
+
if (trimmed.startsWith("-----BEGIN PRIVATE KEY-----")) {
|
|
135
|
+
return trimmed;
|
|
136
|
+
}
|
|
137
|
+
// If someone pasted just the base64 content without headers
|
|
138
|
+
return `-----BEGIN PRIVATE KEY-----\n${trimmed}\n-----END PRIVATE KEY-----`;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Base64url encode (RFC 7515).
|
|
142
|
+
*/
|
|
143
|
+
function base64UrlEncode(input) {
|
|
144
|
+
const buf = typeof input === "string" ? Buffer.from(input, "utf8") : input;
|
|
145
|
+
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Convert a DER-encoded ECDSA signature to raw IEEE P1363 format (r || s).
|
|
149
|
+
*
|
|
150
|
+
* Node.js's crypto.sign returns DER format, but JWT ES256 expects r||s (64 bytes).
|
|
151
|
+
*/
|
|
152
|
+
function derToRaw(derSig) {
|
|
153
|
+
// DER format: 0x30 [total-length] 0x02 [r-length] [r] 0x02 [s-length] [s]
|
|
154
|
+
let offset = 2; // skip SEQUENCE header (0x30, length)
|
|
155
|
+
// Parse r
|
|
156
|
+
if (derSig[offset] !== 0x02)
|
|
157
|
+
throw new Error("Invalid DER signature: expected INTEGER tag for r");
|
|
158
|
+
offset++;
|
|
159
|
+
const rLen = derSig[offset];
|
|
160
|
+
offset++;
|
|
161
|
+
let r = derSig.subarray(offset, offset + rLen);
|
|
162
|
+
offset += rLen;
|
|
163
|
+
// Parse s
|
|
164
|
+
if (derSig[offset] !== 0x02)
|
|
165
|
+
throw new Error("Invalid DER signature: expected INTEGER tag for s");
|
|
166
|
+
offset++;
|
|
167
|
+
const sLen = derSig[offset];
|
|
168
|
+
offset++;
|
|
169
|
+
let s = derSig.subarray(offset, offset + sLen);
|
|
170
|
+
// Remove leading zero padding (DER uses signed integers)
|
|
171
|
+
if (r.length > 32 && r[0] === 0x00)
|
|
172
|
+
r = r.subarray(1);
|
|
173
|
+
if (s.length > 32 && s[0] === 0x00)
|
|
174
|
+
s = s.subarray(1);
|
|
175
|
+
// Pad to 32 bytes each
|
|
176
|
+
const raw = Buffer.alloc(64);
|
|
177
|
+
r.copy(raw, 32 - r.length);
|
|
178
|
+
s.copy(raw, 64 - s.length);
|
|
179
|
+
return raw;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=apple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple.js","sourceRoot":"","sources":["../src/apple.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAyDH,gEA8CC;AAcD,0DAKC;AASD,0DAaC;AA9ID,mCAAmC;AAEnC,2CAA+C;AAuC/C,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,SAAgB,0BAA0B,CACxC,MAAqE,EACrE,QAAQ,GAAG,oBAAoB;IAE/B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;IACzC,MA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AAI,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;IACjG,MAAM,EAAE,CAAA;IACR,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAE,CAAA;IAC5B,MAAM,EAAE,CAAA;IACR,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IAE9C,yDAAyD;IACzD,IAAI,CAAC,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACrD,IAAI,CAAC,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IAErD,uBAAuB;IACvB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;IAE1B,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,4 +23,6 @@ export { getProvider, getProviders, listProviders } from "./provider.js";
|
|
|
23
23
|
export { getProviderConfig, getProviderApiKey } from "./config.js";
|
|
24
24
|
export { getSurfaceCapabilities } from "./capabilities.js";
|
|
25
25
|
export type { CredentialAvailability } from "./capabilities.js";
|
|
26
|
+
export { generateAppStoreConnectJWT, getAppleDeveloperConfig, getAppStoreConnectToken, } from "./apple.js";
|
|
27
|
+
export type { AppleDeveloperConfig, AppStoreConnectToken, } from "./apple.js";
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGxE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGxE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAG/D,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* "The expert brings expertise. The surface provides integrations."
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.getSurfaceCapabilities = exports.getProviderApiKey = exports.getProviderConfig = exports.listProviders = exports.getProviders = exports.getProvider = exports.DEFAULT_CAPABILITY_MAPPINGS = void 0;
|
|
22
|
+
exports.getAppStoreConnectToken = exports.getAppleDeveloperConfig = exports.generateAppStoreConnectJWT = exports.getSurfaceCapabilities = exports.getProviderApiKey = exports.getProviderConfig = exports.listProviders = exports.getProviders = exports.getProvider = exports.DEFAULT_CAPABILITY_MAPPINGS = void 0;
|
|
23
23
|
var types_js_1 = require("./types.js");
|
|
24
24
|
Object.defineProperty(exports, "DEFAULT_CAPABILITY_MAPPINGS", { enumerable: true, get: function () { return types_js_1.DEFAULT_CAPABILITY_MAPPINGS; } });
|
|
25
25
|
// Provider lookup
|
|
@@ -34,4 +34,9 @@ Object.defineProperty(exports, "getProviderApiKey", { enumerable: true, get: fun
|
|
|
34
34
|
// PEP capability discovery
|
|
35
35
|
var capabilities_js_1 = require("./capabilities.js");
|
|
36
36
|
Object.defineProperty(exports, "getSurfaceCapabilities", { enumerable: true, get: function () { return capabilities_js_1.getSurfaceCapabilities; } });
|
|
37
|
+
// Apple Developer (App Store Connect API)
|
|
38
|
+
var apple_js_1 = require("./apple.js");
|
|
39
|
+
Object.defineProperty(exports, "generateAppStoreConnectJWT", { enumerable: true, get: function () { return apple_js_1.generateAppStoreConnectJWT; } });
|
|
40
|
+
Object.defineProperty(exports, "getAppleDeveloperConfig", { enumerable: true, get: function () { return apple_js_1.getAppleDeveloperConfig; } });
|
|
41
|
+
Object.defineProperty(exports, "getAppStoreConnectToken", { enumerable: true, get: function () { return apple_js_1.getAppStoreConnectToken; } });
|
|
37
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAaH,uCAAwD;AAA/C,uHAAA,2BAA2B,OAAA;AAEpC,kBAAkB;AAClB,6CAAwE;AAA/D,0GAAA,WAAW,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,4GAAA,aAAa,OAAA;AAEjD,wBAAwB;AACxB,yCAAkE;AAAzD,8GAAA,iBAAiB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAE7C,2BAA2B;AAC3B,qDAA0D;AAAjD,yHAAA,sBAAsB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAaH,uCAAwD;AAA/C,uHAAA,2BAA2B,OAAA;AAEpC,kBAAkB;AAClB,6CAAwE;AAA/D,0GAAA,WAAW,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,4GAAA,aAAa,OAAA;AAEjD,wBAAwB;AACxB,yCAAkE;AAAzD,8GAAA,iBAAiB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAE7C,2BAA2B;AAC3B,qDAA0D;AAAjD,yHAAA,sBAAsB,OAAA;AAG/B,0CAA0C;AAC1C,uCAImB;AAHjB,sHAAA,0BAA0B,OAAA;AAC1B,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portablecore/integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Shared integration provider registry and credential resolution for Portable platforms",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,11 +20,21 @@
|
|
|
20
20
|
"./capabilities": {
|
|
21
21
|
"types": "./dist/capabilities.d.ts",
|
|
22
22
|
"default": "./dist/capabilities.js"
|
|
23
|
+
},
|
|
24
|
+
"./apple": {
|
|
25
|
+
"types": "./dist/apple.d.ts",
|
|
26
|
+
"default": "./dist/apple.js"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"files": [
|
|
26
30
|
"dist"
|
|
27
31
|
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc",
|
|
34
|
+
"dev": "tsc --watch",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"typecheck": "tsc --noEmit"
|
|
37
|
+
},
|
|
28
38
|
"keywords": [
|
|
29
39
|
"portable",
|
|
30
40
|
"integrations",
|
|
@@ -40,11 +50,5 @@
|
|
|
40
50
|
"devDependencies": {
|
|
41
51
|
"@supabase/supabase-js": "^2.49.0",
|
|
42
52
|
"typescript": "^5.3.0"
|
|
43
|
-
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"build": "tsc",
|
|
46
|
-
"dev": "tsc --watch",
|
|
47
|
-
"clean": "rm -rf dist",
|
|
48
|
-
"typecheck": "tsc --noEmit"
|
|
49
53
|
}
|
|
50
|
-
}
|
|
54
|
+
}
|