extensions-api.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*! firebase-admin v12.1.1 */
  2. /*!
  3. * @license
  4. * Copyright 2022 Google Inc.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * `SettableProcessingState` represents all the processing states that can be set
  20. * on an Extension instance's runtime data.
  21. *
  22. * @remarks
  23. * You can set the following states:
  24. *
  25. * - `NONE`: No relevant lifecycle event work has been done.
  26. * Set this to clear out old statuses.
  27. *
  28. * - `PROCESSING_COMPLETE`: Lifecycle event work completed with no errors.
  29. *
  30. * - `PROCESSING_WARNING`: Lifecycle event work succeeded partially, or
  31. * something happened that the user should be warned about.
  32. *
  33. * - `PROCESSING_FAILED`: Lifecycle event work failed completely, but the
  34. * instance will still work correctly going forward.
  35. *
  36. * If the extension instance is in a broken state due to errors, instead call
  37. * {@link Runtime.setFatalError}.
  38. *
  39. * The "processing" state gets set automatically when a lifecycle event handler
  40. * starts; you can't set it explicitly.
  41. * To report the ongoing status of an extension's function, use `console.log`
  42. * or the Cloud Functions logger SDK.
  43. */
  44. export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';