@planningcenter/chat-react-native 3.44.3-qa-staging.0 → 3.44.3-qa-staging.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.
@@ -1 +1 @@
1
- {"version":3,"file":"response_error.d.ts","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,qBAAa,aAAc,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,cAAc,CAAA;gBAEZ,QAAQ,EAAE,cAAc;CAQrC;AAKD,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,QAiBxD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,mBAMhD,CAAA"}
1
+ {"version":3,"file":"response_error.d.ts","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAExD,qBAAa,aAAc,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAChC,QAAQ,EAAE,cAAc,CAAA;gBAEZ,QAAQ,EAAE,cAAc;CAQrC;AAOD,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,QAgBxD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,mBAMhD,CAAA"}
@@ -14,7 +14,9 @@ export class ResponseError extends Error {
14
14
  }
15
15
  // Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime
16
16
  // swaps in a `fetch` whose `FetchResponse` isn't an instance of the global
17
- // `Response`, so `instanceof` silently misses it under Expo.
17
+ // `Response`, so `instanceof` silently misses it under Expo. We avoid checking
18
+ // `redirected` because React Native's whatwg-fetch polyfill never assigns it,
19
+ // which would reject every real response under RN's fetch.
18
20
  export const isResponseLike = (value) => {
19
21
  if (typeof value !== 'object' || value === null)
20
22
  return false;
@@ -22,7 +24,6 @@ export const isResponseLike = (value) => {
22
24
  return (typeof candidate.status === 'number' &&
23
25
  typeof candidate.statusText === 'string' &&
24
26
  typeof candidate.ok === 'boolean' &&
25
- typeof candidate.redirected === 'boolean' &&
26
27
  typeof candidate.url === 'string' &&
27
28
  typeof candidate.headers === 'object' &&
28
29
  candidate.headers !== null &&
@@ -1 +1 @@
1
- {"version":3,"file":"response_error.js","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,MAAM,CAAQ;IACd,UAAU,CAAQ;IAClB,MAAM,CAA0B;IAChC,QAAQ,CAAgB;IAExB,YAAY,QAAwB;QAClC,KAAK,CAAC,kBAAkB,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;QACnE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,UAAU,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAED,4EAA4E;AAC5E,2EAA2E;AAC3E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAc,EAAqB,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAE7D,MAAM,SAAS,GAAG,KAAgC,CAAA;IAClD,OAAO,CACL,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ;QACpC,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ;QACxC,OAAO,SAAS,CAAC,EAAE,KAAK,SAAS;QACjC,OAAO,SAAS,CAAC,UAAU,KAAK,SAAS;QACzC,OAAO,SAAS,CAAC,GAAG,KAAK,QAAQ;QACjC,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ;QACrC,SAAS,CAAC,OAAO,KAAK,IAAI;QAC1B,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU;QACrC,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,SAAS,CAAC,WAAW,KAAK,UAAU,CAC5C,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAE,EAAE;IACnD,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,aAAa,CAAC,KAAuB,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { FailedResponse } from '../types/api_primitives'\n\nexport class ResponseError extends Error {\n status: number\n statusText: string\n errors: FailedResponse['errors']\n response: FailedResponse\n\n constructor(response: FailedResponse) {\n super(`ResponseError: ${response?.status} ${response?.statusText}`)\n this.name = 'ResponseError'\n this.status = response?.status\n this.statusText = response?.statusText\n this.errors = response?.errors || []\n this.response = response\n }\n}\n\n// Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime\n// swaps in a `fetch` whose `FetchResponse` isn't an instance of the global\n// `Response`, so `instanceof` silently misses it under Expo.\nexport const isResponseLike = (value: unknown): value is Response => {\n if (typeof value !== 'object' || value === null) return false\n\n const candidate = value as Record<string, unknown>\n return (\n typeof candidate.status === 'number' &&\n typeof candidate.statusText === 'string' &&\n typeof candidate.ok === 'boolean' &&\n typeof candidate.redirected === 'boolean' &&\n typeof candidate.url === 'string' &&\n typeof candidate.headers === 'object' &&\n candidate.headers !== null &&\n typeof candidate.clone === 'function' &&\n typeof candidate.json === 'function' &&\n typeof candidate.text === 'function' &&\n typeof candidate.arrayBuffer === 'function'\n )\n}\n\nexport const throwResponseError = (error: unknown) => {\n if (isResponseLike(error)) {\n throw new ResponseError(error as FailedResponse)\n }\n\n return Promise.reject(error)\n}\n"]}
1
+ {"version":3,"file":"response_error.js","sourceRoot":"","sources":["../../src/utils/response_error.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,MAAM,CAAQ;IACd,UAAU,CAAQ;IAClB,MAAM,CAA0B;IAChC,QAAQ,CAAgB;IAExB,YAAY,QAAwB;QAClC,KAAK,CAAC,kBAAkB,QAAQ,EAAE,MAAM,IAAI,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;QACnE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,UAAU,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAED,4EAA4E;AAC5E,2EAA2E;AAC3E,+EAA+E;AAC/E,8EAA8E;AAC9E,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAc,EAAqB,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAE7D,MAAM,SAAS,GAAG,KAAgC,CAAA;IAClD,OAAO,CACL,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ;QACpC,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ;QACxC,OAAO,SAAS,CAAC,EAAE,KAAK,SAAS;QACjC,OAAO,SAAS,CAAC,GAAG,KAAK,QAAQ;QACjC,OAAO,SAAS,CAAC,OAAO,KAAK,QAAQ;QACrC,SAAS,CAAC,OAAO,KAAK,IAAI;QAC1B,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU;QACrC,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU;QACpC,OAAO,SAAS,CAAC,WAAW,KAAK,UAAU,CAC5C,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAE,EAAE;IACnD,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,aAAa,CAAC,KAAuB,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { FailedResponse } from '../types/api_primitives'\n\nexport class ResponseError extends Error {\n status: number\n statusText: string\n errors: FailedResponse['errors']\n response: FailedResponse\n\n constructor(response: FailedResponse) {\n super(`ResponseError: ${response?.status} ${response?.statusText}`)\n this.name = 'ResponseError'\n this.status = response?.status\n this.statusText = response?.statusText\n this.errors = response?.errors || []\n this.response = response\n }\n}\n\n// Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime\n// swaps in a `fetch` whose `FetchResponse` isn't an instance of the global\n// `Response`, so `instanceof` silently misses it under Expo. We avoid checking\n// `redirected` because React Native's whatwg-fetch polyfill never assigns it,\n// which would reject every real response under RN's fetch.\nexport const isResponseLike = (value: unknown): value is Response => {\n if (typeof value !== 'object' || value === null) return false\n\n const candidate = value as Record<string, unknown>\n return (\n typeof candidate.status === 'number' &&\n typeof candidate.statusText === 'string' &&\n typeof candidate.ok === 'boolean' &&\n typeof candidate.url === 'string' &&\n typeof candidate.headers === 'object' &&\n candidate.headers !== null &&\n typeof candidate.clone === 'function' &&\n typeof candidate.json === 'function' &&\n typeof candidate.text === 'function' &&\n typeof candidate.arrayBuffer === 'function'\n )\n}\n\nexport const throwResponseError = (error: unknown) => {\n if (isResponseLike(error)) {\n throw new ResponseError(error as FailedResponse)\n }\n\n return Promise.reject(error)\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.44.3-qa-staging.0",
3
+ "version": "3.44.3-qa-staging.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@fortawesome/fontawesome-svg-core": "^7.2.0",
33
33
  "@fortawesome/react-native-fontawesome": "^0.3.2",
34
- "@planningcenter/emoji-keyboard": "3.44.3-qa-staging.0",
34
+ "@planningcenter/emoji-keyboard": "3.44.3-qa-staging.1",
35
35
  "lodash-inflection": "^1.5.0",
36
36
  "react-compiler-runtime": "^1.0.0"
37
37
  },
@@ -78,5 +78,5 @@
78
78
  "sf-symbols-typescript": "^2.2.0",
79
79
  "typescript": "~6.0.3"
80
80
  },
81
- "gitHead": "48633b0c777d9121c0fb0aa77582a0e5235a0bb1"
81
+ "gitHead": "898af4cb2b72d9aa4e34746f9594a5b510092a9a"
82
82
  }
@@ -0,0 +1,5 @@
1
+ declare module 'whatwg-fetch' {
2
+ export const Response: {
3
+ new (body?: BodyInit | null, init?: ResponseInit): globalThis.Response
4
+ }
5
+ }
@@ -1,3 +1,5 @@
1
+ import { Response as ReactNativeResponse } from 'whatwg-fetch'
2
+
1
3
  import { isResponseLike, ResponseError, throwResponseError } from '../response_error'
2
4
 
3
5
  // Mimics Expo's winter `FetchResponse`: the full Response shape, but NOT an
@@ -24,6 +26,17 @@ describe('isResponseLike', () => {
24
26
  expect(isResponseLike(notARealResponse)).toBe(true)
25
27
  })
26
28
 
29
+ it("recognizes React Native's fetch Response, which never assigns `redirected`", () => {
30
+ const response = new ReactNativeResponse(JSON.stringify({ errors: [] }), {
31
+ status: 401,
32
+ statusText: 'Unauthorized',
33
+ headers: { 'Content-Type': 'application/json' },
34
+ })
35
+
36
+ expect('redirected' in response).toBe(false)
37
+ expect(isResponseLike(response)).toBe(true)
38
+ })
39
+
27
40
  it('rejects things that are not responses', () => {
28
41
  expect(isResponseLike(null)).toBe(false)
29
42
  expect(isResponseLike(new Error('boom'))).toBe(false)
@@ -18,7 +18,9 @@ export class ResponseError extends Error {
18
18
 
19
19
  // Detect a fetch Response by shape, not `instanceof`: Expo's winter runtime
20
20
  // swaps in a `fetch` whose `FetchResponse` isn't an instance of the global
21
- // `Response`, so `instanceof` silently misses it under Expo.
21
+ // `Response`, so `instanceof` silently misses it under Expo. We avoid checking
22
+ // `redirected` because React Native's whatwg-fetch polyfill never assigns it,
23
+ // which would reject every real response under RN's fetch.
22
24
  export const isResponseLike = (value: unknown): value is Response => {
23
25
  if (typeof value !== 'object' || value === null) return false
24
26
 
@@ -27,7 +29,6 @@ export const isResponseLike = (value: unknown): value is Response => {
27
29
  typeof candidate.status === 'number' &&
28
30
  typeof candidate.statusText === 'string' &&
29
31
  typeof candidate.ok === 'boolean' &&
30
- typeof candidate.redirected === 'boolean' &&
31
32
  typeof candidate.url === 'string' &&
32
33
  typeof candidate.headers === 'object' &&
33
34
  candidate.headers !== null &&