@stackframe/stack-shared 2.8.22 → 2.8.25

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 (85) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/config/schema.d.mts +54 -10
  3. package/dist/config/schema.d.ts +54 -10
  4. package/dist/config/schema.js +6 -4
  5. package/dist/config/schema.js.map +1 -1
  6. package/dist/esm/config/schema.js +5 -3
  7. package/dist/esm/config/schema.js.map +1 -1
  8. package/dist/esm/helpers/emails.js +79 -0
  9. package/dist/esm/helpers/emails.js.map +1 -0
  10. package/dist/esm/interface/admin-interface.js +44 -12
  11. package/dist/esm/interface/admin-interface.js.map +1 -1
  12. package/dist/esm/interface/client-interface.js +41 -0
  13. package/dist/esm/interface/client-interface.js.map +1 -1
  14. package/dist/esm/interface/crud/{oauth.js → connected-accounts.js} +2 -2
  15. package/dist/esm/interface/crud/connected-accounts.js.map +1 -0
  16. package/dist/esm/interface/crud/oauth-providers.js +87 -0
  17. package/dist/esm/interface/crud/oauth-providers.js.map +1 -0
  18. package/dist/esm/interface/crud/projects.js +7 -5
  19. package/dist/esm/interface/crud/projects.js.map +1 -1
  20. package/dist/esm/interface/server-interface.js +51 -0
  21. package/dist/esm/interface/server-interface.js.map +1 -1
  22. package/dist/esm/known-errors.js +10 -0
  23. package/dist/esm/known-errors.js.map +1 -1
  24. package/dist/esm/schema-fields.js +24 -1
  25. package/dist/esm/schema-fields.js.map +1 -1
  26. package/dist/esm/utils/esbuild.js +14 -4
  27. package/dist/esm/utils/esbuild.js.map +1 -1
  28. package/dist/esm/utils/oauth.js +1 -1
  29. package/dist/esm/utils/oauth.js.map +1 -1
  30. package/dist/helpers/emails.d.mts +24 -0
  31. package/dist/helpers/emails.d.ts +24 -0
  32. package/dist/helpers/{email-themes.js → emails.js} +48 -11
  33. package/dist/helpers/emails.js.map +1 -0
  34. package/dist/index.d.mts +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/interface/admin-interface.d.mts +20 -11
  37. package/dist/interface/admin-interface.d.ts +20 -11
  38. package/dist/interface/admin-interface.js +44 -12
  39. package/dist/interface/admin-interface.js.map +1 -1
  40. package/dist/interface/client-interface.d.mts +24 -1
  41. package/dist/interface/client-interface.d.ts +24 -1
  42. package/dist/interface/client-interface.js +41 -0
  43. package/dist/interface/client-interface.js.map +1 -1
  44. package/dist/interface/crud/{oauth.js → connected-accounts.js} +5 -5
  45. package/dist/interface/crud/connected-accounts.js.map +1 -0
  46. package/dist/interface/crud/oauth-providers.d.mts +172 -0
  47. package/dist/interface/crud/oauth-providers.d.ts +172 -0
  48. package/dist/interface/crud/oauth-providers.js +107 -0
  49. package/dist/interface/crud/oauth-providers.js.map +1 -0
  50. package/dist/interface/crud/project-api-keys.d.mts +2 -2
  51. package/dist/interface/crud/project-api-keys.d.ts +2 -2
  52. package/dist/interface/crud/projects.d.mts +15 -12
  53. package/dist/interface/crud/projects.d.ts +15 -12
  54. package/dist/interface/crud/projects.js +5 -3
  55. package/dist/interface/crud/projects.js.map +1 -1
  56. package/dist/interface/server-interface.d.mts +45 -1
  57. package/dist/interface/server-interface.d.ts +45 -1
  58. package/dist/interface/server-interface.js +51 -0
  59. package/dist/interface/server-interface.js.map +1 -1
  60. package/dist/known-errors.d.mts +3 -0
  61. package/dist/known-errors.d.ts +3 -0
  62. package/dist/known-errors.js +10 -0
  63. package/dist/known-errors.js.map +1 -1
  64. package/dist/schema-fields.d.mts +16 -3
  65. package/dist/schema-fields.d.ts +16 -3
  66. package/dist/schema-fields.js +31 -1
  67. package/dist/schema-fields.js.map +1 -1
  68. package/dist/utils/esbuild.d.mts +3 -0
  69. package/dist/utils/esbuild.d.ts +3 -0
  70. package/dist/utils/esbuild.js +14 -4
  71. package/dist/utils/esbuild.js.map +1 -1
  72. package/dist/utils/oauth.d.mts +2 -2
  73. package/dist/utils/oauth.d.ts +2 -2
  74. package/dist/utils/oauth.js +1 -1
  75. package/dist/utils/oauth.js.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/esm/helpers/email-themes.js +0 -45
  78. package/dist/esm/helpers/email-themes.js.map +0 -1
  79. package/dist/esm/interface/crud/oauth.js.map +0 -1
  80. package/dist/helpers/email-themes.d.mts +0 -13
  81. package/dist/helpers/email-themes.d.ts +0 -13
  82. package/dist/helpers/email-themes.js.map +0 -1
  83. package/dist/interface/crud/oauth.js.map +0 -1
  84. /package/dist/interface/crud/{oauth.d.mts → connected-accounts.d.mts} +0 -0
  85. /package/dist/interface/crud/{oauth.d.ts → connected-accounts.d.ts} +0 -0
@@ -0,0 +1,172 @@
1
+ import { CrudSchemaFromOptions, CrudTypeOf } from '../../crud.mjs';
2
+ import * as yup from 'yup';
3
+ import '../../utils/types.mjs';
4
+
5
+ declare const oauthProviderClientReadSchema: yup.ObjectSchema<{
6
+ user_id: string;
7
+ id: string;
8
+ email: string | undefined;
9
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
10
+ allow_sign_in: boolean;
11
+ allow_connected_accounts: boolean;
12
+ }, yup.AnyObject, {
13
+ user_id: undefined;
14
+ id: undefined;
15
+ email: undefined;
16
+ type: undefined;
17
+ allow_sign_in: undefined;
18
+ allow_connected_accounts: undefined;
19
+ }, "">;
20
+ declare const oauthProviderServerReadSchema: yup.ObjectSchema<{
21
+ user_id: string;
22
+ id: string;
23
+ email: string | undefined;
24
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
25
+ allow_sign_in: boolean;
26
+ allow_connected_accounts: boolean;
27
+ } & {
28
+ account_id: string;
29
+ }, yup.AnyObject, {
30
+ user_id: undefined;
31
+ id: undefined;
32
+ email: undefined;
33
+ type: undefined;
34
+ allow_sign_in: undefined;
35
+ allow_connected_accounts: undefined;
36
+ account_id: undefined;
37
+ }, "">;
38
+ declare const oauthProviderCrudClientUpdateSchema: yup.ObjectSchema<{
39
+ allow_sign_in: boolean | undefined;
40
+ allow_connected_accounts: boolean | undefined;
41
+ }, yup.AnyObject, {
42
+ allow_sign_in: undefined;
43
+ allow_connected_accounts: undefined;
44
+ }, "">;
45
+ declare const oauthProviderCrudServerUpdateSchema: yup.ObjectSchema<{
46
+ allow_sign_in: boolean | undefined;
47
+ allow_connected_accounts: boolean | undefined;
48
+ } & {
49
+ email: string | undefined;
50
+ account_id: string | undefined;
51
+ }, yup.AnyObject, {
52
+ allow_sign_in: undefined;
53
+ allow_connected_accounts: undefined;
54
+ email: undefined;
55
+ account_id: undefined;
56
+ }, "">;
57
+ declare const oauthProviderCrudServerCreateSchema: yup.ObjectSchema<{
58
+ user_id: string;
59
+ provider_config_id: string;
60
+ email: string | undefined;
61
+ allow_sign_in: boolean;
62
+ allow_connected_accounts: boolean;
63
+ account_id: string;
64
+ }, yup.AnyObject, {
65
+ user_id: undefined;
66
+ provider_config_id: undefined;
67
+ email: undefined;
68
+ allow_sign_in: undefined;
69
+ allow_connected_accounts: undefined;
70
+ account_id: undefined;
71
+ }, "">;
72
+ declare const oauthProviderCrudClientDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
73
+ declare const oauthProviderCrud: CrudSchemaFromOptions<{
74
+ clientReadSchema: yup.ObjectSchema<{
75
+ user_id: string;
76
+ id: string;
77
+ email: string | undefined;
78
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
79
+ allow_sign_in: boolean;
80
+ allow_connected_accounts: boolean;
81
+ }, yup.AnyObject, {
82
+ user_id: undefined;
83
+ id: undefined;
84
+ email: undefined;
85
+ type: undefined;
86
+ allow_sign_in: undefined;
87
+ allow_connected_accounts: undefined;
88
+ }, "">;
89
+ clientUpdateSchema: yup.ObjectSchema<{
90
+ allow_sign_in: boolean | undefined;
91
+ allow_connected_accounts: boolean | undefined;
92
+ }, yup.AnyObject, {
93
+ allow_sign_in: undefined;
94
+ allow_connected_accounts: undefined;
95
+ }, "">;
96
+ clientDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
97
+ serverReadSchema: yup.ObjectSchema<{
98
+ user_id: string;
99
+ id: string;
100
+ email: string | undefined;
101
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
102
+ allow_sign_in: boolean;
103
+ allow_connected_accounts: boolean;
104
+ } & {
105
+ account_id: string;
106
+ }, yup.AnyObject, {
107
+ user_id: undefined;
108
+ id: undefined;
109
+ email: undefined;
110
+ type: undefined;
111
+ allow_sign_in: undefined;
112
+ allow_connected_accounts: undefined;
113
+ account_id: undefined;
114
+ }, "">;
115
+ serverUpdateSchema: yup.ObjectSchema<{
116
+ allow_sign_in: boolean | undefined;
117
+ allow_connected_accounts: boolean | undefined;
118
+ } & {
119
+ email: string | undefined;
120
+ account_id: string | undefined;
121
+ }, yup.AnyObject, {
122
+ allow_sign_in: undefined;
123
+ allow_connected_accounts: undefined;
124
+ email: undefined;
125
+ account_id: undefined;
126
+ }, "">;
127
+ serverCreateSchema: yup.ObjectSchema<{
128
+ user_id: string;
129
+ provider_config_id: string;
130
+ email: string | undefined;
131
+ allow_sign_in: boolean;
132
+ allow_connected_accounts: boolean;
133
+ account_id: string;
134
+ }, yup.AnyObject, {
135
+ user_id: undefined;
136
+ provider_config_id: undefined;
137
+ email: undefined;
138
+ allow_sign_in: undefined;
139
+ allow_connected_accounts: undefined;
140
+ account_id: undefined;
141
+ }, "">;
142
+ docs: {
143
+ clientRead: {
144
+ summary: string;
145
+ description: string;
146
+ tags: string[];
147
+ };
148
+ serverCreate: {
149
+ summary: string;
150
+ description: string;
151
+ tags: string[];
152
+ };
153
+ serverUpdate: {
154
+ summary: string;
155
+ description: string;
156
+ tags: string[];
157
+ };
158
+ clientDelete: {
159
+ summary: string;
160
+ description: string;
161
+ tags: string[];
162
+ };
163
+ clientList: {
164
+ summary: string;
165
+ description: string;
166
+ tags: string[];
167
+ };
168
+ };
169
+ }>;
170
+ type OAuthProviderCrud = CrudTypeOf<typeof oauthProviderCrud>;
171
+
172
+ export { type OAuthProviderCrud, oauthProviderClientReadSchema, oauthProviderCrud, oauthProviderCrudClientDeleteSchema, oauthProviderCrudClientUpdateSchema, oauthProviderCrudServerCreateSchema, oauthProviderCrudServerUpdateSchema, oauthProviderServerReadSchema };
@@ -0,0 +1,172 @@
1
+ import { CrudSchemaFromOptions, CrudTypeOf } from '../../crud.js';
2
+ import * as yup from 'yup';
3
+ import '../../utils/types.js';
4
+
5
+ declare const oauthProviderClientReadSchema: yup.ObjectSchema<{
6
+ user_id: string;
7
+ id: string;
8
+ email: string | undefined;
9
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
10
+ allow_sign_in: boolean;
11
+ allow_connected_accounts: boolean;
12
+ }, yup.AnyObject, {
13
+ user_id: undefined;
14
+ id: undefined;
15
+ email: undefined;
16
+ type: undefined;
17
+ allow_sign_in: undefined;
18
+ allow_connected_accounts: undefined;
19
+ }, "">;
20
+ declare const oauthProviderServerReadSchema: yup.ObjectSchema<{
21
+ user_id: string;
22
+ id: string;
23
+ email: string | undefined;
24
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
25
+ allow_sign_in: boolean;
26
+ allow_connected_accounts: boolean;
27
+ } & {
28
+ account_id: string;
29
+ }, yup.AnyObject, {
30
+ user_id: undefined;
31
+ id: undefined;
32
+ email: undefined;
33
+ type: undefined;
34
+ allow_sign_in: undefined;
35
+ allow_connected_accounts: undefined;
36
+ account_id: undefined;
37
+ }, "">;
38
+ declare const oauthProviderCrudClientUpdateSchema: yup.ObjectSchema<{
39
+ allow_sign_in: boolean | undefined;
40
+ allow_connected_accounts: boolean | undefined;
41
+ }, yup.AnyObject, {
42
+ allow_sign_in: undefined;
43
+ allow_connected_accounts: undefined;
44
+ }, "">;
45
+ declare const oauthProviderCrudServerUpdateSchema: yup.ObjectSchema<{
46
+ allow_sign_in: boolean | undefined;
47
+ allow_connected_accounts: boolean | undefined;
48
+ } & {
49
+ email: string | undefined;
50
+ account_id: string | undefined;
51
+ }, yup.AnyObject, {
52
+ allow_sign_in: undefined;
53
+ allow_connected_accounts: undefined;
54
+ email: undefined;
55
+ account_id: undefined;
56
+ }, "">;
57
+ declare const oauthProviderCrudServerCreateSchema: yup.ObjectSchema<{
58
+ user_id: string;
59
+ provider_config_id: string;
60
+ email: string | undefined;
61
+ allow_sign_in: boolean;
62
+ allow_connected_accounts: boolean;
63
+ account_id: string;
64
+ }, yup.AnyObject, {
65
+ user_id: undefined;
66
+ provider_config_id: undefined;
67
+ email: undefined;
68
+ allow_sign_in: undefined;
69
+ allow_connected_accounts: undefined;
70
+ account_id: undefined;
71
+ }, "">;
72
+ declare const oauthProviderCrudClientDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
73
+ declare const oauthProviderCrud: CrudSchemaFromOptions<{
74
+ clientReadSchema: yup.ObjectSchema<{
75
+ user_id: string;
76
+ id: string;
77
+ email: string | undefined;
78
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
79
+ allow_sign_in: boolean;
80
+ allow_connected_accounts: boolean;
81
+ }, yup.AnyObject, {
82
+ user_id: undefined;
83
+ id: undefined;
84
+ email: undefined;
85
+ type: undefined;
86
+ allow_sign_in: undefined;
87
+ allow_connected_accounts: undefined;
88
+ }, "">;
89
+ clientUpdateSchema: yup.ObjectSchema<{
90
+ allow_sign_in: boolean | undefined;
91
+ allow_connected_accounts: boolean | undefined;
92
+ }, yup.AnyObject, {
93
+ allow_sign_in: undefined;
94
+ allow_connected_accounts: undefined;
95
+ }, "">;
96
+ clientDeleteSchema: yup.MixedSchema<{} | undefined, yup.AnyObject, undefined, "">;
97
+ serverReadSchema: yup.ObjectSchema<{
98
+ user_id: string;
99
+ id: string;
100
+ email: string | undefined;
101
+ type: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | "twitch";
102
+ allow_sign_in: boolean;
103
+ allow_connected_accounts: boolean;
104
+ } & {
105
+ account_id: string;
106
+ }, yup.AnyObject, {
107
+ user_id: undefined;
108
+ id: undefined;
109
+ email: undefined;
110
+ type: undefined;
111
+ allow_sign_in: undefined;
112
+ allow_connected_accounts: undefined;
113
+ account_id: undefined;
114
+ }, "">;
115
+ serverUpdateSchema: yup.ObjectSchema<{
116
+ allow_sign_in: boolean | undefined;
117
+ allow_connected_accounts: boolean | undefined;
118
+ } & {
119
+ email: string | undefined;
120
+ account_id: string | undefined;
121
+ }, yup.AnyObject, {
122
+ allow_sign_in: undefined;
123
+ allow_connected_accounts: undefined;
124
+ email: undefined;
125
+ account_id: undefined;
126
+ }, "">;
127
+ serverCreateSchema: yup.ObjectSchema<{
128
+ user_id: string;
129
+ provider_config_id: string;
130
+ email: string | undefined;
131
+ allow_sign_in: boolean;
132
+ allow_connected_accounts: boolean;
133
+ account_id: string;
134
+ }, yup.AnyObject, {
135
+ user_id: undefined;
136
+ provider_config_id: undefined;
137
+ email: undefined;
138
+ allow_sign_in: undefined;
139
+ allow_connected_accounts: undefined;
140
+ account_id: undefined;
141
+ }, "">;
142
+ docs: {
143
+ clientRead: {
144
+ summary: string;
145
+ description: string;
146
+ tags: string[];
147
+ };
148
+ serverCreate: {
149
+ summary: string;
150
+ description: string;
151
+ tags: string[];
152
+ };
153
+ serverUpdate: {
154
+ summary: string;
155
+ description: string;
156
+ tags: string[];
157
+ };
158
+ clientDelete: {
159
+ summary: string;
160
+ description: string;
161
+ tags: string[];
162
+ };
163
+ clientList: {
164
+ summary: string;
165
+ description: string;
166
+ tags: string[];
167
+ };
168
+ };
169
+ }>;
170
+ type OAuthProviderCrud = CrudTypeOf<typeof oauthProviderCrud>;
171
+
172
+ export { type OAuthProviderCrud, oauthProviderClientReadSchema, oauthProviderCrud, oauthProviderCrudClientDeleteSchema, oauthProviderCrudClientUpdateSchema, oauthProviderCrudServerCreateSchema, oauthProviderCrudServerUpdateSchema, oauthProviderServerReadSchema };
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/interface/crud/oauth-providers.ts
21
+ var oauth_providers_exports = {};
22
+ __export(oauth_providers_exports, {
23
+ oauthProviderClientReadSchema: () => oauthProviderClientReadSchema,
24
+ oauthProviderCrud: () => oauthProviderCrud,
25
+ oauthProviderCrudClientDeleteSchema: () => oauthProviderCrudClientDeleteSchema,
26
+ oauthProviderCrudClientUpdateSchema: () => oauthProviderCrudClientUpdateSchema,
27
+ oauthProviderCrudServerCreateSchema: () => oauthProviderCrudServerCreateSchema,
28
+ oauthProviderCrudServerUpdateSchema: () => oauthProviderCrudServerUpdateSchema,
29
+ oauthProviderServerReadSchema: () => oauthProviderServerReadSchema
30
+ });
31
+ module.exports = __toCommonJS(oauth_providers_exports);
32
+ var import_crud = require("../../crud.js");
33
+ var import_schema_fields = require("../../schema-fields.js");
34
+ var oauthProviderClientReadSchema = (0, import_schema_fields.yupObject)({
35
+ user_id: import_schema_fields.userIdOrMeSchema.defined(),
36
+ id: import_schema_fields.oauthProviderIdSchema.defined(),
37
+ email: import_schema_fields.oauthProviderEmailSchema.optional(),
38
+ type: import_schema_fields.oauthProviderTypeSchema.defined(),
39
+ allow_sign_in: import_schema_fields.oauthProviderAllowSignInSchema.defined(),
40
+ allow_connected_accounts: import_schema_fields.oauthProviderAllowConnectedAccountsSchema.defined()
41
+ }).defined();
42
+ var oauthProviderServerReadSchema = oauthProviderClientReadSchema.concat((0, import_schema_fields.yupObject)({
43
+ account_id: import_schema_fields.oauthProviderAccountIdSchema.defined()
44
+ }));
45
+ var oauthProviderCrudClientUpdateSchema = (0, import_schema_fields.yupObject)({
46
+ allow_sign_in: import_schema_fields.oauthProviderAllowSignInSchema.optional(),
47
+ allow_connected_accounts: import_schema_fields.oauthProviderAllowConnectedAccountsSchema.optional()
48
+ }).defined();
49
+ var oauthProviderCrudServerUpdateSchema = oauthProviderCrudClientUpdateSchema.concat((0, import_schema_fields.yupObject)({
50
+ email: import_schema_fields.oauthProviderEmailSchema.optional(),
51
+ account_id: import_schema_fields.oauthProviderAccountIdSchema.optional()
52
+ }));
53
+ var oauthProviderCrudServerCreateSchema = (0, import_schema_fields.yupObject)({
54
+ user_id: import_schema_fields.userIdOrMeSchema.defined(),
55
+ provider_config_id: (0, import_schema_fields.yupString)().defined(),
56
+ email: import_schema_fields.oauthProviderEmailSchema.optional(),
57
+ allow_sign_in: import_schema_fields.oauthProviderAllowSignInSchema.defined(),
58
+ allow_connected_accounts: import_schema_fields.oauthProviderAllowConnectedAccountsSchema.defined(),
59
+ account_id: import_schema_fields.oauthProviderAccountIdSchema.defined()
60
+ }).defined();
61
+ var oauthProviderCrudClientDeleteSchema = (0, import_schema_fields.yupMixed)();
62
+ var oauthProviderCrud = (0, import_crud.createCrud)({
63
+ clientReadSchema: oauthProviderClientReadSchema,
64
+ clientUpdateSchema: oauthProviderCrudClientUpdateSchema,
65
+ clientDeleteSchema: oauthProviderCrudClientDeleteSchema,
66
+ serverReadSchema: oauthProviderServerReadSchema,
67
+ serverUpdateSchema: oauthProviderCrudServerUpdateSchema,
68
+ serverCreateSchema: oauthProviderCrudServerCreateSchema,
69
+ docs: {
70
+ clientRead: {
71
+ summary: "Get an OAuth provider",
72
+ description: "Retrieves a specific OAuth provider by the user ID and the OAuth provider ID.",
73
+ tags: ["OAuth Providers"]
74
+ },
75
+ serverCreate: {
76
+ summary: "Create an OAuth provider",
77
+ description: "Add a new OAuth provider for a user.",
78
+ tags: ["OAuth Providers"]
79
+ },
80
+ serverUpdate: {
81
+ summary: "Update an OAuth provider",
82
+ description: "Updates an existing OAuth provider. Only the values provided will be updated.",
83
+ tags: ["OAuth Providers"]
84
+ },
85
+ clientDelete: {
86
+ summary: "Delete an OAuth provider",
87
+ description: "Removes an OAuth provider for a given user.",
88
+ tags: ["OAuth Providers"]
89
+ },
90
+ clientList: {
91
+ summary: "List OAuth providers",
92
+ description: "Retrieves a list of all OAuth providers for a user.",
93
+ tags: ["OAuth Providers"]
94
+ }
95
+ }
96
+ });
97
+ // Annotate the CommonJS export names for ESM import in node:
98
+ 0 && (module.exports = {
99
+ oauthProviderClientReadSchema,
100
+ oauthProviderCrud,
101
+ oauthProviderCrudClientDeleteSchema,
102
+ oauthProviderCrudClientUpdateSchema,
103
+ oauthProviderCrudServerCreateSchema,
104
+ oauthProviderCrudServerUpdateSchema,
105
+ oauthProviderServerReadSchema
106
+ });
107
+ //# sourceMappingURL=oauth-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/interface/crud/oauth-providers.ts"],"sourcesContent":["import { CrudTypeOf, createCrud } from \"../../crud\";\nimport {\n oauthProviderAccountIdSchema,\n oauthProviderAllowConnectedAccountsSchema,\n oauthProviderAllowSignInSchema,\n oauthProviderEmailSchema,\n oauthProviderIdSchema,\n oauthProviderTypeSchema,\n userIdOrMeSchema,\n yupMixed,\n yupObject,\n yupString\n} from \"../../schema-fields\";\n\nexport const oauthProviderClientReadSchema = yupObject({\n user_id: userIdOrMeSchema.defined(),\n id: oauthProviderIdSchema.defined(),\n email: oauthProviderEmailSchema.optional(),\n type: oauthProviderTypeSchema.defined(),\n allow_sign_in: oauthProviderAllowSignInSchema.defined(),\n allow_connected_accounts: oauthProviderAllowConnectedAccountsSchema.defined(),\n}).defined();\n\nexport const oauthProviderServerReadSchema = oauthProviderClientReadSchema.concat(yupObject({\n account_id: oauthProviderAccountIdSchema.defined(),\n}));\n\nexport const oauthProviderCrudClientUpdateSchema = yupObject({\n allow_sign_in: oauthProviderAllowSignInSchema.optional(),\n allow_connected_accounts: oauthProviderAllowConnectedAccountsSchema.optional(),\n}).defined();\n\nexport const oauthProviderCrudServerUpdateSchema = oauthProviderCrudClientUpdateSchema.concat(yupObject({\n email: oauthProviderEmailSchema.optional(),\n account_id: oauthProviderAccountIdSchema.optional(),\n}));\n\nexport const oauthProviderCrudServerCreateSchema = yupObject({\n user_id: userIdOrMeSchema.defined(),\n provider_config_id: yupString().defined(),\n email: oauthProviderEmailSchema.optional(),\n allow_sign_in: oauthProviderAllowSignInSchema.defined(),\n allow_connected_accounts: oauthProviderAllowConnectedAccountsSchema.defined(),\n account_id: oauthProviderAccountIdSchema.defined(),\n}).defined();\n\nexport const oauthProviderCrudClientDeleteSchema = yupMixed();\n\nexport const oauthProviderCrud = createCrud({\n clientReadSchema: oauthProviderClientReadSchema,\n clientUpdateSchema: oauthProviderCrudClientUpdateSchema,\n clientDeleteSchema: oauthProviderCrudClientDeleteSchema,\n serverReadSchema: oauthProviderServerReadSchema,\n serverUpdateSchema: oauthProviderCrudServerUpdateSchema,\n serverCreateSchema: oauthProviderCrudServerCreateSchema,\n docs: {\n clientRead: {\n summary: \"Get an OAuth provider\",\n description: \"Retrieves a specific OAuth provider by the user ID and the OAuth provider ID.\",\n tags: [\"OAuth Providers\"],\n },\n serverCreate: {\n summary: \"Create an OAuth provider\",\n description: \"Add a new OAuth provider for a user.\",\n tags: [\"OAuth Providers\"],\n },\n serverUpdate: {\n summary: \"Update an OAuth provider\",\n description: \"Updates an existing OAuth provider. Only the values provided will be updated.\",\n tags: [\"OAuth Providers\"],\n },\n clientDelete: {\n summary: \"Delete an OAuth provider\",\n description: \"Removes an OAuth provider for a given user.\",\n tags: [\"OAuth Providers\"],\n },\n clientList: {\n summary: \"List OAuth providers\",\n description: \"Retrieves a list of all OAuth providers for a user.\",\n tags: [\"OAuth Providers\"],\n },\n }\n});\nexport type OAuthProviderCrud = CrudTypeOf<typeof oauthProviderCrud>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuC;AACvC,2BAWO;AAEA,IAAM,oCAAgC,gCAAU;AAAA,EACrD,SAAS,sCAAiB,QAAQ;AAAA,EAClC,IAAI,2CAAsB,QAAQ;AAAA,EAClC,OAAO,8CAAyB,SAAS;AAAA,EACzC,MAAM,6CAAwB,QAAQ;AAAA,EACtC,eAAe,oDAA+B,QAAQ;AAAA,EACtD,0BAA0B,+DAA0C,QAAQ;AAC9E,CAAC,EAAE,QAAQ;AAEJ,IAAM,gCAAgC,8BAA8B,WAAO,gCAAU;AAAA,EAC1F,YAAY,kDAA6B,QAAQ;AACnD,CAAC,CAAC;AAEK,IAAM,0CAAsC,gCAAU;AAAA,EAC3D,eAAe,oDAA+B,SAAS;AAAA,EACvD,0BAA0B,+DAA0C,SAAS;AAC/E,CAAC,EAAE,QAAQ;AAEJ,IAAM,sCAAsC,oCAAoC,WAAO,gCAAU;AAAA,EACtG,OAAO,8CAAyB,SAAS;AAAA,EACzC,YAAY,kDAA6B,SAAS;AACpD,CAAC,CAAC;AAEK,IAAM,0CAAsC,gCAAU;AAAA,EAC3D,SAAS,sCAAiB,QAAQ;AAAA,EAClC,wBAAoB,gCAAU,EAAE,QAAQ;AAAA,EACxC,OAAO,8CAAyB,SAAS;AAAA,EACzC,eAAe,oDAA+B,QAAQ;AAAA,EACtD,0BAA0B,+DAA0C,QAAQ;AAAA,EAC5E,YAAY,kDAA6B,QAAQ;AACnD,CAAC,EAAE,QAAQ;AAEJ,IAAM,0CAAsC,+BAAS;AAErD,IAAM,wBAAoB,wBAAW;AAAA,EAC1C,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,MAAM;AAAA,IACJ,YAAY;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,CAAC,iBAAiB;AAAA,IAC1B;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,CAAC,iBAAiB;AAAA,IAC1B;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,CAAC,iBAAiB;AAAA,IAC1B;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,CAAC,iBAAiB;AAAA,IAC1B;AAAA,IACA,YAAY;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,CAAC,iBAAiB;AAAA,IAC1B;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -80,9 +80,9 @@ declare const userApiKeysCreateInputSchema: yup.ObjectSchema<{
80
80
  user_id: undefined;
81
81
  }, "">;
82
82
  declare const userApiKeysCreateOutputSchema: yup.ObjectSchema<{
83
+ id: string;
83
84
  type: "user";
84
85
  description: string;
85
- id: string;
86
86
  created_at_millis: number;
87
87
  expires_at_millis: number | undefined;
88
88
  manually_revoked_at_millis: number | undefined;
@@ -180,9 +180,9 @@ declare const teamApiKeysCreateInputSchema: yup.ObjectSchema<{
180
180
  team_id: undefined;
181
181
  }, "">;
182
182
  declare const teamApiKeysCreateOutputSchema: yup.ObjectSchema<{
183
+ id: string;
183
184
  type: "team";
184
185
  description: string;
185
- id: string;
186
186
  created_at_millis: number;
187
187
  expires_at_millis: number | undefined;
188
188
  manually_revoked_at_millis: number | undefined;
@@ -80,9 +80,9 @@ declare const userApiKeysCreateInputSchema: yup.ObjectSchema<{
80
80
  user_id: undefined;
81
81
  }, "">;
82
82
  declare const userApiKeysCreateOutputSchema: yup.ObjectSchema<{
83
+ id: string;
83
84
  type: "user";
84
85
  description: string;
85
- id: string;
86
86
  created_at_millis: number;
87
87
  expires_at_millis: number | undefined;
88
88
  manually_revoked_at_millis: number | undefined;
@@ -180,9 +180,9 @@ declare const teamApiKeysCreateInputSchema: yup.ObjectSchema<{
180
180
  team_id: undefined;
181
181
  }, "">;
182
182
  declare const teamApiKeysCreateOutputSchema: yup.ObjectSchema<{
183
+ id: string;
183
184
  type: "team";
184
185
  description: string;
185
- id: string;
186
186
  created_at_millis: number;
187
187
  expires_at_millis: number | undefined;
188
188
  manually_revoked_at_millis: number | undefined;
@@ -56,11 +56,12 @@ declare const projectsCrudAdminReadSchema: yup.ObjectSchema<{
56
56
  client_secret?: string | undefined;
57
57
  facebook_config_id?: string | undefined;
58
58
  microsoft_tenant_id?: string | undefined;
59
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
59
60
  type: "shared" | "standard";
60
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
61
+ provider_config_id: string;
61
62
  }[];
62
63
  enabled_oauth_providers: {
63
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
64
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
64
65
  }[];
65
66
  domains: {
66
67
  domain: string;
@@ -137,7 +138,7 @@ declare const projectsCrudClientReadSchema: yup.ObjectSchema<{
137
138
  allow_user_api_keys: boolean;
138
139
  allow_team_api_keys: boolean;
139
140
  enabled_oauth_providers: {
140
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
141
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
141
142
  }[];
142
143
  };
143
144
  }, yup.AnyObject, {
@@ -174,8 +175,8 @@ declare const projectsCrudAdminUpdateSchema: yup.ObjectSchema<{
174
175
  client_secret?: string | undefined;
175
176
  facebook_config_id?: string | undefined;
176
177
  microsoft_tenant_id?: string | undefined;
178
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
177
179
  type: "shared" | "standard";
178
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
179
180
  }[] | undefined;
180
181
  domains?: {
181
182
  domain: string;
@@ -228,8 +229,8 @@ declare const projectsCrudAdminCreateSchema: yup.ObjectSchema<{
228
229
  client_secret?: string | undefined;
229
230
  facebook_config_id?: string | undefined;
230
231
  microsoft_tenant_id?: string | undefined;
232
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
231
233
  type: "shared" | "standard";
232
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
233
234
  }[] | undefined;
234
235
  domains?: {
235
236
  domain: string;
@@ -280,7 +281,7 @@ declare const clientProjectsCrud: CrudSchemaFromOptions<{
280
281
  allow_user_api_keys: boolean;
281
282
  allow_team_api_keys: boolean;
282
283
  enabled_oauth_providers: {
283
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
284
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
284
285
  }[];
285
286
  };
286
287
  }, yup.AnyObject, {
@@ -329,11 +330,12 @@ declare const projectsCrud: CrudSchemaFromOptions<{
329
330
  client_secret?: string | undefined;
330
331
  facebook_config_id?: string | undefined;
331
332
  microsoft_tenant_id?: string | undefined;
333
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
332
334
  type: "shared" | "standard";
333
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
335
+ provider_config_id: string;
334
336
  }[];
335
337
  enabled_oauth_providers: {
336
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
338
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
337
339
  }[];
338
340
  domains: {
339
341
  domain: string;
@@ -416,8 +418,8 @@ declare const projectsCrud: CrudSchemaFromOptions<{
416
418
  client_secret?: string | undefined;
417
419
  facebook_config_id?: string | undefined;
418
420
  microsoft_tenant_id?: string | undefined;
421
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
419
422
  type: "shared" | "standard";
420
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
421
423
  }[] | undefined;
422
424
  domains?: {
423
425
  domain: string;
@@ -493,11 +495,12 @@ declare const adminUserProjectsCrud: CrudSchemaFromOptions<{
493
495
  client_secret?: string | undefined;
494
496
  facebook_config_id?: string | undefined;
495
497
  microsoft_tenant_id?: string | undefined;
498
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
496
499
  type: "shared" | "standard";
497
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
500
+ provider_config_id: string;
498
501
  }[];
499
502
  enabled_oauth_providers: {
500
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
503
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
501
504
  }[];
502
505
  domains: {
503
506
  domain: string;
@@ -580,8 +583,8 @@ declare const adminUserProjectsCrud: CrudSchemaFromOptions<{
580
583
  client_secret?: string | undefined;
581
584
  facebook_config_id?: string | undefined;
582
585
  microsoft_tenant_id?: string | undefined;
586
+ id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "twitch";
583
587
  type: "shared" | "standard";
584
- id: "apple" | "x" | "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin";
585
588
  }[] | undefined;
586
589
  domains?: {
587
590
  domain: string;