@tinyrack/tinyauth-server 0.5.0 → 0.5.1

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 (61) hide show
  1. package/dist/entities/oauth-client.entity.d.ts +9 -0
  2. package/dist/entities/oauth-client.entity.d.ts.map +1 -1
  3. package/dist/entities/oauth-client.entity.js +4 -0
  4. package/dist/entities/oauth-client.entity.js.map +1 -1
  5. package/dist/entities/oauth-code.entity.d.ts +9 -0
  6. package/dist/entities/oauth-code.entity.d.ts.map +1 -1
  7. package/dist/entities/oauth-device-code.entity.d.ts +9 -0
  8. package/dist/entities/oauth-device-code.entity.d.ts.map +1 -1
  9. package/dist/entities/revoked-token.entity.d.ts +9 -0
  10. package/dist/entities/revoked-token.entity.d.ts.map +1 -1
  11. package/dist/entities/user-consent.entity.d.ts +9 -0
  12. package/dist/entities/user-consent.entity.d.ts.map +1 -1
  13. package/dist/entrypoints/app.d.ts +1 -0
  14. package/dist/entrypoints/app.d.ts.map +1 -1
  15. package/dist/entrypoints/database/postgres/compiled-functions.d.ts +7 -4
  16. package/dist/entrypoints/database/postgres/compiled-functions.d.ts.map +1 -1
  17. package/dist/entrypoints/database/postgres/compiled-functions.js +54 -24
  18. package/dist/entrypoints/database/postgres/compiled-functions.js.map +1 -1
  19. package/dist/entrypoints/database/sqlite/compiled-functions.d.ts +7 -4
  20. package/dist/entrypoints/database/sqlite/compiled-functions.d.ts.map +1 -1
  21. package/dist/entrypoints/database/sqlite/compiled-functions.js +54 -24
  22. package/dist/entrypoints/database/sqlite/compiled-functions.js.map +1 -1
  23. package/dist/lib/config/client.d.ts +2 -0
  24. package/dist/lib/config/client.d.ts.map +1 -1
  25. package/dist/lib/config/client.js +4 -0
  26. package/dist/lib/config/client.js.map +1 -1
  27. package/dist/lib/config/resolved.d.ts +1 -0
  28. package/dist/lib/config/resolved.d.ts.map +1 -1
  29. package/dist/migrations/postgres/Migration20260620025358_add_oauth_client_skip_consent.d.ts +6 -0
  30. package/dist/migrations/postgres/Migration20260620025358_add_oauth_client_skip_consent.d.ts.map +1 -0
  31. package/dist/migrations/postgres/Migration20260620025358_add_oauth_client_skip_consent.js +11 -0
  32. package/dist/migrations/postgres/Migration20260620025358_add_oauth_client_skip_consent.js.map +1 -0
  33. package/dist/migrations/postgres/index.d.ts.map +1 -1
  34. package/dist/migrations/postgres/index.js +2 -0
  35. package/dist/migrations/postgres/index.js.map +1 -1
  36. package/dist/migrations/sqlite/Migration20260620025358_add_oauth_client_skip_consent.d.ts +6 -0
  37. package/dist/migrations/sqlite/Migration20260620025358_add_oauth_client_skip_consent.d.ts.map +1 -0
  38. package/dist/migrations/sqlite/Migration20260620025358_add_oauth_client_skip_consent.js +10 -0
  39. package/dist/migrations/sqlite/Migration20260620025358_add_oauth_client_skip_consent.js.map +1 -0
  40. package/dist/migrations/sqlite/index.d.ts.map +1 -1
  41. package/dist/migrations/sqlite/index.js +2 -0
  42. package/dist/migrations/sqlite/index.js.map +1 -1
  43. package/dist/schemas/response.d.ts +1 -0
  44. package/dist/schemas/response.d.ts.map +1 -1
  45. package/dist/schemas/response.js +3 -0
  46. package/dist/schemas/response.js.map +1 -1
  47. package/dist/seeders/config.seeder.js +1 -0
  48. package/dist/seeders/config.seeder.js.map +1 -1
  49. package/dist/services/container.d.ts +1 -0
  50. package/dist/services/container.d.ts.map +1 -1
  51. package/dist/services/oauth-authorize.service.d.ts.map +1 -1
  52. package/dist/services/oauth-authorize.service.js +1 -0
  53. package/dist/services/oauth-authorize.service.js.map +1 -1
  54. package/dist/services/oauth-client.service.d.ts.map +1 -1
  55. package/dist/services/oauth-client.service.js +1 -0
  56. package/dist/services/oauth-client.service.js.map +1 -1
  57. package/dist/services/user-consent.service.d.ts +1 -0
  58. package/dist/services/user-consent.service.d.ts.map +1 -1
  59. package/dist/services/user-consent.service.js +4 -1
  60. package/dist/services/user-consent.service.js.map +1 -1
  61. package/package.json +1 -1
@@ -7868,7 +7868,7 @@ export default {
7868
7868
  return getPrimaryKeyHash(val_12);
7869
7869
  };
7870
7870
  },
7871
- 'hydrator-oauth_client_14000-full-false': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_grantTypes, convertToDatabaseValue_grantTypes, convertToJSValue_responseTypes, convertToDatabaseValue_responseTypes, convertToJSValue_scopes, convertToDatabaseValue_scopes, convertToJSValue_redirectUris, convertToDatabaseValue_redirectUris, convertToJSValue_postLogoutRedirectUris, convertToDatabaseValue_postLogoutRedirectUris, convertToJSValue_webOrigins, convertToDatabaseValue_webOrigins, oauth_code_379, oauth_device_code_380, user_consent_381, revoked_tokens_382) {
7871
+ 'hydrator-oauth_client_14000-full-false': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_grantTypes, convertToDatabaseValue_grantTypes, convertToJSValue_responseTypes, convertToDatabaseValue_responseTypes, convertToJSValue_scopes, convertToDatabaseValue_scopes, convertToJSValue_redirectUris, convertToDatabaseValue_redirectUris, convertToJSValue_postLogoutRedirectUris, convertToDatabaseValue_postLogoutRedirectUris, convertToJSValue_webOrigins, convertToDatabaseValue_webOrigins, oauth_code_380, oauth_device_code_381, user_consent_382, revoked_tokens_383) {
7872
7872
  // compiled hydrator for entity OAuthClientEntity ( normalized)
7873
7873
  return function (entity, data, factory, newEntity, convertCustomTypes, schema, parentSchema, normalizeAccessors) {
7874
7874
  if (data.id === null) {
@@ -8007,6 +8007,12 @@ export default {
8007
8007
  else if (typeof data.enabled !== 'undefined') {
8008
8008
  entity.enabled = !!data.enabled;
8009
8009
  }
8010
+ if (data.skipConsent === null) {
8011
+ entity.skipConsent = null;
8012
+ }
8013
+ else if (typeof data.skipConsent !== 'undefined') {
8014
+ entity.skipConsent = !!data.skipConsent;
8015
+ }
8010
8016
  if (data.managed_by === null) {
8011
8017
  entity.managed_by = null;
8012
8018
  }
@@ -8021,10 +8027,10 @@ export default {
8021
8027
  }
8022
8028
  const createCollectionItem_codes = (value, entity) => {
8023
8029
  if (isPrimaryKey(value, false))
8024
- return factory.createReference(oauth_code_379, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8030
+ return factory.createReference(oauth_code_380, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8025
8031
  if (value && isEntity(value))
8026
8032
  return value;
8027
- return factory.create(oauth_code_379, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8033
+ return factory.create(oauth_code_380, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8028
8034
  };
8029
8035
  if (data.codes && !Array.isArray(data.codes) && typeof data.codes === 'object') {
8030
8036
  data.codes = [data.codes];
@@ -8048,10 +8054,10 @@ export default {
8048
8054
  }
8049
8055
  const createCollectionItem_deviceCodes = (value, entity) => {
8050
8056
  if (isPrimaryKey(value, false))
8051
- return factory.createReference(oauth_device_code_380, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8057
+ return factory.createReference(oauth_device_code_381, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8052
8058
  if (value && isEntity(value))
8053
8059
  return value;
8054
- return factory.create(oauth_device_code_380, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8060
+ return factory.create(oauth_device_code_381, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8055
8061
  };
8056
8062
  if (data.deviceCodes && !Array.isArray(data.deviceCodes) && typeof data.deviceCodes === 'object') {
8057
8063
  data.deviceCodes = [data.deviceCodes];
@@ -8075,10 +8081,10 @@ export default {
8075
8081
  }
8076
8082
  const createCollectionItem_consents = (value, entity) => {
8077
8083
  if (isPrimaryKey(value, false))
8078
- return factory.createReference(user_consent_381, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8084
+ return factory.createReference(user_consent_382, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8079
8085
  if (value && isEntity(value))
8080
8086
  return value;
8081
- return factory.create(user_consent_381, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8087
+ return factory.create(user_consent_382, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8082
8088
  };
8083
8089
  if (data.consents && !Array.isArray(data.consents) && typeof data.consents === 'object') {
8084
8090
  data.consents = [data.consents];
@@ -8102,10 +8108,10 @@ export default {
8102
8108
  }
8103
8109
  const createCollectionItem_revokedTokens = (value, entity) => {
8104
8110
  if (isPrimaryKey(value, false))
8105
- return factory.createReference(revoked_tokens_382, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8111
+ return factory.createReference(revoked_tokens_383, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8106
8112
  if (value && isEntity(value))
8107
8113
  return value;
8108
- return factory.create(revoked_tokens_382, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8114
+ return factory.create(revoked_tokens_383, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8109
8115
  };
8110
8116
  if (data.revokedTokens && !Array.isArray(data.revokedTokens) && typeof data.revokedTokens === 'object') {
8111
8117
  data.revokedTokens = [data.revokedTokens];
@@ -8129,7 +8135,7 @@ export default {
8129
8135
  }
8130
8136
  };
8131
8137
  },
8132
- 'hydrator-oauth_client_14000-full-true': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_grantTypes, convertToDatabaseValue_grantTypes, convertToJSValue_responseTypes, convertToDatabaseValue_responseTypes, convertToJSValue_scopes, convertToDatabaseValue_scopes, convertToJSValue_redirectUris, convertToDatabaseValue_redirectUris, convertToJSValue_postLogoutRedirectUris, convertToDatabaseValue_postLogoutRedirectUris, convertToJSValue_webOrigins, convertToDatabaseValue_webOrigins, oauth_code_398, oauth_device_code_399, user_consent_400, revoked_tokens_401) {
8138
+ 'hydrator-oauth_client_14000-full-true': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_grantTypes, convertToDatabaseValue_grantTypes, convertToJSValue_responseTypes, convertToDatabaseValue_responseTypes, convertToJSValue_scopes, convertToDatabaseValue_scopes, convertToJSValue_redirectUris, convertToDatabaseValue_redirectUris, convertToJSValue_postLogoutRedirectUris, convertToDatabaseValue_postLogoutRedirectUris, convertToJSValue_webOrigins, convertToDatabaseValue_webOrigins, oauth_code_400, oauth_device_code_401, user_consent_402, revoked_tokens_403) {
8133
8139
  // compiled hydrator for entity OAuthClientEntity ( normalized)
8134
8140
  return function (entity, data, factory, newEntity, convertCustomTypes, schema, parentSchema, normalizeAccessors) {
8135
8141
  if (data.id === null) {
@@ -8268,6 +8274,12 @@ export default {
8268
8274
  else if (typeof data.enabled !== 'undefined') {
8269
8275
  entity.enabled = !!data.enabled;
8270
8276
  }
8277
+ if (data.skipConsent === null) {
8278
+ entity.skipConsent = null;
8279
+ }
8280
+ else if (typeof data.skipConsent !== 'undefined') {
8281
+ entity.skipConsent = !!data.skipConsent;
8282
+ }
8271
8283
  if (data.managed_by === null) {
8272
8284
  entity.managed_by = null;
8273
8285
  }
@@ -8282,10 +8294,10 @@ export default {
8282
8294
  }
8283
8295
  const createCollectionItem_codes = (value, entity) => {
8284
8296
  if (isPrimaryKey(value, false))
8285
- return factory.createReference(oauth_code_398, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8297
+ return factory.createReference(oauth_code_400, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8286
8298
  if (value && isEntity(value))
8287
8299
  return value;
8288
- return factory.create(oauth_code_398, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8300
+ return factory.create(oauth_code_400, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8289
8301
  };
8290
8302
  if (data.codes && !Array.isArray(data.codes) && typeof data.codes === 'object') {
8291
8303
  data.codes = [data.codes];
@@ -8309,10 +8321,10 @@ export default {
8309
8321
  }
8310
8322
  const createCollectionItem_deviceCodes = (value, entity) => {
8311
8323
  if (isPrimaryKey(value, false))
8312
- return factory.createReference(oauth_device_code_399, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8324
+ return factory.createReference(oauth_device_code_401, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8313
8325
  if (value && isEntity(value))
8314
8326
  return value;
8315
- return factory.create(oauth_device_code_399, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8327
+ return factory.create(oauth_device_code_401, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8316
8328
  };
8317
8329
  if (data.deviceCodes && !Array.isArray(data.deviceCodes) && typeof data.deviceCodes === 'object') {
8318
8330
  data.deviceCodes = [data.deviceCodes];
@@ -8336,10 +8348,10 @@ export default {
8336
8348
  }
8337
8349
  const createCollectionItem_consents = (value, entity) => {
8338
8350
  if (isPrimaryKey(value, false))
8339
- return factory.createReference(user_consent_400, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8351
+ return factory.createReference(user_consent_402, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8340
8352
  if (value && isEntity(value))
8341
8353
  return value;
8342
- return factory.create(user_consent_400, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8354
+ return factory.create(user_consent_402, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8343
8355
  };
8344
8356
  if (data.consents && !Array.isArray(data.consents) && typeof data.consents === 'object') {
8345
8357
  data.consents = [data.consents];
@@ -8363,10 +8375,10 @@ export default {
8363
8375
  }
8364
8376
  const createCollectionItem_revokedTokens = (value, entity) => {
8365
8377
  if (isPrimaryKey(value, false))
8366
- return factory.createReference(revoked_tokens_401, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8378
+ return factory.createReference(revoked_tokens_403, value, { convertCustomTypes, schema, normalizeAccessors, merge: true });
8367
8379
  if (value && isEntity(value))
8368
8380
  return value;
8369
- return factory.create(revoked_tokens_401, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8381
+ return factory.create(revoked_tokens_403, value, { newEntity, convertCustomTypes, schema, normalizeAccessors, merge: true });
8370
8382
  };
8371
8383
  if (data.revokedTokens && !Array.isArray(data.revokedTokens) && typeof data.revokedTokens === 'object') {
8372
8384
  data.revokedTokens = [data.revokedTokens];
@@ -8537,6 +8549,17 @@ export default {
8537
8549
  else if (!compareBooleans(last.enabled, current.enabled)) {
8538
8550
  diff.enabled = current.enabled;
8539
8551
  }
8552
+ if (current.skipConsent === null && last.skipConsent === undefined) {
8553
+ diff.skipConsent = current.skipConsent;
8554
+ }
8555
+ else if (current.skipConsent == null && last.skipConsent == null) {
8556
+ }
8557
+ else if ((current.skipConsent != null && last.skipConsent == null) || (current.skipConsent == null && last.skipConsent != null)) {
8558
+ diff.skipConsent = current.skipConsent;
8559
+ }
8560
+ else if (!compareBooleans(last.skipConsent, current.skipConsent)) {
8561
+ diff.skipConsent = current.skipConsent;
8562
+ }
8540
8563
  if (current.managed_by === null && last.managed_by === undefined) {
8541
8564
  diff.managed_by = current.managed_by;
8542
8565
  }
@@ -8606,6 +8629,9 @@ export default {
8606
8629
  if (typeof entity.enabled !== 'undefined') {
8607
8630
  ret.enabled = entity.enabled;
8608
8631
  }
8632
+ if (typeof entity.skipConsent !== 'undefined') {
8633
+ ret.skipConsent = entity.skipConsent;
8634
+ }
8609
8635
  if (typeof entity.managed_by !== 'undefined') {
8610
8636
  ret.managed_by = entity.managed_by;
8611
8637
  }
@@ -8694,6 +8720,10 @@ export default {
8694
8720
  ret.enabled = result.enabled == null ? result.enabled : !!result.enabled;
8695
8721
  mapped.enabled = true;
8696
8722
  }
8723
+ if (typeof result.skip_consent !== 'undefined') {
8724
+ ret.skipConsent = result.skip_consent == null ? result.skip_consent : !!result.skip_consent;
8725
+ mapped.skip_consent = true;
8726
+ }
8697
8727
  if (typeof result.managed_by !== 'undefined') {
8698
8728
  ret.managed_by = result.managed_by;
8699
8729
  mapped.managed_by = true;
@@ -9318,7 +9348,7 @@ export default {
9318
9348
  return '' + entity.kid;
9319
9349
  };
9320
9350
  },
9321
- 'hydrator-email_verification_8000-full-false': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_id, convertToDatabaseValue_id, user_431, user_432) {
9351
+ 'hydrator-email_verification_8000-full-false': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_id, convertToDatabaseValue_id, user_433, user_434) {
9322
9352
  // compiled hydrator for entity EmailVerificationEntity ( normalized)
9323
9353
  return function (entity, data, factory, newEntity, convertCustomTypes, schema, parentSchema, normalizeAccessors) {
9324
9354
  if (data.id === null) {
@@ -9366,10 +9396,10 @@ export default {
9366
9396
  }
9367
9397
  else if (typeof data.user !== 'undefined') {
9368
9398
  if (isPrimaryKey(data.user, true)) {
9369
- entity.user = Reference.create(factory.createReference(user_431, data.user, { merge: true, convertCustomTypes, normalizeAccessors, schema }));
9399
+ entity.user = Reference.create(factory.createReference(user_433, data.user, { merge: true, convertCustomTypes, normalizeAccessors, schema }));
9370
9400
  }
9371
9401
  else if (data.user && typeof data.user === 'object') {
9372
- entity.user = Reference.create(factory.create(user_432, data.user, { initialized: true, merge: true, newEntity, convertCustomTypes, normalizeAccessors, schema }));
9402
+ entity.user = Reference.create(factory.create(user_434, data.user, { initialized: true, merge: true, newEntity, convertCustomTypes, normalizeAccessors, schema }));
9373
9403
  }
9374
9404
  }
9375
9405
  if (data.token === null) {
@@ -9414,7 +9444,7 @@ export default {
9414
9444
  }
9415
9445
  };
9416
9446
  },
9417
- 'hydrator-email_verification_8000-full-true': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_id, convertToDatabaseValue_id, user_440, user_441) {
9447
+ 'hydrator-email_verification_8000-full-true': function (isPrimaryKey, isEntity, isScalarReference, Collection, Reference, PolymorphicRef, ValidationError, convertToJSValue_id, convertToDatabaseValue_id, user_442, user_443) {
9418
9448
  // compiled hydrator for entity EmailVerificationEntity ( normalized)
9419
9449
  return function (entity, data, factory, newEntity, convertCustomTypes, schema, parentSchema, normalizeAccessors) {
9420
9450
  if (data.id === null) {
@@ -9462,10 +9492,10 @@ export default {
9462
9492
  }
9463
9493
  else if (typeof data.user !== 'undefined') {
9464
9494
  if (isPrimaryKey(data.user, true)) {
9465
- entity.user = Reference.create(factory.createReference(user_440, data.user, { merge: true, convertCustomTypes, normalizeAccessors, schema }));
9495
+ entity.user = Reference.create(factory.createReference(user_442, data.user, { merge: true, convertCustomTypes, normalizeAccessors, schema }));
9466
9496
  }
9467
9497
  else if (data.user && typeof data.user === 'object') {
9468
- entity.user = Reference.create(factory.create(user_441, data.user, { initialized: true, merge: true, newEntity, convertCustomTypes, normalizeAccessors, schema }));
9498
+ entity.user = Reference.create(factory.create(user_443, data.user, { initialized: true, merge: true, newEntity, convertCustomTypes, normalizeAccessors, schema }));
9469
9499
  }
9470
9500
  }
9471
9501
  if (data.token === null) {