careerty-prism 1.0.13 → 1.0.14

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 (2) hide show
  1. package/others/seeder.ts +419 -0
  2. package/package.json +9 -3
@@ -0,0 +1,419 @@
1
+ import { PrismaClient } from '@prisma/client';
2
+ const prisma = new PrismaClient()
3
+
4
+
5
+
6
+
7
+ async function getDefaultDocTemplte(type: string) {
8
+
9
+ var result = await prisma.template.findFirst({
10
+ where: {
11
+ isPaid: true,
12
+ isDeleted: false,
13
+ for: type
14
+ }
15
+ })
16
+ if (result)
17
+ return result.id;
18
+
19
+ return '_'
20
+
21
+ }
22
+
23
+
24
+
25
+ async function getDefaultUserPlan() {
26
+ var result = await prisma.plan.findFirst({
27
+ where: {
28
+ name: 'Free Plan'
29
+ }
30
+ })
31
+ if (result)
32
+ return result.id
33
+
34
+ return '_'
35
+ }
36
+
37
+
38
+ async function getPositions() {
39
+ // return await SkillRepoModel.find({}, ['_id']);
40
+ }
41
+
42
+
43
+ export const configs = async () => {
44
+
45
+ const defaultCvTemplate = await getDefaultDocTemplte('cv');
46
+ const defaultClTemplate = await getDefaultDocTemplte('cl');
47
+ const defaultUserPlan = await getDefaultUserPlan();
48
+
49
+
50
+
51
+ return [
52
+ {
53
+ configName: 'MaintenanceMode',
54
+ configValue: '1',
55
+ configType: 'general',
56
+ configStatus: 1,
57
+ configSubValue: '_',
58
+ configInput: 'switch',
59
+ configDesc: 'Maintenance Mode'
60
+ },
61
+ {
62
+ configName: 'DefaultUserPlan',
63
+ configValue: defaultUserPlan.toString(),
64
+ configType: 'general',
65
+ configStatus: 1,
66
+ configSubValue: '_',
67
+ configInput: 'select',
68
+ configDesc: 'Default User Plan'
69
+ },
70
+ {
71
+ configName: 'PayWithPayPal',
72
+ configValue: '1',
73
+ configType: 'general',
74
+ configStatus: 1,
75
+ configSubValue: '_',
76
+ configInput: 'switch',
77
+ configDesc: 'Enable Paypal Payment method'
78
+ },
79
+ {
80
+ configName: 'PaypalMode',
81
+ configValue: 'sandbox',
82
+ configType: 'general',
83
+ configStatus: 1,
84
+ configSubValue: '_',
85
+ configInput: 'switch',
86
+ configDesc: 'Paypal gateway Mode'
87
+ },
88
+ {
89
+ configName: 'PaypalCliID',
90
+ configValue: 'AQpSCYLR-kqiHBbfh6u71kVPFDXu0SxH2XtURgMKTdYx29L_t-0lbu2I9hvj-LONWt3hJAHh_8pojQsG',
91
+ configType: 'general',
92
+ configStatus: 1,
93
+ configSubValue: '_',
94
+ configInput: 'text',
95
+ configDesc: 'Paypal gateway client ID'
96
+ },
97
+ {
98
+ configName: 'PaypalSecID',
99
+ configValue: 'EHaUlC1JDqMwWKpML8Wtdl83w-JXER88s7TC9MnlYWGtADE7q_rQ4HBfU-1dFJkkKYFITA2udODQIrpU',
100
+ configType: 'general',
101
+ configStatus: 1,
102
+ configSubValue: '_',
103
+ configInput: 'text',
104
+ configDesc: 'Paypal gateway secret ID'
105
+ },
106
+ {
107
+ configName: 'PayWithStripe',
108
+ configValue: '1',
109
+ configType: 'general',
110
+ configStatus: 1,
111
+ configSubValue: '_',
112
+ configInput: 'switch',
113
+ configDesc: 'Enable Stripe payment method'
114
+ },
115
+ {
116
+ configName: 'StripeCliID',
117
+ configValue: 'pk_test_51KmOpKK1KBDoE0PiPulwQ4IkYzmDDxhOYKxDN4bIAf6JFp17oBBpmbFJ6WxA6qhUkhlUqmH3EuFCFLAaOSNwHACX009jVLnVoi',
118
+ configType: 'general',
119
+ configStatus: 1,
120
+ configSubValue: '_',
121
+ configInput: 'text',
122
+ configDesc: 'Stripe gateway client ID'
123
+ },
124
+ {
125
+ configName: 'StripeSecID',
126
+ configValue: 'sk_test_51KmOpKK1KBDoE0PiUd7Jte5VgPaC3cFXo2USZQj89GpLer0BVitWVaVf6bcHO7V74OAnX1VLh9diCkyNMI9OIlTD00Hf7kcsZV',
127
+ configType: 'general',
128
+ configStatus: 1,
129
+ configSubValue: '_',
130
+ configInput: 'text',
131
+ configDesc: 'Stripe gateway secret ID'
132
+ },
133
+ {
134
+ configName: 'PayWithSyriatel',
135
+ configValue: '1',
136
+ configType: 'general',
137
+ configStatus: 1,
138
+ configSubValue: '_',
139
+ configInput: 'switch',
140
+ configDesc: 'Enable Syriatel cash Payment method'
141
+ },
142
+ {
143
+ configName: 'PayWithMtn',
144
+ configValue: '1',
145
+ configType: 'general',
146
+ configStatus: 1,
147
+ configSubValue: '_',
148
+ configInput: 'switch',
149
+ configDesc: 'Enable Mtn cash Payment method'
150
+ },
151
+ {
152
+ configName: 'DefaultLanguage',
153
+ configValue: 'en',
154
+ configType: 'general',
155
+ configStatus: 1,
156
+ configSubValue: 'usd',
157
+ configInput: 'select',
158
+ configDesc: 'Default Front-end Display Language'
159
+ },
160
+ {
161
+ configName: 'DefaultCvTemplate',
162
+ configValue: defaultCvTemplate.toString(),
163
+ configType: 'general',
164
+ configStatus: 1,
165
+ configSubValue: '_',
166
+ configInput: 'select',
167
+ configDesc: 'Default Cv Template'
168
+ },
169
+ {
170
+ configName: 'DefaultClTemplate',
171
+ configValue: defaultClTemplate.toString(),
172
+ configType: 'general',
173
+ configStatus: 1,
174
+ configSubValue: '_',
175
+ configInput: 'select',
176
+ configDesc: 'Default Cover Letter Template'
177
+ },
178
+ {
179
+ configName: 'daysToMentorWithdraw',
180
+ configValue: '2',
181
+ configType: 'general',
182
+ configStatus: 1,
183
+ configSubValue: '_',
184
+ configInput: 'number',
185
+ configDesc: 'Mentor Withdraw Days Limit Peroid'
186
+ },
187
+ {
188
+ configName: 'MentorMinimumWithdrawAmount',
189
+ configValue: '20',
190
+ configType: 'general',
191
+ configStatus: 1,
192
+ configSubValue: '_',
193
+ configInput: 'number',
194
+ configDesc: 'Mentor Minimum withdraw amount'
195
+ },
196
+ {
197
+ configName: 'GoogleDriveCliID',
198
+ configValue: '460388232750-4ppr2ilvejsqjbaj5qvulajkd62l8fpb.apps.googleusercontent.com',
199
+ configType: 'general',
200
+ configStatus: 1,
201
+ configSubValue: '_',
202
+ configInput: 'text',
203
+ configDesc: 'Google Drive Client ID'
204
+ },
205
+ {
206
+ configName: 'GoogleDriveSecID',
207
+ configValue: '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',
208
+ configType: 'general',
209
+ configStatus: 1,
210
+ configSubValue: '_',
211
+ configInput: 'text',
212
+ configDesc: 'Google Drive Secret ID'
213
+ },
214
+ {
215
+ configName: 'GoogleDriveRefID',
216
+ configValue: '1//049ujCJrSfPlPCgYIARAAGAQSNwF-L9IrjNsdI-hyD8iCMH6bpCaIwBEjExntgJ9tjhfoMATJkJ0AgFiwkRpW9f6CE4Uuwxs92Co',
217
+ configType: 'general',
218
+ configStatus: 1,
219
+ configSubValue: '_',
220
+ configInput: 'text',
221
+ configDesc: 'Google Drive Refersh token'
222
+ },
223
+ {
224
+ configName: 'GoogleDriveRedirect',
225
+ configValue: 'https://developers.google.com/oauthplayground',
226
+ configType: 'general',
227
+ configStatus: 1,
228
+ configSubValue: '_',
229
+ configInput: 'text',
230
+ configDesc: 'Google Drive Refersh Redirect url'
231
+ },
232
+ {
233
+ configName: 'AuthenticateWithGithub',
234
+ configValue: '0',
235
+ configType: 'general',
236
+ configStatus: 1,
237
+ configSubValue: '_',
238
+ configInput: 'switch',
239
+ configDesc: 'Control User Authentication with Github'
240
+ },
241
+ {
242
+ configName: 'GitHubCliID',
243
+ configValue: 'aace6b14e72bc4b50b44',
244
+ configType: 'general',
245
+ configStatus: 1,
246
+ configSubValue: '_',
247
+ configInput: 'text',
248
+ configDesc: 'Github Authentication Client ID'
249
+ },
250
+ {
251
+ configName: 'GitHubSecID',
252
+ configValue: 'fd87cfd4ea0b9be2a04bf903e759ce2023b812b5',
253
+ configType: 'general',
254
+ configStatus: 1,
255
+ configSubValue: '_',
256
+ configInput: 'text',
257
+ configDesc: 'Github Authentication Secret ID'
258
+ },
259
+ {
260
+ configName: 'GitHubRedirect',
261
+ configValue: 'http://127.0.0.1:8080/login/github',
262
+ configType: 'general',
263
+ configStatus: 1,
264
+ configSubValue: '_',
265
+ configInput: 'text',
266
+ configDesc: 'Github Authentication Redirect url'
267
+ },
268
+ {
269
+ configName: 'AuthenticateWithGoogle',
270
+ configValue: '0',
271
+ configType: 'general',
272
+ configStatus: 1,
273
+ configSubValue: '_',
274
+ configInput: 'switch',
275
+ configDesc: 'Control User Authentication with Google'
276
+ },
277
+ {
278
+ configName: 'GoogleCliID',
279
+ configValue: '460388232750-j8p6acb6amiitmpic6qte5ibvcp9ikv5.apps.googleusercontent.com',
280
+ configType: 'general',
281
+ configStatus: 1,
282
+ configSubValue: '_',
283
+ configInput: 'text',
284
+ configDesc: 'Google Authentication Client ID'
285
+ },
286
+ {
287
+ configName: 'GoogleSecID',
288
+ configValue: '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',
289
+ configType: 'general',
290
+ configStatus: 1,
291
+ configSubValue: '_',
292
+ configInput: 'text',
293
+ configDesc: 'Google Authentication Secret ID'
294
+ },
295
+ {
296
+ configName: 'GoogleRedirect',
297
+ configValue: 'http://127.0.0.1:8080/login/google',
298
+ configType: 'general',
299
+ configStatus: 1,
300
+ configSubValue: '_',
301
+ configInput: 'text',
302
+ configDesc: 'Google Authentication Redirect url'
303
+ },
304
+ {
305
+ configName: 'AuthenticateWithLinkedin',
306
+ configValue: '0',
307
+ configType: 'general',
308
+ configStatus: 1,
309
+ configSubValue: '_',
310
+ configInput: 'switch',
311
+ configDesc: 'Control User Authentication with Linkedin'
312
+ },
313
+ {
314
+ configName: 'LinkedInCliID',
315
+ configValue: '86ztw48x0nrxb7',
316
+ configType: 'general',
317
+ configStatus: 1,
318
+ configSubValue: '_',
319
+ configInput: 'text',
320
+ configDesc: 'Linkedin Authentication Client ID'
321
+ },
322
+ {
323
+ configName: 'LinkedInSecID',
324
+ configValue: '5esor1Dw9biMq4lk',
325
+ configType: 'general',
326
+ configStatus: 1,
327
+ configSubValue: '_',
328
+ configInput: 'text',
329
+ configDesc: 'Linkedin Authentication Secret ID'
330
+ },
331
+ {
332
+ configName: 'LinkedInRedirect',
333
+ configValue: 'http://127.0.0.1:8080/login/linkedin',
334
+ configType: 'general',
335
+ configStatus: 1,
336
+ configSubValue: '_',
337
+ configInput: 'text',
338
+ configDesc: 'Linkedin Authentication Redirect url'
339
+ },
340
+ {
341
+ configName: 'PostDefaultThumbnail',
342
+ configValue: '1kEduqwKdqEgpe1bAlJEwN70WmZ6uivl4',
343
+ configType: 'drive',
344
+ configStatus: 1,
345
+ configSubValue: '_',
346
+ configInput: 'text',
347
+ configDesc: 'Post Default Thumbnail'
348
+ },
349
+ {
350
+ configName: 'ProgramDefaultThumbnail',
351
+ configValue: '1tJ9i5DDyfzEDPlamTyxGjuUHKNLMwJn0',
352
+ configType: 'drive',
353
+ configStatus: 1,
354
+ configSubValue: '_',
355
+ configInput: 'text',
356
+ configDesc: 'mentorships programs default thumbnails'
357
+ },
358
+ {
359
+ configName: 'TemplateDefaultThumbnail',
360
+ configValue: '1mUqMeMEVG8QBIOKlHDVH6oa50sHOXuTj',
361
+ configType: 'drive',
362
+ configStatus: 1,
363
+ configSubValue: '_',
364
+ configInput: 'text',
365
+ configDesc: 'templates default thumbnail'
366
+ },
367
+ {
368
+ configName: 'MentorDefaultThumbnail',
369
+ configValue: '1_yTOqQJUqdvnSYBy00kWYTh2xZEzWMnJ',
370
+ configType: 'drive',
371
+ configStatus: 1,
372
+ configSubValue: '_',
373
+ configInput: 'text',
374
+ configDesc: 'mentor default thumbnail'
375
+ },
376
+ {
377
+ configName: 'ServiceDefaultThumbnail',
378
+ configValue: '1_yTOqQJUqdvnSYBy00kWYTh2xZEzWMnJ',
379
+ configType: 'drive',
380
+ configStatus: 1,
381
+ configSubValue: '_',
382
+ configInput: 'text',
383
+ configDesc: 'service default thumbnail'
384
+ },
385
+
386
+ ]
387
+ }
388
+
389
+
390
+
391
+
392
+
393
+ async function main() {
394
+
395
+ //configs seeder
396
+ var confs = await configs();
397
+ // await prisma.config.createMany({
398
+ // data: confs
399
+ // })
400
+
401
+ console.error('done');
402
+ }
403
+
404
+ main()
405
+ .catch((e) => {
406
+ console.error(e);
407
+ process.exit(1);
408
+ })
409
+ .finally(async () => {
410
+ await prisma.$disconnect();
411
+ });
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "careerty-prism",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,14 +8,20 @@
8
8
  "generate": "npx prisma generate",
9
9
  "postinstall": "npm run generate"
10
10
  },
11
+ "prisma": {
12
+ "seed": "ts-node others/seeder.ts"
13
+ },
11
14
  "author": "",
12
15
  "license": "ISC",
13
16
  "devDependencies": {
14
- "prisma": "^5.16.1",
15
17
  "@prisma/client": "^5.16.1",
18
+ "prisma": "^5.16.1",
16
19
  "typescript": "^5.5.3"
17
- },
20
+ },
18
21
  "peerDependencies": {
19
22
  "@prisma/client": ">=5"
23
+ },
24
+ "dependencies": {
25
+ "ts-node": "^10.9.2"
20
26
  }
21
27
  }