@payloadcms/figma 0.0.1-alpha.2 → 0.0.1-alpha.20
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/api/control-plane.d.ts +1 -1
- package/dist/api/control-plane.d.ts.map +1 -1
- package/dist/api/control-plane.js +12 -7
- package/dist/api/control-plane.js.map +1 -1
- package/dist/api/figma-api.d.ts.map +1 -1
- package/dist/api/figma-api.js +33 -10
- package/dist/api/figma-api.js.map +1 -1
- package/dist/auth/crypto-utils.d.ts.map +1 -1
- package/dist/auth/crypto-utils.js +5 -5
- package/dist/auth/crypto-utils.js.map +1 -1
- package/dist/auth/oauth-flow.js +3 -3
- package/dist/auth/oauth-flow.js.map +1 -1
- package/dist/auth/project-token.d.ts.map +1 -1
- package/dist/auth/project-token.js +7 -3
- package/dist/auth/project-token.js.map +1 -1
- package/dist/auth/token-store.d.ts.map +1 -1
- package/dist/auth/token-store.js +3 -0
- package/dist/auth/token-store.js.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +11 -6
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +14 -76
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts +8 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +10 -4
- package/dist/commands/login.js.map +1 -1
- package/dist/config/oauth.d.ts.map +1 -1
- package/dist/config/oauth.js +3 -3
- package/dist/config/oauth.js.map +1 -1
- package/dist/db-adapter.d.ts +17 -0
- package/dist/db-adapter.d.ts.map +1 -0
- package/dist/db-adapter.js +760 -0
- package/dist/db-adapter.js.map +1 -0
- package/dist/endpoints/health.d.ts +3 -0
- package/dist/endpoints/health.d.ts.map +1 -0
- package/dist/endpoints/health.js +11 -0
- package/dist/endpoints/health.js.map +1 -0
- package/dist/exports/client.d.ts +3 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/oauth/components/LoginButton/index.d.ts.map +1 -1
- package/dist/oauth/components/LoginButton/index.js +50 -6
- package/dist/oauth/components/LoginButton/index.js.map +1 -1
- package/dist/oauth/components/LoginButton/index.scss +50 -3
- package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -1
- package/dist/oauth/endpoints/getLoginEndpoint.js +1 -1
- package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -1
- package/dist/oauth/index.d.ts.map +1 -1
- package/dist/oauth/index.js +30 -6
- package/dist/oauth/index.js.map +1 -1
- package/dist/oauth/utilities/refreshTokens.d.ts.map +1 -1
- package/dist/oauth/utilities/refreshTokens.js +1 -1
- package/dist/oauth/utilities/refreshTokens.js.map +1 -1
- package/dist/plugin/build-config.d.ts +3 -5
- package/dist/plugin/build-config.d.ts.map +1 -1
- package/dist/plugin/build-config.js +28 -14
- package/dist/plugin/build-config.js.map +1 -1
- package/dist/utils/payload-config-ast.d.ts +1 -1
- package/dist/utils/payload-config-ast.d.ts.map +1 -1
- package/dist/utils/payload-config-ast.js +7 -7
- package/dist/utils/payload-config-ast.js.map +1 -1
- package/dist/utils/s3-upload.d.ts +0 -1
- package/dist/utils/s3-upload.d.ts.map +1 -1
- package/dist/utils/s3-upload.js +10 -3
- package/dist/utils/s3-upload.js.map +1 -1
- package/package.json +10 -5
package/dist/commands/login.js
CHANGED
|
@@ -9,7 +9,10 @@ import * as log from '../utils/log.js';
|
|
|
9
9
|
*
|
|
10
10
|
* Authenticates the user with Figma OAuth2 and stores tokens locally.
|
|
11
11
|
* If valid tokens already exist, shows an error message.
|
|
12
|
-
*/ export async function loginCommand() {
|
|
12
|
+
*/ export async function loginCommand(args) {
|
|
13
|
+
const { showNextSteps } = args || {
|
|
14
|
+
showNextSteps: false
|
|
15
|
+
};
|
|
13
16
|
const tokenStore = new TokenStore();
|
|
14
17
|
// Check for existing valid tokens
|
|
15
18
|
try {
|
|
@@ -30,12 +33,13 @@ import * as log from '../utils/log.js';
|
|
|
30
33
|
}
|
|
31
34
|
// Start OAuth flow
|
|
32
35
|
await handleAuthentication({
|
|
36
|
+
showNextSteps,
|
|
33
37
|
tokenStore
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Handle authentication flow
|
|
38
|
-
*/ async function handleAuthentication({ tokenStore }) {
|
|
42
|
+
*/ async function handleAuthentication({ showNextSteps, tokenStore }) {
|
|
39
43
|
try {
|
|
40
44
|
// Execute OAuth flow
|
|
41
45
|
const result = await executeOAuthFlow(tokenStore, {
|
|
@@ -48,8 +52,10 @@ import * as log from '../utils/log.js';
|
|
|
48
52
|
log.debug(`User ID: ${result.userId}`);
|
|
49
53
|
}
|
|
50
54
|
log.debug(`Token storage: ${pc.dim(tokenStore.getStoragePath())}`);
|
|
51
|
-
// Show next steps
|
|
52
|
-
|
|
55
|
+
// Show next steps unless disabled
|
|
56
|
+
if (showNextSteps !== false) {
|
|
57
|
+
p.note(` ${pc.cyan('@payloadcms/figma init')} Create a new CMS instance`, 'Next Steps');
|
|
58
|
+
}
|
|
53
59
|
} catch (error) {
|
|
54
60
|
if (error instanceof OAuthFlowError) {
|
|
55
61
|
log.error(error.message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/login.ts"],"sourcesContent":["import * as p from '@clack/prompts'\nimport pc from 'picocolors'\n\nimport { executeOAuthFlow, getValidAccessToken, OAuthFlowError } from '../auth/oauth-flow.js'\nimport { TokenStore } from '../auth/token-store.js'\nimport { OAUTH_CONFIG } from '../config/oauth.js'\nimport * as log from '../utils/log.js'\n\n/**\n * Handle the `@payloadcms/figma login` command\n *\n * Authenticates the user with Figma OAuth2 and stores tokens locally.\n * If valid tokens already exist, shows an error message.\n */\nexport async function loginCommand(): Promise<void> {\n const tokenStore = new TokenStore()\n\n // Check for existing valid tokens\n try {\n const existingToken = await getValidAccessToken(tokenStore)\n if (existingToken) {\n const tokens = tokenStore.getTokens()\n p.log.warn(pc.yellow('Already logged in'))\n if (tokens?.userId) {\n log.info(`User ID: ${tokens.userId}`)\n }\n log.info(`Token storage: ${pc.dim(tokenStore.getStoragePath())}`)\n p.note(`To re-authenticate, first run ${pc.cyan('@payloadcms/figma logout')}`, 'Tip')\n return\n }\n } catch {\n // Token refresh failed - continue with new auth flow\n log.warning('Existing tokens are invalid. Starting new authentication...')\n }\n\n // Start OAuth flow\n await handleAuthentication({\n tokenStore,\n })\n}\n\n/**\n * Handle authentication flow\n */\nasync function handleAuthentication({
|
|
1
|
+
{"version":3,"sources":["../../src/commands/login.ts"],"sourcesContent":["import * as p from '@clack/prompts'\nimport pc from 'picocolors'\n\nimport { executeOAuthFlow, getValidAccessToken, OAuthFlowError } from '../auth/oauth-flow.js'\nimport { TokenStore } from '../auth/token-store.js'\nimport { OAUTH_CONFIG } from '../config/oauth.js'\nimport * as log from '../utils/log.js'\n\ntype LoginArgs = {\n /** Set this to show next steps after login\n * @default true\n */\n showNextSteps: boolean\n}\n\n/**\n * Handle the `@payloadcms/figma login` command\n *\n * Authenticates the user with Figma OAuth2 and stores tokens locally.\n * If valid tokens already exist, shows an error message.\n */\nexport async function loginCommand(args?: LoginArgs): Promise<void> {\n const { showNextSteps } = args || { showNextSteps: false }\n const tokenStore = new TokenStore()\n\n // Check for existing valid tokens\n try {\n const existingToken = await getValidAccessToken(tokenStore)\n if (existingToken) {\n const tokens = tokenStore.getTokens()\n p.log.warn(pc.yellow('Already logged in'))\n if (tokens?.userId) {\n log.info(`User ID: ${tokens.userId}`)\n }\n log.info(`Token storage: ${pc.dim(tokenStore.getStoragePath())}`)\n p.note(`To re-authenticate, first run ${pc.cyan('@payloadcms/figma logout')}`, 'Tip')\n return\n }\n } catch {\n // Token refresh failed - continue with new auth flow\n log.warning('Existing tokens are invalid. Starting new authentication...')\n }\n\n // Start OAuth flow\n await handleAuthentication({\n showNextSteps,\n tokenStore,\n })\n}\n\n/**\n * Handle authentication flow\n */\nasync function handleAuthentication({\n showNextSteps,\n tokenStore,\n}: {\n showNextSteps: boolean\n tokenStore: TokenStore\n}): Promise<void> {\n try {\n // Execute OAuth flow\n const result = await executeOAuthFlow(tokenStore, {\n clientId: OAUTH_CONFIG.clientId,\n redirectUri: OAUTH_CONFIG.redirectUri,\n scopes: OAUTH_CONFIG.scopes,\n })\n\n p.log.success(pc.green('✓ You are now authenticated with Figma'))\n\n if (result.userId) {\n log.debug(`User ID: ${result.userId}`)\n }\n\n log.debug(`Token storage: ${pc.dim(tokenStore.getStoragePath())}`)\n\n // Show next steps unless disabled\n if (showNextSteps !== false) {\n p.note(` ${pc.cyan('@payloadcms/figma init')} Create a new CMS instance`, 'Next Steps')\n }\n } catch (error) {\n if (error instanceof OAuthFlowError) {\n log.error(error.message)\n\n if (error.cause) {\n log.debug(`Cause: ${error.cause.message}`)\n }\n } else {\n log.error(error instanceof Error ? error.message : 'Unknown error')\n }\n\n process.exit(1)\n }\n}\n"],"names":["p","pc","executeOAuthFlow","getValidAccessToken","OAuthFlowError","TokenStore","OAUTH_CONFIG","log","loginCommand","args","showNextSteps","tokenStore","existingToken","tokens","getTokens","warn","yellow","userId","info","dim","getStoragePath","note","cyan","warning","handleAuthentication","result","clientId","redirectUri","scopes","success","green","debug","error","message","cause","Error","process","exit"],"mappings":"AAAA,YAAYA,OAAO,iBAAgB;AACnC,OAAOC,QAAQ,aAAY;AAE3B,SAASC,gBAAgB,EAAEC,mBAAmB,EAAEC,cAAc,QAAQ,wBAAuB;AAC7F,SAASC,UAAU,QAAQ,yBAAwB;AACnD,SAASC,YAAY,QAAQ,qBAAoB;AACjD,YAAYC,SAAS,kBAAiB;AAStC;;;;;CAKC,GACD,OAAO,eAAeC,aAAaC,IAAgB;IACjD,MAAM,EAAEC,aAAa,EAAE,GAAGD,QAAQ;QAAEC,eAAe;IAAM;IACzD,MAAMC,aAAa,IAAIN;IAEvB,kCAAkC;IAClC,IAAI;QACF,MAAMO,gBAAgB,MAAMT,oBAAoBQ;QAChD,IAAIC,eAAe;YACjB,MAAMC,SAASF,WAAWG,SAAS;YACnCd,EAAEO,GAAG,CAACQ,IAAI,CAACd,GAAGe,MAAM,CAAC;YACrB,IAAIH,QAAQI,QAAQ;gBAClBV,IAAIW,IAAI,CAAC,CAAC,SAAS,EAAEL,OAAOI,MAAM,EAAE;YACtC;YACAV,IAAIW,IAAI,CAAC,CAAC,eAAe,EAAEjB,GAAGkB,GAAG,CAACR,WAAWS,cAAc,KAAK;YAChEpB,EAAEqB,IAAI,CAAC,CAAC,8BAA8B,EAAEpB,GAAGqB,IAAI,CAAC,6BAA6B,EAAE;YAC/E;QACF;IACF,EAAE,OAAM;QACN,qDAAqD;QACrDf,IAAIgB,OAAO,CAAC;IACd;IAEA,mBAAmB;IACnB,MAAMC,qBAAqB;QACzBd;QACAC;IACF;AACF;AAEA;;CAEC,GACD,eAAea,qBAAqB,EAClCd,aAAa,EACbC,UAAU,EAIX;IACC,IAAI;QACF,qBAAqB;QACrB,MAAMc,SAAS,MAAMvB,iBAAiBS,YAAY;YAChDe,UAAUpB,aAAaoB,QAAQ;YAC/BC,aAAarB,aAAaqB,WAAW;YACrCC,QAAQtB,aAAasB,MAAM;QAC7B;QAEA5B,EAAEO,GAAG,CAACsB,OAAO,CAAC5B,GAAG6B,KAAK,CAAC;QAEvB,IAAIL,OAAOR,MAAM,EAAE;YACjBV,IAAIwB,KAAK,CAAC,CAAC,SAAS,EAAEN,OAAOR,MAAM,EAAE;QACvC;QAEAV,IAAIwB,KAAK,CAAC,CAAC,eAAe,EAAE9B,GAAGkB,GAAG,CAACR,WAAWS,cAAc,KAAK;QAEjE,kCAAkC;QAClC,IAAIV,kBAAkB,OAAO;YAC3BV,EAAEqB,IAAI,CAAC,CAAC,EAAE,EAAEpB,GAAGqB,IAAI,CAAC,0BAA0B,2BAA2B,CAAC,EAAE;QAC9E;IACF,EAAE,OAAOU,OAAO;QACd,IAAIA,iBAAiB5B,gBAAgB;YACnCG,IAAIyB,KAAK,CAACA,MAAMC,OAAO;YAEvB,IAAID,MAAME,KAAK,EAAE;gBACf3B,IAAIwB,KAAK,CAAC,CAAC,OAAO,EAAEC,MAAME,KAAK,CAACD,OAAO,EAAE;YAC3C;QACF,OAAO;YACL1B,IAAIyB,KAAK,CAACA,iBAAiBG,QAAQH,MAAMC,OAAO,GAAG;QACrD;QAEAG,QAAQC,IAAI,CAAC;IACf;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/config/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD,eAAO,MAAM,IAAI,EAAE,MAAM,CACvB,MAAM,GAAG,SAAS,EAClB,IAAI,CAAC,WAAW,EAAE,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/config/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD,eAAO,MAAM,IAAI,EAAE,MAAM,CACvB,MAAM,GAAG,SAAS,EAClB,IAAI,CAAC,WAAW,EAAE,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC,CAkBlE,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,WAe1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAA"}
|
package/dist/config/oauth.js
CHANGED
|
@@ -6,9 +6,9 @@ export const URLS = {
|
|
|
6
6
|
tokenUrl: 'https://api.figma.com/v1/oauth/token'
|
|
7
7
|
},
|
|
8
8
|
staging: {
|
|
9
|
-
authorizationUrl: 'https://staging.figma.com/oauth',
|
|
10
|
-
refreshUrl: 'https://api.staging.figma.com/v1/oauth/refresh',
|
|
11
|
-
tokenUrl: 'https://api.staging.figma.com/v1/oauth/token'
|
|
9
|
+
authorizationUrl: process.env.FIGMA_AUTH_URL ? `${process.env.FIGMA_AUTH_URL}/oauth` : 'https://staging.figma.com/oauth',
|
|
10
|
+
refreshUrl: process.env.FIGMA_API_URL ? `${process.env.FIGMA_API_URL}/v1/oauth/refresh` : 'https://api.staging.figma.com/v1/oauth/refresh',
|
|
11
|
+
tokenUrl: process.env.FIGMA_API_URL ? `${process.env.FIGMA_API_URL}/v1/oauth/token` : 'https://api.staging.figma.com/v1/oauth/token'
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
/**
|
package/dist/config/oauth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/oauth.ts"],"sourcesContent":["import type { OAuthConfig } from '../auth/types.js'\n\nimport { FIGMA_CLIENT_IDS } from '../constants.js'\n\nexport const URLS: Record<\n 'prod' | 'staging',\n Pick<OAuthConfig, 'authorizationUrl' | 'refreshUrl' | 'tokenUrl'>\n> = {\n prod: {\n authorizationUrl: 'https://www.figma.com/oauth',\n refreshUrl: 'https://api.figma.com/v1/oauth/refresh',\n tokenUrl: 'https://api.figma.com/v1/oauth/token',\n },\n staging: {\n authorizationUrl: 'https://staging.figma.com/oauth',\n refreshUrl: 'https://api.staging.figma.com/v1/oauth/refresh',\n tokenUrl: 'https://api.staging.figma.com/v1/oauth/token',\n },\n}\n\n/**\n * Figma OAuth2 configuration for public CLI client\n *\n * This is a PUBLIC OAuth client using PKCE (Proof Key for Code Exchange).\n * No client secret is used because CLIs cannot securely store secrets.\n * PKCE provides security through the code_verifier/code_challenge mechanism.\n *\n * For production use, register a public OAuth app with Figma.\n * To register an OAuth app, visit: https://www.figma.com/developers/api#oauth2\n */\nexport const OAUTH_CONFIG: OAuthConfig = {\n // OAuth client ID (public client)\n // Uses staging client ID by default since we use staging endpoints\n clientId: process.env.FIGMA_CLIENT_ID || FIGMA_CLIENT_IDS.staging,\n\n // No client secret - this is a public OAuth client using PKCE\n // Public clients cannot securely store secrets in CLI environments\n\n redirectUri: process.env.FIGMA_REDIRECT_URI || 'http://localhost:3000/callback',\n\n // Only current_user:read scope is needed for basic user info\n scopes: ['current_user:read'],\n\n // TODO: Dynamically choose between prod and staging based on environment\n ...URLS.staging,\n}\n\n/**\n * Buffer time (in seconds) before token expiration to consider token as expired\n * This helps avoid using tokens that are about to expire\n */\nexport const TOKEN_EXPIRY_BUFFER_SECONDS = 300 // 5 minutes\n"],"names":["FIGMA_CLIENT_IDS","URLS","prod","authorizationUrl","refreshUrl","tokenUrl","staging","
|
|
1
|
+
{"version":3,"sources":["../../src/config/oauth.ts"],"sourcesContent":["import type { OAuthConfig } from '../auth/types.js'\n\nimport { FIGMA_CLIENT_IDS } from '../constants.js'\n\nexport const URLS: Record<\n 'prod' | 'staging',\n Pick<OAuthConfig, 'authorizationUrl' | 'refreshUrl' | 'tokenUrl'>\n> = {\n prod: {\n authorizationUrl: 'https://www.figma.com/oauth',\n refreshUrl: 'https://api.figma.com/v1/oauth/refresh',\n tokenUrl: 'https://api.figma.com/v1/oauth/token',\n },\n staging: {\n authorizationUrl: process.env.FIGMA_AUTH_URL\n ? `${process.env.FIGMA_AUTH_URL}/oauth`\n : 'https://staging.figma.com/oauth',\n refreshUrl: process.env.FIGMA_API_URL\n ? `${process.env.FIGMA_API_URL}/v1/oauth/refresh`\n : 'https://api.staging.figma.com/v1/oauth/refresh',\n tokenUrl: process.env.FIGMA_API_URL\n ? `${process.env.FIGMA_API_URL}/v1/oauth/token`\n : 'https://api.staging.figma.com/v1/oauth/token',\n },\n}\n\n/**\n * Figma OAuth2 configuration for public CLI client\n *\n * This is a PUBLIC OAuth client using PKCE (Proof Key for Code Exchange).\n * No client secret is used because CLIs cannot securely store secrets.\n * PKCE provides security through the code_verifier/code_challenge mechanism.\n *\n * For production use, register a public OAuth app with Figma.\n * To register an OAuth app, visit: https://www.figma.com/developers/api#oauth2\n */\nexport const OAUTH_CONFIG: OAuthConfig = {\n // OAuth client ID (public client)\n // Uses staging client ID by default since we use staging endpoints\n clientId: process.env.FIGMA_CLIENT_ID || FIGMA_CLIENT_IDS.staging,\n\n // No client secret - this is a public OAuth client using PKCE\n // Public clients cannot securely store secrets in CLI environments\n\n redirectUri: process.env.FIGMA_REDIRECT_URI || 'http://localhost:3000/callback',\n\n // Only current_user:read scope is needed for basic user info\n scopes: ['current_user:read'],\n\n // TODO: Dynamically choose between prod and staging based on environment\n ...URLS.staging,\n}\n\n/**\n * Buffer time (in seconds) before token expiration to consider token as expired\n * This helps avoid using tokens that are about to expire\n */\nexport const TOKEN_EXPIRY_BUFFER_SECONDS = 300 // 5 minutes\n"],"names":["FIGMA_CLIENT_IDS","URLS","prod","authorizationUrl","refreshUrl","tokenUrl","staging","process","env","FIGMA_AUTH_URL","FIGMA_API_URL","OAUTH_CONFIG","clientId","FIGMA_CLIENT_ID","redirectUri","FIGMA_REDIRECT_URI","scopes","TOKEN_EXPIRY_BUFFER_SECONDS"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,kBAAiB;AAElD,OAAO,MAAMC,OAGT;IACFC,MAAM;QACJC,kBAAkB;QAClBC,YAAY;QACZC,UAAU;IACZ;IACAC,SAAS;QACPH,kBAAkBI,QAAQC,GAAG,CAACC,cAAc,GACxC,GAAGF,QAAQC,GAAG,CAACC,cAAc,CAAC,MAAM,CAAC,GACrC;QACJL,YAAYG,QAAQC,GAAG,CAACE,aAAa,GACjC,GAAGH,QAAQC,GAAG,CAACE,aAAa,CAAC,iBAAiB,CAAC,GAC/C;QACJL,UAAUE,QAAQC,GAAG,CAACE,aAAa,GAC/B,GAAGH,QAAQC,GAAG,CAACE,aAAa,CAAC,eAAe,CAAC,GAC7C;IACN;AACF,EAAC;AAED;;;;;;;;;CASC,GACD,OAAO,MAAMC,eAA4B;IACvC,kCAAkC;IAClC,mEAAmE;IACnEC,UAAUL,QAAQC,GAAG,CAACK,eAAe,IAAIb,iBAAiBM,OAAO;IAEjE,8DAA8D;IAC9D,mEAAmE;IAEnEQ,aAAaP,QAAQC,GAAG,CAACO,kBAAkB,IAAI;IAE/C,6DAA6D;IAC7DC,QAAQ;QAAC;KAAoB;IAE7B,yEAAyE;IACzE,GAAGf,KAAKK,OAAO;AACjB,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMW,8BAA8B,IAAI,YAAY;CAAb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BaseDatabaseAdapter, DatabaseAdapterObj } from 'payload';
|
|
2
|
+
interface ContentAPIDatabaseAdapterOptions {
|
|
3
|
+
contentApiKey: string;
|
|
4
|
+
contentApiUrl: string;
|
|
5
|
+
contentSystemId: string;
|
|
6
|
+
projectToken: string;
|
|
7
|
+
}
|
|
8
|
+
export type ContentAPIAdapter = {
|
|
9
|
+
contentApiKey: string;
|
|
10
|
+
contentApiUrl: string;
|
|
11
|
+
contentSystemId: string;
|
|
12
|
+
projectToken: string;
|
|
13
|
+
request<T = any>(path: string, body?: any): Promise<T>;
|
|
14
|
+
} & BaseDatabaseAdapter;
|
|
15
|
+
export declare const contentAPIAdapter: (opts: ContentAPIDatabaseAdapterOptions) => DatabaseAdapterObj;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=db-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-adapter.d.ts","sourceRoot":"","sources":["../src/db-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAanB,kBAAkB,EAqBnB,MAAM,SAAS,CAAA;AAchB,UAAU,gCAAgC;IACxC,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CACvD,GAAG,mBAAmB,CAAA;AAqzBvB,eAAO,MAAM,iBAAiB,SAAU,gCAAgC,KAAG,kBA6C1E,CAAA"}
|