firebase-admin 11.9.0 → 11.10.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 (206) hide show
  1. package/lib/app/core.d.ts +1 -1
  2. package/lib/app/core.js +1 -1
  3. package/lib/app/credential-factory.d.ts +1 -1
  4. package/lib/app/credential-factory.js +1 -1
  5. package/lib/app/credential-internal.d.ts +1 -1
  6. package/lib/app/credential-internal.js +1 -1
  7. package/lib/app/credential.d.ts +1 -1
  8. package/lib/app/credential.js +1 -1
  9. package/lib/app/firebase-app.d.ts +1 -1
  10. package/lib/app/firebase-app.js +1 -1
  11. package/lib/app/firebase-namespace.d.ts +1 -1
  12. package/lib/app/firebase-namespace.js +1 -1
  13. package/lib/app/index.d.ts +1 -1
  14. package/lib/app/index.js +1 -1
  15. package/lib/app/lifecycle.d.ts +1 -1
  16. package/lib/app/lifecycle.js +1 -1
  17. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  18. package/lib/app-check/app-check-api-client-internal.js +1 -1
  19. package/lib/app-check/app-check-api.d.ts +1 -1
  20. package/lib/app-check/app-check-api.js +1 -1
  21. package/lib/app-check/app-check-namespace.d.ts +1 -1
  22. package/lib/app-check/app-check-namespace.js +1 -1
  23. package/lib/app-check/app-check.d.ts +1 -1
  24. package/lib/app-check/app-check.js +1 -1
  25. package/lib/app-check/index.d.ts +1 -1
  26. package/lib/app-check/index.js +1 -1
  27. package/lib/app-check/token-generator.d.ts +1 -1
  28. package/lib/app-check/token-generator.js +1 -1
  29. package/lib/app-check/token-verifier.d.ts +1 -1
  30. package/lib/app-check/token-verifier.js +1 -1
  31. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  32. package/lib/auth/action-code-settings-builder.js +1 -1
  33. package/lib/auth/auth-api-request.d.ts +1 -1
  34. package/lib/auth/auth-api-request.js +1 -1
  35. package/lib/auth/auth-config.d.ts +1 -1
  36. package/lib/auth/auth-config.js +13 -13
  37. package/lib/auth/auth-namespace.d.ts +1 -1
  38. package/lib/auth/auth-namespace.js +1 -1
  39. package/lib/auth/auth.d.ts +1 -1
  40. package/lib/auth/auth.js +1 -1
  41. package/lib/auth/base-auth.d.ts +1 -1
  42. package/lib/auth/base-auth.js +1 -1
  43. package/lib/auth/identifier.d.ts +1 -1
  44. package/lib/auth/identifier.js +1 -1
  45. package/lib/auth/index.d.ts +1 -1
  46. package/lib/auth/index.js +1 -1
  47. package/lib/auth/project-config-manager.d.ts +1 -1
  48. package/lib/auth/project-config-manager.js +1 -1
  49. package/lib/auth/project-config.d.ts +1 -1
  50. package/lib/auth/project-config.js +1 -1
  51. package/lib/auth/tenant-manager.d.ts +1 -1
  52. package/lib/auth/tenant-manager.js +1 -1
  53. package/lib/auth/tenant.d.ts +1 -1
  54. package/lib/auth/tenant.js +1 -1
  55. package/lib/auth/token-generator.d.ts +1 -1
  56. package/lib/auth/token-generator.js +1 -1
  57. package/lib/auth/token-verifier.d.ts +1 -1
  58. package/lib/auth/token-verifier.js +1 -1
  59. package/lib/auth/user-import-builder.d.ts +1 -1
  60. package/lib/auth/user-import-builder.js +1 -1
  61. package/lib/auth/user-record.d.ts +28 -4
  62. package/lib/auth/user-record.js +58 -6
  63. package/lib/credential/index.d.ts +1 -1
  64. package/lib/credential/index.js +1 -1
  65. package/lib/database/database-namespace.d.ts +1 -1
  66. package/lib/database/database-namespace.js +1 -1
  67. package/lib/database/database.d.ts +1 -1
  68. package/lib/database/database.js +1 -1
  69. package/lib/database/index.d.ts +1 -1
  70. package/lib/database/index.js +1 -1
  71. package/lib/default-namespace.d.ts +1 -1
  72. package/lib/default-namespace.js +1 -1
  73. package/lib/esm/storage/index.js +1 -0
  74. package/lib/eventarc/cloudevent.d.ts +1 -1
  75. package/lib/eventarc/cloudevent.js +1 -1
  76. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  77. package/lib/eventarc/eventarc-client-internal.js +1 -1
  78. package/lib/eventarc/eventarc-utils.d.ts +1 -1
  79. package/lib/eventarc/eventarc-utils.js +1 -1
  80. package/lib/eventarc/eventarc.d.ts +1 -1
  81. package/lib/eventarc/eventarc.js +1 -1
  82. package/lib/eventarc/index.d.ts +1 -1
  83. package/lib/eventarc/index.js +1 -1
  84. package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
  85. package/lib/extensions/extensions-api-client-internal.js +1 -1
  86. package/lib/extensions/extensions-api.d.ts +1 -1
  87. package/lib/extensions/extensions-api.js +1 -1
  88. package/lib/extensions/extensions.d.ts +1 -1
  89. package/lib/extensions/extensions.js +1 -1
  90. package/lib/extensions/index.d.ts +1 -1
  91. package/lib/extensions/index.js +1 -1
  92. package/lib/firebase-namespace-api.d.ts +1 -1
  93. package/lib/firebase-namespace-api.js +1 -1
  94. package/lib/firestore/firestore-internal.d.ts +1 -1
  95. package/lib/firestore/firestore-internal.js +1 -1
  96. package/lib/firestore/firestore-namespace.d.ts +1 -1
  97. package/lib/firestore/firestore-namespace.js +1 -1
  98. package/lib/firestore/index.d.ts +67 -23
  99. package/lib/firestore/index.js +1 -1
  100. package/lib/functions/functions-api-client-internal.d.ts +3 -2
  101. package/lib/functions/functions-api-client-internal.js +105 -27
  102. package/lib/functions/functions-api.d.ts +33 -1
  103. package/lib/functions/functions-api.js +1 -1
  104. package/lib/functions/functions.d.ts +7 -1
  105. package/lib/functions/functions.js +9 -1
  106. package/lib/functions/index.d.ts +2 -2
  107. package/lib/functions/index.js +1 -1
  108. package/lib/index.d.ts +1 -1
  109. package/lib/index.js +1 -1
  110. package/lib/installations/index.d.ts +1 -1
  111. package/lib/installations/index.js +1 -1
  112. package/lib/installations/installations-namespace.d.ts +1 -1
  113. package/lib/installations/installations-namespace.js +1 -1
  114. package/lib/installations/installations-request-handler.d.ts +1 -1
  115. package/lib/installations/installations-request-handler.js +1 -1
  116. package/lib/installations/installations.d.ts +1 -1
  117. package/lib/installations/installations.js +1 -1
  118. package/lib/instance-id/index.d.ts +1 -1
  119. package/lib/instance-id/index.js +1 -1
  120. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  121. package/lib/instance-id/instance-id-namespace.js +1 -1
  122. package/lib/instance-id/instance-id.d.ts +1 -1
  123. package/lib/instance-id/instance-id.js +1 -1
  124. package/lib/machine-learning/index.d.ts +1 -1
  125. package/lib/machine-learning/index.js +1 -1
  126. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  127. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  128. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  129. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  130. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  131. package/lib/machine-learning/machine-learning-utils.js +1 -1
  132. package/lib/machine-learning/machine-learning.d.ts +1 -1
  133. package/lib/machine-learning/machine-learning.js +1 -1
  134. package/lib/messaging/batch-request-internal.d.ts +1 -1
  135. package/lib/messaging/batch-request-internal.js +1 -1
  136. package/lib/messaging/index.d.ts +1 -1
  137. package/lib/messaging/index.js +1 -1
  138. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  139. package/lib/messaging/messaging-api-request-internal.js +1 -1
  140. package/lib/messaging/messaging-api.d.ts +1 -1
  141. package/lib/messaging/messaging-api.js +1 -1
  142. package/lib/messaging/messaging-errors-internal.d.ts +1 -1
  143. package/lib/messaging/messaging-errors-internal.js +1 -1
  144. package/lib/messaging/messaging-internal.d.ts +1 -1
  145. package/lib/messaging/messaging-internal.js +1 -1
  146. package/lib/messaging/messaging-namespace.d.ts +1 -1
  147. package/lib/messaging/messaging-namespace.js +1 -1
  148. package/lib/messaging/messaging.d.ts +1 -1
  149. package/lib/messaging/messaging.js +1 -1
  150. package/lib/project-management/android-app.d.ts +1 -1
  151. package/lib/project-management/android-app.js +1 -1
  152. package/lib/project-management/app-metadata.d.ts +1 -1
  153. package/lib/project-management/app-metadata.js +1 -1
  154. package/lib/project-management/index.d.ts +1 -1
  155. package/lib/project-management/index.js +1 -1
  156. package/lib/project-management/ios-app.d.ts +1 -1
  157. package/lib/project-management/ios-app.js +1 -1
  158. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  159. package/lib/project-management/project-management-api-request-internal.js +1 -1
  160. package/lib/project-management/project-management-namespace.d.ts +1 -1
  161. package/lib/project-management/project-management-namespace.js +1 -1
  162. package/lib/project-management/project-management.d.ts +1 -1
  163. package/lib/project-management/project-management.js +1 -1
  164. package/lib/remote-config/index.d.ts +1 -1
  165. package/lib/remote-config/index.js +1 -1
  166. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  167. package/lib/remote-config/remote-config-api-client-internal.js +1 -1
  168. package/lib/remote-config/remote-config-api.d.ts +1 -1
  169. package/lib/remote-config/remote-config-api.js +1 -1
  170. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  171. package/lib/remote-config/remote-config-namespace.js +1 -1
  172. package/lib/remote-config/remote-config.d.ts +1 -1
  173. package/lib/remote-config/remote-config.js +1 -1
  174. package/lib/security-rules/index.d.ts +1 -1
  175. package/lib/security-rules/index.js +1 -1
  176. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  177. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  178. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  179. package/lib/security-rules/security-rules-internal.js +1 -1
  180. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  181. package/lib/security-rules/security-rules-namespace.js +1 -1
  182. package/lib/security-rules/security-rules.d.ts +1 -1
  183. package/lib/security-rules/security-rules.js +1 -1
  184. package/lib/storage/index.d.ts +14 -1
  185. package/lib/storage/index.js +29 -7
  186. package/lib/storage/storage-namespace.d.ts +1 -1
  187. package/lib/storage/storage-namespace.js +1 -1
  188. package/lib/storage/storage.d.ts +1 -1
  189. package/lib/storage/storage.js +1 -1
  190. package/lib/storage/utils.d.ts +20 -0
  191. package/lib/storage/utils.js +21 -0
  192. package/lib/utils/api-request.d.ts +1 -1
  193. package/lib/utils/api-request.js +1 -9
  194. package/lib/utils/crypto-signer.d.ts +1 -1
  195. package/lib/utils/crypto-signer.js +1 -1
  196. package/lib/utils/deep-copy.d.ts +1 -1
  197. package/lib/utils/deep-copy.js +1 -1
  198. package/lib/utils/error.d.ts +1 -1
  199. package/lib/utils/error.js +1 -1
  200. package/lib/utils/index.d.ts +1 -1
  201. package/lib/utils/index.js +1 -1
  202. package/lib/utils/jwt.d.ts +1 -1
  203. package/lib/utils/jwt.js +1 -1
  204. package/lib/utils/validator.d.ts +9 -1
  205. package/lib/utils/validator.js +17 -2
  206. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -23,7 +23,8 @@ const error_1 = require("../utils/error");
23
23
  const utils = require("../utils/index");
24
24
  const validator = require("../utils/validator");
25
25
  const credential_internal_1 = require("../app/credential-internal");
26
- const CLOUD_TASKS_API_URL_FORMAT = 'https://cloudtasks.googleapis.com/v2/projects/{projectId}/locations/{locationId}/queues/{resourceId}/tasks';
26
+ const CLOUD_TASKS_API_RESOURCE_PATH = 'projects/{projectId}/locations/{locationId}/queues/{resourceId}/tasks';
27
+ const CLOUD_TASKS_API_URL_FORMAT = 'https://cloudtasks.googleapis.com/v2/' + CLOUD_TASKS_API_RESOURCE_PATH;
27
28
  const FIREBASE_FUNCTION_URL_FORMAT = 'https://{locationId}-{projectId}.cloudfunctions.net/{resourceId}';
28
29
  const FIREBASE_FUNCTIONS_CONFIG_HEADERS = {
29
30
  'X-Firebase-Client': `fire-admin-node/${utils.getSdkVersion()}`
@@ -43,6 +44,58 @@ class FunctionsApiClient {
43
44
  }
44
45
  this.httpClient = new api_request_1.AuthorizedHttpClient(app);
45
46
  }
47
+ /**
48
+ * Deletes a task from a queue.
49
+ *
50
+ * @param id - The ID of the task to delete.
51
+ * @param functionName - The function name of the queue.
52
+ * @param extensionId - Optional canonical ID of the extension.
53
+ */
54
+ async delete(id, functionName, extensionId) {
55
+ if (!validator.isNonEmptyString(functionName)) {
56
+ throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a non empty string');
57
+ }
58
+ if (!validator.isTaskId(id)) {
59
+ throw new FirebaseFunctionsError('invalid-argument', 'id can contain only letters ([A-Za-z]), numbers ([0-9]), '
60
+ + 'hyphens (-), or underscores (_). The maximum length is 500 characters.');
61
+ }
62
+ let resources;
63
+ try {
64
+ resources = utils.parseResourceName(functionName, 'functions');
65
+ }
66
+ catch (err) {
67
+ throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a single string or a qualified resource name');
68
+ }
69
+ resources.projectId = resources.projectId || await this.getProjectId();
70
+ resources.locationId = resources.locationId || DEFAULT_LOCATION;
71
+ if (!validator.isNonEmptyString(resources.resourceId)) {
72
+ throw new FirebaseFunctionsError('invalid-argument', 'No valid function name specified to enqueue tasks for.');
73
+ }
74
+ if (typeof extensionId !== 'undefined' && validator.isNonEmptyString(extensionId)) {
75
+ resources.resourceId = `ext-${extensionId}-${resources.resourceId}`;
76
+ }
77
+ try {
78
+ const serviceUrl = await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT.concat('/', id));
79
+ const request = {
80
+ method: 'DELETE',
81
+ url: serviceUrl,
82
+ headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
83
+ };
84
+ await this.httpClient.send(request);
85
+ }
86
+ catch (err) {
87
+ if (err instanceof api_request_1.HttpError) {
88
+ if (err.response.status === 404) {
89
+ // if no task with the provided ID exists, then ignore the delete.
90
+ return;
91
+ }
92
+ throw this.toFirebaseError(err);
93
+ }
94
+ else {
95
+ throw err;
96
+ }
97
+ }
98
+ }
46
99
  /**
47
100
  * Creates a task and adds it to a queue.
48
101
  *
@@ -51,11 +104,10 @@ class FunctionsApiClient {
51
104
  * @param extensionId - Optional canonical ID of the extension.
52
105
  * @param opts - Optional options when enqueuing a new task.
53
106
  */
54
- enqueue(data, functionName, extensionId, opts) {
107
+ async enqueue(data, functionName, extensionId, opts) {
55
108
  if (!validator.isNonEmptyString(functionName)) {
56
109
  throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a non empty string');
57
110
  }
58
- const task = this.validateTaskOptions(data, opts);
59
111
  let resources;
60
112
  try {
61
113
  resources = utils.parseResourceName(functionName, 'functions');
@@ -63,30 +115,41 @@ class FunctionsApiClient {
63
115
  catch (err) {
64
116
  throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a single string or a qualified resource name');
65
117
  }
118
+ resources.projectId = resources.projectId || await this.getProjectId();
119
+ resources.locationId = resources.locationId || DEFAULT_LOCATION;
120
+ if (!validator.isNonEmptyString(resources.resourceId)) {
121
+ throw new FirebaseFunctionsError('invalid-argument', 'No valid function name specified to enqueue tasks for.');
122
+ }
66
123
  if (typeof extensionId !== 'undefined' && validator.isNonEmptyString(extensionId)) {
67
124
  resources.resourceId = `ext-${extensionId}-${resources.resourceId}`;
68
125
  }
69
- return this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT)
70
- .then((serviceUrl) => {
71
- return this.updateTaskPayload(task, resources, extensionId)
72
- .then((task) => {
73
- const request = {
74
- method: 'POST',
75
- url: serviceUrl,
76
- headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
77
- data: {
78
- task,
79
- }
80
- };
81
- return this.httpClient.send(request);
82
- });
83
- })
84
- .then(() => {
85
- return;
86
- })
87
- .catch((err) => {
88
- throw this.toFirebaseError(err);
89
- });
126
+ const task = this.validateTaskOptions(data, resources, opts);
127
+ try {
128
+ const serviceUrl = await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT);
129
+ const taskPayload = await this.updateTaskPayload(task, resources, extensionId);
130
+ const request = {
131
+ method: 'POST',
132
+ url: serviceUrl,
133
+ headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
134
+ data: {
135
+ task: taskPayload,
136
+ }
137
+ };
138
+ await this.httpClient.send(request);
139
+ }
140
+ catch (err) {
141
+ if (err instanceof api_request_1.HttpError) {
142
+ if (err.response.status === 409) {
143
+ throw new FirebaseFunctionsError('task-already-exists', `A task with ID ${opts?.id} already exists`);
144
+ }
145
+ else {
146
+ throw this.toFirebaseError(err);
147
+ }
148
+ }
149
+ else {
150
+ throw err;
151
+ }
152
+ }
90
153
  }
91
154
  getUrl(resourceName, urlFormat) {
92
155
  let { locationId } = resourceName;
@@ -142,7 +205,7 @@ class FunctionsApiClient {
142
205
  return accountId;
143
206
  });
144
207
  }
145
- validateTaskOptions(data, opts) {
208
+ validateTaskOptions(data, resources, opts) {
146
209
  const task = {
147
210
  httpRequest: {
148
211
  url: '',
@@ -150,7 +213,10 @@ class FunctionsApiClient {
150
213
  serviceAccountEmail: '',
151
214
  },
152
215
  body: Buffer.from(JSON.stringify({ data })).toString('base64'),
153
- headers: { 'Content-Type': 'application/json' }
216
+ headers: {
217
+ 'Content-Type': 'application/json',
218
+ ...opts?.headers,
219
+ }
154
220
  }
155
221
  };
156
222
  if (typeof opts !== 'undefined') {
@@ -183,6 +249,18 @@ class FunctionsApiClient {
183
249
  }
184
250
  task.dispatchDeadline = `${opts.dispatchDeadlineSeconds}s`;
185
251
  }
252
+ if ('id' in opts && typeof opts.id !== 'undefined') {
253
+ if (!validator.isTaskId(opts.id)) {
254
+ throw new FirebaseFunctionsError('invalid-argument', 'id can contain only letters ([A-Za-z]), numbers ([0-9]), '
255
+ + 'hyphens (-), or underscores (_). The maximum length is 500 characters.');
256
+ }
257
+ const resourcePath = utils.formatString(CLOUD_TASKS_API_RESOURCE_PATH, {
258
+ projectId: resources.projectId,
259
+ locationId: resources.locationId,
260
+ resourceId: resources.resourceId,
261
+ });
262
+ task.name = resourcePath.concat('/', opts.id);
263
+ }
186
264
  if (typeof opts.uri !== 'undefined') {
187
265
  if (!validator.isURL(opts.uri)) {
188
266
  throw new FirebaseFunctionsError('invalid-argument', 'uri must be a valid URL string.');
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -54,6 +54,38 @@ export type TaskOptions = DeliverySchedule & TaskOptionsExperimental & {
54
54
  * The default is 10 minutes. The deadline must be in the range of 15 seconds and 30 minutes.
55
55
  */
56
56
  dispatchDeadlineSeconds?: number;
57
+ /**
58
+ * The ID to use for the enqueued event.
59
+ * If not provided, one will be automatically generated.
60
+ * If provided, an explicitly specified task ID enables task de-duplication. If a task's ID is
61
+ * identical to that of an existing task or a task that was deleted or executed recently then
62
+ * the call will throw an error with code "functions/task-already-exists". Another task with
63
+ * the same ID can't be created for ~1hour after the original task was deleted or executed.
64
+ *
65
+ * Because there is an extra lookup cost to identify duplicate task IDs, setting ID
66
+ * significantly increases latency. Using hashed strings for the task ID or for the prefix of
67
+ * the task ID is recommended. Choosing task IDs that are sequential or have sequential
68
+ * prefixes, for example using a timestamp, causes an increase in latency and error rates in
69
+ * all task commands. The infrastructure relies on an approximately uniform distribution of
70
+ * task IDs to store and serve tasks efficiently.
71
+ *
72
+ * "Push IDs" from the Firebase Realtime Database make poor IDs because they are based on
73
+ * timestamps and will cause contention (slowdowns) in your task queue. Reversed push IDs
74
+ * however form a perfect distribution and are an ideal key. To reverse a string in
75
+ * javascript use `someString.split("").reverse().join("")`
76
+ */
77
+ id?: string;
78
+ /**
79
+ * HTTP request headers to include in the request to the task queue function.
80
+ * These headers represent a subset of the headers that will accompany the task's HTTP
81
+ * request. Some HTTP request headers will be ignored or replaced, e.g. Authorization, Host, Content-Length,
82
+ * User-Agent etc. cannot be overridden.
83
+ *
84
+ * By default, Content-Type is set to 'application/json'.
85
+ *
86
+ * The size of the headers must be less than 80KB.
87
+ */
88
+ headers?: Record<string, string>;
57
89
  };
58
90
  /**
59
91
  * Type representing experimental (beta) task options.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -60,4 +60,10 @@ export declare class TaskQueue<Args = Record<string, any>> {
60
60
  * @returns A promise that resolves when the task has successfully been added to the queue.
61
61
  */
62
62
  enqueue(data: Args, opts?: TaskOptions): Promise<void>;
63
+ /**
64
+ * Deletes an enqueued task if it has not yet completed.
65
+ * @param id - the ID of the task, relative to this queue.
66
+ * @returns A promise that resolves when the task has been deleted.
67
+ */
68
+ delete(id: string): Promise<void>;
63
69
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -93,5 +93,13 @@ class TaskQueue {
93
93
  enqueue(data, opts) {
94
94
  return this.client.enqueue(data, this.functionName, this.extensionId, opts);
95
95
  }
96
+ /**
97
+ * Deletes an enqueued task if it has not yet completed.
98
+ * @param id - the ID of the task, relative to this queue.
99
+ * @returns A promise that resolves when the task has been deleted.
100
+ */
101
+ delete(id) {
102
+ return this.client.delete(id, this.functionName, this.extensionId);
103
+ }
96
104
  }
97
105
  exports.TaskQueue = TaskQueue;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -22,7 +22,7 @@
22
22
  */
23
23
  import { App } from '../app';
24
24
  import { Functions } from './functions';
25
- export { DelayDelivery, AbsoluteDelivery, DeliverySchedule, TaskOptions, TaskOptionsExperimental } from './functions-api';
25
+ export { DelayDelivery, AbsoluteDelivery, DeliverySchedule, TaskOptions, TaskOptionsExperimental, } from './functions-api';
26
26
  export { Functions, TaskQueue } from './functions';
27
27
  /**
28
28
  * Gets the {@link Functions} service for the default app
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  import { App } from '../app/index';
3
3
  import { InstanceId as TInstanceId } from './instance-id';
4
4
  /**
@@ -1,3 +1,3 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v11.9.0 */
1
+ /*! firebase-admin v11.10.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *