parse-stack-next 5.0.0 → 5.1.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.bundle/config +2 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.yml +105 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.yml +67 -0
  5. data/.github/dependabot.yml +13 -0
  6. data/.github/workflows/codeql.yml +1 -1
  7. data/.github/workflows/docs.yml +3 -3
  8. data/.github/workflows/release.yml +43 -0
  9. data/.github/workflows/ruby.yml +1 -1
  10. data/.gitignore +1 -0
  11. data/.vscode/settings.json +3 -0
  12. data/.yardopts +19 -0
  13. data/CHANGELOG.md +802 -0
  14. data/Gemfile +3 -0
  15. data/Gemfile.lock +8 -5
  16. data/README.md +16 -1
  17. data/Rakefile +5 -1
  18. data/docs/acl_clp_guide.md +553 -0
  19. data/docs/atlas_vector_search_guide.md +123 -22
  20. data/docs/client_sdk_guide.md +201 -5
  21. data/docs/usage_guide.md +21 -0
  22. data/docs/yard-template/default/fulldoc/html/css/common.css +1222 -0
  23. data/docs/yard-template/default/fulldoc/html/css/full_list.css +387 -0
  24. data/lib/parse/agent/tools.rb +153 -1
  25. data/lib/parse/cache/pool.rb +15 -0
  26. data/lib/parse/cache/redis.rb +114 -2
  27. data/lib/parse/client/caching.rb +18 -1
  28. data/lib/parse/client.rb +79 -12
  29. data/lib/parse/embeddings/cohere.rb +143 -6
  30. data/lib/parse/embeddings/provider.rb +20 -2
  31. data/lib/parse/embeddings/voyage.rb +102 -0
  32. data/lib/parse/embeddings.rb +332 -1
  33. data/lib/parse/live_query/client.rb +167 -4
  34. data/lib/parse/live_query/configuration.rb +12 -0
  35. data/lib/parse/live_query/subscription.rb +55 -2
  36. data/lib/parse/live_query.rb +123 -1
  37. data/lib/parse/lock.rb +342 -0
  38. data/lib/parse/lock_backend.rb +308 -0
  39. data/lib/parse/model/classes/audience.rb +5 -0
  40. data/lib/parse/model/classes/installation.rb +122 -0
  41. data/lib/parse/model/classes/job_schedule.rb +3 -1
  42. data/lib/parse/model/classes/job_status.rb +4 -1
  43. data/lib/parse/model/classes/push_status.rb +4 -1
  44. data/lib/parse/model/classes/session.rb +7 -0
  45. data/lib/parse/model/classes/user.rb +204 -0
  46. data/lib/parse/model/core/create_lock.rb +28 -134
  47. data/lib/parse/model/core/embed_managed.rb +162 -13
  48. data/lib/parse/model/core/parse_reference.rb +17 -1
  49. data/lib/parse/model/core/querying.rb +26 -2
  50. data/lib/parse/model/file.rb +523 -18
  51. data/lib/parse/query.rb +31 -1
  52. data/lib/parse/stack/version.rb +1 -1
  53. data/lib/parse/stack.rb +98 -1
  54. data/parse-stack-next.gemspec +2 -2
  55. metadata +19 -7
@@ -224,7 +224,23 @@ module Parse
224
224
  if respond_to?(:protect_fields) && respond_to?(:class_permissions)
225
225
  existing = class_permissions.protected_fields_for("*") rescue []
226
226
  merged = (existing + [field_name.to_s]).uniq
227
- protect_fields("*", merged)
227
+ # Suppress Parse::User's "raw protect_fields called" advisory
228
+ # for this internal auto-install. The advisory exists to nudge
229
+ # app code toward the new master_only_fields/self_visible_fields
230
+ # DSL; the parse_reference auto-install is a different concern
231
+ # and should not trip it at gem boot.
232
+ prior = nil
233
+ if is_a?(Class) && self <= Parse::User
234
+ prior = instance_variable_get(:@_user_field_dsl_active)
235
+ instance_variable_set(:@_user_field_dsl_active, true)
236
+ end
237
+ begin
238
+ protect_fields("*", merged)
239
+ ensure
240
+ if is_a?(Class) && self <= Parse::User
241
+ instance_variable_set(:@_user_field_dsl_active, prior)
242
+ end
243
+ end
228
244
  end
229
245
 
230
246
  # Auto-install write-side protection: once the after_create
@@ -435,10 +435,28 @@ module Parse
435
435
  # @param fields [Array<String>] specific fields to watch for changes (nil = all fields)
436
436
  # @param session_token [String] session token for ACL-aware subscriptions
437
437
  # @param client [Parse::LiveQuery::Client] custom LiveQuery client (optional)
438
+ # @param use_master_key [Boolean] per-subscription master-key opt-in.
439
+ # See {Parse::Query#subscribe} for the full description.
440
+ # @yield [subscription] runs the block with the freshly-constructed
441
+ # {Parse::LiveQuery::Subscription} BEFORE the subscribe frame is
442
+ # sent so caller-registered callbacks are wired before any server
443
+ # events can arrive. Optional — callers may still capture the
444
+ # returned subscription and register callbacks later.
445
+ # @example block form (ergonomic, no race window)
446
+ # Post.subscribe(where: { published: true }) do |sub|
447
+ # sub.on(:create) { |obj| puts "new: #{obj.id}" }
448
+ # sub.on(:update) { |obj, prev| puts "updated: #{obj.id}" }
449
+ # end
450
+ # @example capture-then-wire form (equivalent, but has a tiny
451
+ # window between subscribe-frame send and the first .on call
452
+ # where a server event would be dropped if it arrived first)
453
+ # sub = Post.subscribe(where: { published: true })
454
+ # sub.on(:create) { |obj| … }
438
455
  # @return [Parse::LiveQuery::Subscription] the subscription object
439
456
  # @see Parse::LiveQuery::Subscription
440
457
  # @see Parse::Query#subscribe
441
- def subscribe(where: {}, fields: nil, session_token: nil, client: nil)
458
+ def subscribe(where: {}, fields: nil, session_token: nil, client: nil,
459
+ use_master_key: false, &block)
442
460
  # Fall through to the ambient set by `Parse.with_session` / `Parse.login`
443
461
  # so a caller wrapping a region with `with_session(user) { Klass.subscribe ... }`
444
462
  # gets an ACL-aware subscription without re-threading the token.
@@ -446,7 +464,13 @@ module Parse
446
464
  ambient = Parse.current_session_token
447
465
  session_token = ambient if ambient.is_a?(String) && !ambient.empty?
448
466
  end
449
- query(where).subscribe(fields: fields, session_token: session_token, client: client)
467
+ query(where).subscribe(
468
+ fields: fields,
469
+ session_token: session_token,
470
+ client: client,
471
+ use_master_key: use_master_key,
472
+ &block
473
+ )
450
474
  end
451
475
 
452
476
  # Find objects for a given objectId in this collection. The result is a list