@nauth-toolkit/social-google 0.1.97 → 0.1.99
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/src/openapi/components.schemas.json +205 -0
- package/dist/src/openapi/generate-openapi.d.ts +8 -0
- package/dist/src/openapi/generate-openapi.d.ts.map +1 -0
- package/dist/src/openapi/generate-openapi.js +176 -0
- package/dist/src/openapi/generate-openapi.js.map +1 -0
- package/dist/src/openapi/index.d.ts +17 -0
- package/dist/src/openapi/index.d.ts.map +1 -0
- package/dist/src/openapi/index.js +15 -0
- package/dist/src/openapi/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"components": {
|
|
4
|
+
"schemas": {
|
|
5
|
+
"SocialGoogleLinkSocialAccountDTO": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"provider": {
|
|
9
|
+
"$ref": "#/components/schemas/SocialGoogleSocialProvider",
|
|
10
|
+
"description": "Social provider name Must be one of the configured providers\n\nValidation:\n- Must be a valid SocialProvider enum value"
|
|
11
|
+
},
|
|
12
|
+
"code": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Authorization code from OAuth provider This code is exchanged for access token and user info\n\nValidation:\n- Must be a string\n- Max 1000 characters (typical OAuth code length)"
|
|
15
|
+
},
|
|
16
|
+
"state": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "State parameter from OAuth flow Must match the state sent in the initial request\n\nValidation:\n- Must be a string\n- Max 500 characters (typical OAuth state length)"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"provider",
|
|
23
|
+
"code",
|
|
24
|
+
"state"
|
|
25
|
+
],
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"description": "DTO for linking social account to existing user Used when an authenticated user wants to link a social provider"
|
|
28
|
+
},
|
|
29
|
+
"SocialGoogleSocialProvider": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"enum": [
|
|
32
|
+
"google",
|
|
33
|
+
"apple",
|
|
34
|
+
"facebook"
|
|
35
|
+
],
|
|
36
|
+
"description": "Social provider enum"
|
|
37
|
+
},
|
|
38
|
+
"SocialGoogleSocialAccountsResponseDTO": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"accounts": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"provider": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"providerEmail": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"linkedAt": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"format": "date-time"
|
|
55
|
+
},
|
|
56
|
+
"lastUsedAt": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"format": "date-time"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": [
|
|
62
|
+
"provider",
|
|
63
|
+
"linkedAt"
|
|
64
|
+
],
|
|
65
|
+
"additionalProperties": false
|
|
66
|
+
},
|
|
67
|
+
"description": "Array of linked social accounts"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": [
|
|
71
|
+
"accounts"
|
|
72
|
+
],
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"description": "Response DTO for social account information Contains details about linked social accounts"
|
|
75
|
+
},
|
|
76
|
+
"SocialGoogleSocialCallbackDTO": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"properties": {
|
|
79
|
+
"provider": {
|
|
80
|
+
"$ref": "#/components/schemas/SocialGoogleSocialProvider",
|
|
81
|
+
"description": "Social provider name Must match the provider used in the initial request\n\nValidation:\n- Must be a valid SocialProvider enum value"
|
|
82
|
+
},
|
|
83
|
+
"code": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "Authorization code from OAuth provider This code is exchanged for access token and user info\n\nValidation:\n- Must be a string\n- Max 1000 characters (typical OAuth code length)"
|
|
86
|
+
},
|
|
87
|
+
"state": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "State parameter from OAuth flow Must match the state sent in the initial request\n\nValidation:\n- Must be a string\n- Max 500 characters (typical OAuth state length)"
|
|
90
|
+
},
|
|
91
|
+
"error": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Optional error parameter from OAuth provider Used when user denies permission or other errors occur\n\nValidation:\n- Must be a string if present\n- Max 100 characters"
|
|
94
|
+
},
|
|
95
|
+
"error_description": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "Optional error description from OAuth provider Provides more details about the error\n\nValidation:\n- Must be a string if present\n- Max 500 characters"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": [
|
|
101
|
+
"provider",
|
|
102
|
+
"code",
|
|
103
|
+
"state"
|
|
104
|
+
],
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"description": "DTO for handling OAuth callback Used to process the authorization code from OAuth providers"
|
|
107
|
+
},
|
|
108
|
+
"SocialGoogleSocialLoginDTO": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"provider": {
|
|
112
|
+
"$ref": "#/components/schemas/SocialGoogleSocialProvider",
|
|
113
|
+
"description": "Social provider name Must be one of the configured providers\n\nValidation:\n- Must be a valid SocialProvider enum value"
|
|
114
|
+
},
|
|
115
|
+
"state": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"description": "Optional state parameter for OAuth flow Used to prevent CSRF attacks and maintain state If not provided, a random state will be generated\n\nValidation:\n- Must be a string if present\n- Max 500 characters (typical OAuth state length)"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"required": [
|
|
121
|
+
"provider"
|
|
122
|
+
],
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"description": "DTO for initiating social login Used to generate OAuth URLs for social providers"
|
|
125
|
+
},
|
|
126
|
+
"SocialGoogleSocialLoginResponseDTO": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"accessToken": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "JWT access token for API authentication\n\nValidation:\n- Must be a string\n- Max 2048 characters (typical JWT length)"
|
|
132
|
+
},
|
|
133
|
+
"refreshToken": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"description": "JWT refresh token for token renewal\n\nValidation:\n- Must be a string\n- Max 2048 characters (typical JWT length)"
|
|
136
|
+
},
|
|
137
|
+
"accessTokenExpiresAt": {
|
|
138
|
+
"type": "number",
|
|
139
|
+
"description": "Access token expiration timestamp (Unix timestamp in seconds)\n\nValidation:\n- Must be a number"
|
|
140
|
+
},
|
|
141
|
+
"refreshTokenExpiresAt": {
|
|
142
|
+
"type": "number",
|
|
143
|
+
"description": "Refresh token expiration timestamp (Unix timestamp in seconds)\n\nValidation:\n- Must be a number"
|
|
144
|
+
},
|
|
145
|
+
"user": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"sub": {
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"email": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"firstName": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"lastName": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"isEmailVerified": {
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
163
|
+
"socialProviders": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"items": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"required": [
|
|
171
|
+
"sub",
|
|
172
|
+
"email",
|
|
173
|
+
"isEmailVerified"
|
|
174
|
+
],
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"description": "User information\n\nValidation:\n- Nested fields validated in service layer: - sub: UUID v4 format, max 36 chars - email: Valid email format, max 255 chars - firstName: String, max 100 chars - lastName: String, max 100 chars - isEmailVerified: Boolean - socialProviders: Array of strings, each max 50 chars"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": [
|
|
180
|
+
"accessToken",
|
|
181
|
+
"refreshToken",
|
|
182
|
+
"accessTokenExpiresAt",
|
|
183
|
+
"refreshTokenExpiresAt",
|
|
184
|
+
"user"
|
|
185
|
+
],
|
|
186
|
+
"additionalProperties": false,
|
|
187
|
+
"description": "Response DTO for social login Contains authentication tokens and user information"
|
|
188
|
+
},
|
|
189
|
+
"SocialGoogleUnlinkSocialAccountDTO": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"properties": {
|
|
192
|
+
"provider": {
|
|
193
|
+
"$ref": "#/components/schemas/SocialGoogleSocialProvider",
|
|
194
|
+
"description": "Social provider name to unlink Must be one of the currently linked providers\n\nValidation:\n- Must be a valid SocialProvider enum value"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"required": [
|
|
198
|
+
"provider"
|
|
199
|
+
],
|
|
200
|
+
"additionalProperties": false,
|
|
201
|
+
"description": "DTO for unlinking social account Used when an authenticated user wants to remove a social provider"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-openapi.d.ts","sourceRoot":"","sources":["../../../src/openapi/generate-openapi.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CA2C7C"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateOpenApiSchemas = generateOpenApiSchemas;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const node_path_1 = require("node:path");
|
|
39
|
+
const ts_json_schema_generator_1 = require("ts-json-schema-generator");
|
|
40
|
+
const ts = __importStar(require("typescript"));
|
|
41
|
+
const SCHEMA_PREFIX = 'SocialGoogle';
|
|
42
|
+
/**
|
|
43
|
+
* Build-time OpenAPI schema generator for `@nauth-toolkit/social-google` DTOs.
|
|
44
|
+
*
|
|
45
|
+
* Output:
|
|
46
|
+
* - `dist/src/openapi/components.schemas.json`
|
|
47
|
+
*/
|
|
48
|
+
function generateOpenApiSchemas() {
|
|
49
|
+
const packageRoot = (0, node_path_1.resolve)(__dirname, '..', '..', '..');
|
|
50
|
+
const tsconfigPath = (0, node_path_1.join)(packageRoot, 'tsconfig.json');
|
|
51
|
+
const outputDir = __dirname;
|
|
52
|
+
const outputJsonPath = (0, node_path_1.join)(outputDir, 'components.schemas.json');
|
|
53
|
+
const tempRegistryPath = (0, node_path_1.join)(packageRoot, 'src', 'openapi', '_nauth-openapi-dto-registry.ts');
|
|
54
|
+
(0, node_fs_1.mkdirSync)(outputDir, { recursive: true });
|
|
55
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(tempRegistryPath), { recursive: true });
|
|
56
|
+
const dtoFiles = listDtoSourceFiles((0, node_path_1.join)(packageRoot, 'src', 'dto'));
|
|
57
|
+
const exportedSymbolsByModule = dtoFiles.map((filePath, idx) => ({
|
|
58
|
+
namespace: `Dtos${idx}`,
|
|
59
|
+
modulePath: filePath,
|
|
60
|
+
symbols: collectExportedSymbols(filePath),
|
|
61
|
+
}));
|
|
62
|
+
const allSymbolsCount = exportedSymbolsByModule.reduce((acc, m) => acc + m.symbols.length, 0);
|
|
63
|
+
if (allSymbolsCount === 0) {
|
|
64
|
+
throw new Error('OpenAPI generation failed: no exported DTO symbols found under src/dto/.');
|
|
65
|
+
}
|
|
66
|
+
(0, node_fs_1.writeFileSync)(tempRegistryPath, renderRegistryType(exportedSymbolsByModule), 'utf8');
|
|
67
|
+
try {
|
|
68
|
+
const generatorConfig = {
|
|
69
|
+
path: tempRegistryPath,
|
|
70
|
+
tsconfig: tsconfigPath,
|
|
71
|
+
type: 'NAuthOpenApiDtoRegistry',
|
|
72
|
+
expose: 'all',
|
|
73
|
+
skipTypeCheck: true,
|
|
74
|
+
};
|
|
75
|
+
const generator = (0, ts_json_schema_generator_1.createGenerator)(generatorConfig);
|
|
76
|
+
const jsonSchema = generator.createSchema('NAuthOpenApiDtoRegistry');
|
|
77
|
+
const openApiDoc = buildOpenApiDocumentFromJsonSchema(jsonSchema, SCHEMA_PREFIX);
|
|
78
|
+
(0, node_fs_1.writeFileSync)(outputJsonPath, `${JSON.stringify(openApiDoc, null, 2)}\n`, 'utf8');
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
(0, node_fs_1.rmSync)(tempRegistryPath, { force: true });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function listDtoSourceFiles(dtoDir) {
|
|
85
|
+
const entries = (0, node_fs_1.readdirSync)(dtoDir, { withFileTypes: true });
|
|
86
|
+
return entries
|
|
87
|
+
.filter((e) => e.isFile() && e.name.endsWith('.ts') && !e.name.endsWith('.spec.ts') && e.name !== 'index.ts')
|
|
88
|
+
.map((e) => (0, node_path_1.join)(dtoDir, e.name))
|
|
89
|
+
.sort();
|
|
90
|
+
}
|
|
91
|
+
function collectExportedSymbols(filePath) {
|
|
92
|
+
const src = (0, node_fs_1.readFileSync)(filePath, 'utf8');
|
|
93
|
+
const sourceFile = ts.createSourceFile(filePath, src, ts.ScriptTarget.ES2022, true);
|
|
94
|
+
const symbols = new Set();
|
|
95
|
+
for (const statement of sourceFile.statements) {
|
|
96
|
+
if (!hasExportModifier(statement))
|
|
97
|
+
continue;
|
|
98
|
+
if (ts.isClassDeclaration(statement) && statement.name)
|
|
99
|
+
symbols.add(statement.name.text);
|
|
100
|
+
if (ts.isInterfaceDeclaration(statement) && statement.name)
|
|
101
|
+
symbols.add(statement.name.text);
|
|
102
|
+
if (ts.isEnumDeclaration(statement) && statement.name)
|
|
103
|
+
symbols.add(statement.name.text);
|
|
104
|
+
if (ts.isTypeAliasDeclaration(statement) && statement.name)
|
|
105
|
+
symbols.add(statement.name.text);
|
|
106
|
+
}
|
|
107
|
+
return Array.from(symbols).sort();
|
|
108
|
+
}
|
|
109
|
+
function hasExportModifier(node) {
|
|
110
|
+
const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;
|
|
111
|
+
return !!modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
112
|
+
}
|
|
113
|
+
function renderRegistryType(modules) {
|
|
114
|
+
const lines = [];
|
|
115
|
+
lines.push('/**');
|
|
116
|
+
lines.push(' * AUTO-GENERATED FILE (build-time only)');
|
|
117
|
+
lines.push(' */');
|
|
118
|
+
const registryDir = (0, node_path_1.resolve)(__dirname, '..', '..', '..', 'src', 'openapi');
|
|
119
|
+
for (const m of modules) {
|
|
120
|
+
const relFromRegistry = (0, node_path_1.relative)(registryDir, m.modulePath).replace(/\\/g, '/').replace(/\.ts$/, '');
|
|
121
|
+
lines.push(`import type * as ${m.namespace} from '${relFromRegistry}';`);
|
|
122
|
+
}
|
|
123
|
+
lines.push('');
|
|
124
|
+
lines.push('export type NAuthOpenApiDtoRegistry = {');
|
|
125
|
+
for (const m of modules) {
|
|
126
|
+
for (const name of m.symbols) {
|
|
127
|
+
lines.push(` ${name}: ${m.namespace}.${name};`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
lines.push('};');
|
|
131
|
+
lines.push('');
|
|
132
|
+
return lines.join('\n');
|
|
133
|
+
}
|
|
134
|
+
function buildOpenApiDocumentFromJsonSchema(jsonSchema, prefix) {
|
|
135
|
+
if (typeof jsonSchema !== 'object' || jsonSchema === null || !('definitions' in jsonSchema)) {
|
|
136
|
+
throw new Error('OpenAPI generation failed: JSON Schema missing `definitions`.');
|
|
137
|
+
}
|
|
138
|
+
const definitions = jsonSchema.definitions ?? {};
|
|
139
|
+
const renameMap = new Map();
|
|
140
|
+
for (const name of Object.keys(definitions)) {
|
|
141
|
+
if (name === 'NAuthOpenApiDtoRegistry')
|
|
142
|
+
continue;
|
|
143
|
+
renameMap.set(name, `${prefix}${name}`);
|
|
144
|
+
}
|
|
145
|
+
const schemas = {};
|
|
146
|
+
for (const [name, schema] of Object.entries(definitions)) {
|
|
147
|
+
if (name === 'NAuthOpenApiDtoRegistry')
|
|
148
|
+
continue;
|
|
149
|
+
const renamed = renameMap.get(name) ?? name;
|
|
150
|
+
schemas[renamed] = rewriteRefsAndRename(schema, renameMap);
|
|
151
|
+
}
|
|
152
|
+
return { openapi: '3.0.3', components: { schemas } };
|
|
153
|
+
}
|
|
154
|
+
function rewriteRefsAndRename(value, renameMap) {
|
|
155
|
+
if (Array.isArray(value))
|
|
156
|
+
return value.map((v) => rewriteRefsAndRename(v, renameMap));
|
|
157
|
+
if (typeof value !== 'object' || value === null)
|
|
158
|
+
return value;
|
|
159
|
+
const obj = value;
|
|
160
|
+
const next = {};
|
|
161
|
+
for (const [key, val] of Object.entries(obj)) {
|
|
162
|
+
if (key === '$ref' && typeof val === 'string') {
|
|
163
|
+
const openApiRef = val.replace(/^#\/definitions\//, '#/components/schemas/');
|
|
164
|
+
const refName = openApiRef.replace(/^#\/components\/schemas\//, '');
|
|
165
|
+
const renamed = renameMap.get(refName);
|
|
166
|
+
next[key] = renamed ? `#/components/schemas/${renamed}` : openApiRef;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
next[key] = rewriteRefsAndRename(val, renameMap);
|
|
170
|
+
}
|
|
171
|
+
return next;
|
|
172
|
+
}
|
|
173
|
+
if (require.main === module) {
|
|
174
|
+
generateOpenApiSchemas();
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=generate-openapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-openapi.js","sourceRoot":"","sources":["../../../src/openapi/generate-openapi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,wDA2CC;AAxDD,qCAAsF;AACtF,yCAA6D;AAC7D,uEAAwE;AACxE,+CAAiC;AAEjC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC;;;;;GAKG;AACH,SAAgB,sBAAsB;IACpC,MAAM,WAA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,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IACtF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAE9D,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,MAAM,IAAI,GAA4B,EAAE,CAAC;IAEzC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,IAAI,GAAG,KAAK,MAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,CAAC;YAC7E,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;YACpE,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;YACrE,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,oBAAoB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,sBAAsB,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI component schemas exported by `@nauth-toolkit/social-google`.
|
|
3
|
+
*
|
|
4
|
+
* Notes:
|
|
5
|
+
* - Schemas are generated at build time into `dist/src/openapi/components.schemas.json`
|
|
6
|
+
* - Schema names are prefixed with `SocialGoogle` to avoid collisions when merging
|
|
7
|
+
* multiple nauth-toolkit OpenAPI exports.
|
|
8
|
+
*/
|
|
9
|
+
export interface NAuthOpenApiDocument {
|
|
10
|
+
openapi: string;
|
|
11
|
+
components: {
|
|
12
|
+
schemas: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function loadNAuthOpenApiDocument(): NAuthOpenApiDocument;
|
|
16
|
+
export declare function loadNAuthOpenApiSchemas(): Record<string, unknown>;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/openapi/index.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC;CACH;AAED,wBAAgB,wBAAwB,IAAI,oBAAoB,CAI/D;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadNAuthOpenApiDocument = loadNAuthOpenApiDocument;
|
|
4
|
+
exports.loadNAuthOpenApiSchemas = loadNAuthOpenApiSchemas;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
function loadNAuthOpenApiDocument() {
|
|
8
|
+
const filePath = (0, node_path_1.join)(__dirname, 'components.schemas.json');
|
|
9
|
+
const json = (0, node_fs_1.readFileSync)(filePath, 'utf8');
|
|
10
|
+
return JSON.parse(json);
|
|
11
|
+
}
|
|
12
|
+
function loadNAuthOpenApiSchemas() {
|
|
13
|
+
return loadNAuthOpenApiDocument().components.schemas;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/openapi/index.ts"],"names":[],"mappings":";;AAkBA,4DAIC;AAED,0DAEC;AA1BD,qCAAuC;AACvC,yCAAiC;AAiBjC,SAAgB,wBAAwB;IACtC,MAAM,QAAQ,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAyB,CAAC;AAClD,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO,wBAAwB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;AACvD,CAAC"}
|