@classytic/arc 1.0.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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +900 -0
  3. package/bin/arc.js +344 -0
  4. package/dist/adapters/index.d.ts +237 -0
  5. package/dist/adapters/index.js +668 -0
  6. package/dist/arcCorePlugin-DTPWXcZN.d.ts +273 -0
  7. package/dist/audit/index.d.ts +195 -0
  8. package/dist/audit/index.js +319 -0
  9. package/dist/auth/index.d.ts +47 -0
  10. package/dist/auth/index.js +174 -0
  11. package/dist/cli/commands/docs.d.ts +11 -0
  12. package/dist/cli/commands/docs.js +474 -0
  13. package/dist/cli/commands/introspect.d.ts +8 -0
  14. package/dist/cli/commands/introspect.js +338 -0
  15. package/dist/cli/index.d.ts +43 -0
  16. package/dist/cli/index.js +520 -0
  17. package/dist/createApp-pzUAkzbz.d.ts +77 -0
  18. package/dist/docs/index.d.ts +166 -0
  19. package/dist/docs/index.js +650 -0
  20. package/dist/errors-8WIxGS_6.d.ts +122 -0
  21. package/dist/events/index.d.ts +117 -0
  22. package/dist/events/index.js +89 -0
  23. package/dist/factory/index.d.ts +38 -0
  24. package/dist/factory/index.js +1664 -0
  25. package/dist/hooks/index.d.ts +4 -0
  26. package/dist/hooks/index.js +199 -0
  27. package/dist/idempotency/index.d.ts +323 -0
  28. package/dist/idempotency/index.js +500 -0
  29. package/dist/index-DkAW8BXh.d.ts +1302 -0
  30. package/dist/index.d.ts +331 -0
  31. package/dist/index.js +4734 -0
  32. package/dist/migrations/index.d.ts +185 -0
  33. package/dist/migrations/index.js +274 -0
  34. package/dist/org/index.d.ts +129 -0
  35. package/dist/org/index.js +220 -0
  36. package/dist/permissions/index.d.ts +144 -0
  37. package/dist/permissions/index.js +100 -0
  38. package/dist/plugins/index.d.ts +46 -0
  39. package/dist/plugins/index.js +1069 -0
  40. package/dist/policies/index.d.ts +398 -0
  41. package/dist/policies/index.js +196 -0
  42. package/dist/presets/index.d.ts +336 -0
  43. package/dist/presets/index.js +382 -0
  44. package/dist/presets/multiTenant.d.ts +39 -0
  45. package/dist/presets/multiTenant.js +112 -0
  46. package/dist/registry/index.d.ts +16 -0
  47. package/dist/registry/index.js +253 -0
  48. package/dist/testing/index.d.ts +618 -0
  49. package/dist/testing/index.js +48032 -0
  50. package/dist/types/index.d.ts +4 -0
  51. package/dist/types/index.js +8 -0
  52. package/dist/types-0IPhH_NR.d.ts +143 -0
  53. package/dist/types-B99TBmFV.d.ts +76 -0
  54. package/dist/utils/index.d.ts +655 -0
  55. package/dist/utils/index.js +905 -0
  56. package/package.json +227 -0
@@ -0,0 +1,166 @@
1
+ import { FastifyPluginAsync } from 'fastify';
2
+
3
+ /**
4
+ * OpenAPI Spec Generator
5
+ *
6
+ * Auto-generates OpenAPI 3.0 specification from Arc resource registry.
7
+ *
8
+ * @example
9
+ * import { openApiPlugin } from '@classytic/arc/docs';
10
+ *
11
+ * await fastify.register(openApiPlugin, {
12
+ * title: 'My API',
13
+ * version: '1.0.0',
14
+ * });
15
+ *
16
+ * // Spec available at /_docs/openapi.json
17
+ */
18
+
19
+ interface OpenApiOptions {
20
+ /** API title */
21
+ title?: string;
22
+ /** API version */
23
+ version?: string;
24
+ /** API description */
25
+ description?: string;
26
+ /** Server URL */
27
+ serverUrl?: string;
28
+ /** Route prefix for spec endpoint (default: '/_docs') */
29
+ prefix?: string;
30
+ /** API prefix for all resource paths (e.g., '/api/v1') */
31
+ apiPrefix?: string;
32
+ /** Auth roles required to access spec (default: [] = public) */
33
+ authRoles?: string[];
34
+ /** Include internal routes (default: false) */
35
+ includeInternal?: boolean;
36
+ /** Custom OpenAPI extensions */
37
+ extensions?: Record<string, unknown>;
38
+ }
39
+ interface OpenApiSpec {
40
+ openapi: string;
41
+ info: {
42
+ title: string;
43
+ version: string;
44
+ description?: string;
45
+ };
46
+ servers?: Array<{
47
+ url: string;
48
+ description?: string;
49
+ }>;
50
+ paths: Record<string, PathItem>;
51
+ components: {
52
+ schemas: Record<string, SchemaObject>;
53
+ securitySchemes?: Record<string, SecurityScheme>;
54
+ };
55
+ tags: Array<{
56
+ name: string;
57
+ description?: string;
58
+ }>;
59
+ security?: Array<Record<string, string[]>>;
60
+ }
61
+ interface PathItem {
62
+ get?: Operation;
63
+ post?: Operation;
64
+ put?: Operation;
65
+ patch?: Operation;
66
+ delete?: Operation;
67
+ options?: Operation;
68
+ head?: Operation;
69
+ }
70
+ interface Operation {
71
+ tags: string[];
72
+ summary: string;
73
+ description?: string;
74
+ operationId: string;
75
+ parameters?: Parameter[];
76
+ requestBody?: RequestBody;
77
+ responses: Record<string, Response>;
78
+ security?: Array<Record<string, string[]>>;
79
+ }
80
+ interface Parameter {
81
+ name: string;
82
+ in: 'path' | 'query' | 'header';
83
+ required?: boolean;
84
+ schema: SchemaObject;
85
+ description?: string;
86
+ }
87
+ interface RequestBody {
88
+ required?: boolean;
89
+ content: Record<string, {
90
+ schema: SchemaObject;
91
+ }>;
92
+ }
93
+ interface Response {
94
+ description: string;
95
+ content?: Record<string, {
96
+ schema: SchemaObject;
97
+ }>;
98
+ }
99
+ interface SchemaObject {
100
+ type?: string;
101
+ format?: string;
102
+ properties?: Record<string, SchemaObject>;
103
+ items?: SchemaObject;
104
+ required?: string[];
105
+ $ref?: string;
106
+ description?: string;
107
+ example?: unknown;
108
+ additionalProperties?: boolean | SchemaObject;
109
+ enum?: string[];
110
+ minimum?: number;
111
+ maximum?: number;
112
+ minLength?: number;
113
+ maxLength?: number;
114
+ pattern?: string;
115
+ }
116
+ interface SecurityScheme {
117
+ type: string;
118
+ scheme?: string;
119
+ bearerFormat?: string;
120
+ in?: string;
121
+ name?: string;
122
+ }
123
+ declare const openApiPlugin: FastifyPluginAsync<OpenApiOptions>;
124
+ declare const _default$1: FastifyPluginAsync<OpenApiOptions>;
125
+
126
+ /**
127
+ * Scalar API Reference Plugin
128
+ *
129
+ * Beautiful, modern API documentation UI.
130
+ * Lighter and more modern than Swagger UI.
131
+ *
132
+ * @example
133
+ * import { scalarPlugin } from '@classytic/arc/docs';
134
+ *
135
+ * await fastify.register(scalarPlugin, {
136
+ * routePrefix: '/docs',
137
+ * specUrl: '/_docs/openapi.json',
138
+ * });
139
+ *
140
+ * // UI available at /docs
141
+ */
142
+
143
+ interface ScalarOptions {
144
+ /** Route prefix for UI (default: '/docs') */
145
+ routePrefix?: string;
146
+ /** OpenAPI spec URL (default: '/_docs/openapi.json') */
147
+ specUrl?: string;
148
+ /** Page title */
149
+ title?: string;
150
+ /** Theme (default: 'default') */
151
+ theme?: 'default' | 'alternate' | 'moon' | 'purple' | 'solarized' | 'bluePlanet' | 'saturn' | 'kepler' | 'mars' | 'deepSpace';
152
+ /** Show sidebar (default: true) */
153
+ showSidebar?: boolean;
154
+ /** Dark mode (default: false) */
155
+ darkMode?: boolean;
156
+ /** Auth roles required to access docs */
157
+ authRoles?: string[];
158
+ /** Custom CSS */
159
+ customCss?: string;
160
+ /** Favicon URL */
161
+ favicon?: string;
162
+ }
163
+ declare const scalarPlugin: FastifyPluginAsync<ScalarOptions>;
164
+ declare const _default: FastifyPluginAsync<ScalarOptions>;
165
+
166
+ export { type OpenApiOptions, type OpenApiSpec, type ScalarOptions, _default$1 as openApiPlugin, openApiPlugin as openApiPluginFn, _default as scalarPlugin, scalarPlugin as scalarPluginFn };