@amityco/ts-sdk-react-native 7.8.7-490e5688.0 → 7.8.7-d7c45f62.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.
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/communityRepository/api/updateCommunity.d.ts +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/communityRepository/api/updateCommunity.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/dist/fileRepository/api/getFile.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityReactNativeTypescriptSDK/AmityReactNativeTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/dist/fileRepository/api/getFile.d.ts +1 -1
- package/dist/fileRepository/api/getFile.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/communityRepository/api/updateCommunity.ts +2 -0
- package/src/fileRepository/api/getFile.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* @category Community API
|
|
14
14
|
* @async
|
|
15
15
|
*/
|
|
16
|
-
export declare const updateCommunity: (communityId: Amity.Community['communityId'], patch: Patch<Amity.Community, 'displayName' | 'avatarFileId' | 'description' | 'postSetting' | 'tags' | 'metadata' | 'isDiscoverable' | 'requiresJoinApproval'> & Amity.CommunityStorySettings) => Promise<Amity.Cached<Amity.Community>>;
|
|
16
|
+
export declare const updateCommunity: (communityId: Amity.Community['communityId'], patch: Patch<Amity.Community, 'displayName' | 'avatarFileId' | 'description' | 'postSetting' | 'tags' | 'metadata' | 'isDiscoverable' | 'requiresJoinApproval' | 'isPublic' | 'categoryIds'> & Amity.CommunityStorySettings) => Promise<Amity.Cached<Amity.Community>>;
|
|
17
17
|
//# sourceMappingURL=updateCommunity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateCommunity.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/api/updateCommunity.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,gBACb,MAAM,SAAS,CAAC,aAAa,CAAC,SACpC,MACL,MAAM,SAAS,EACb,aAAa,GACb,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"updateCommunity.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/api/updateCommunity.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,gBACb,MAAM,SAAS,CAAC,aAAa,CAAC,SACpC,MACL,MAAM,SAAS,EACb,aAAa,GACb,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,sBAAsB,GACtB,UAAU,GACV,aAAa,CAChB,GACC,MAAM,sBAAsB,KAC7B,QAAQ,MAAM,MAAM,CAAC,MAAM,SAAS,CAAC,CA2BvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateCommunity.js","sourceRoot":"","sources":["../../../src/communityRepository/api/updateCommunity.ts"],"names":[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/B,CAAC;IAEF,SAAS,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAExC,MAAM,IAAI,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAE9C,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IAC5C,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,aAAa,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClC,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;KAC3D;IAED,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE7B,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,SAAS,CAC1B,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,WAAW,KAAK,WAAW,CAAE,CACtE;QACD,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AACF,yBAAyB","sourcesContent":["import { getActiveClient } from '~/client/api';\n\nimport { ingestInCache } from '~/cache/api/ingestInCache';\nimport { fireEvent } from '~/core/events';\n\nimport { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';\nimport { prepareCommunityPayload, prepareCommunityRequest } from '../utils';\nimport { LinkedObject } from '~/utils/linkedObject';\n\n/* begin_public_function\n id: community.update\n*/\n/**\n * ```js\n * import { updateCommunity } from '@amityco/ts-sdk'\n * const updated = await updateCommunity(communityId, { displayName: 'foobar', isDiscoverable: true, requiresJoinApproval: false })\n * ```\n *\n * Updates an {@link Amity.Community}\n *\n * @param communityId The ID of the {@link Amity.Community} to edit\n * @param patch The patch data to apply\n * @returns the updated {@link Amity.Community} object\n *\n * @category Community API\n * @async\n */\nexport const updateCommunity = async (\n communityId: Amity.Community['communityId'],\n patch: Patch<\n Amity.Community,\n | 'displayName'\n | 'avatarFileId'\n | 'description'\n | 'postSetting'\n | 'tags'\n | 'metadata'\n | 'isDiscoverable'\n | 'requiresJoinApproval'\n | 'isPublic'\n | 'categoryIds'\n > &\n Amity.CommunityStorySettings,\n): Promise<Amity.Cached<Amity.Community>> => {\n const client = getActiveClient();\n client.log('community/updateCommunity', communityId, patch);\n\n const { data: payload } = await client.http.put<Amity.CommunityPayload>(\n `/api/v3/communities/${communityId}`,\n prepareCommunityRequest(patch),\n );\n\n fireEvent('community.updated', payload);\n\n const data = prepareCommunityPayload(payload);\n\n const cachedAt = client.cache && Date.now();\n if (client.cache) {\n ingestInCache(data, { cachedAt });\n saveCommunityUsers(data.communities, data.communityUsers);\n }\n\n const { communities } = data;\n\n return {\n data: LinkedObject.community(\n communities.find(community => community.communityId === communityId)!,\n ),\n cachedAt,\n };\n};\n/* end_public_function */\n"]}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
15
|
export declare const getFile: {
|
|
16
|
-
<T extends Amity.FileType = any>(fileId: Amity.File<
|
|
16
|
+
<T extends Amity.FileType = any>(fileId: Amity.File<any>['fileId']): Promise<Amity.Cached<Amity.File<T>>>;
|
|
17
17
|
/**
|
|
18
18
|
* ```js
|
|
19
19
|
* import { getFile } from '@amityco/ts-sdk-react-native'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/fileRepository/api/getFile.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/fileRepository/api/getFile.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO;6CACV,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IAoBnC;;;;;;;;;;;;OAYG;oBACwB,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS;CAhB1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/fileRepository/api/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;EAEE;AACF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAC1B,
|
|
1
|
+
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/fileRepository/api/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;EAEE;AACF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAC1B,MAAiC,EACK,EAAE;IACxC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAEnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,CAAuB,iBAAiB,MAAM,EAAE,CAAC,CAAC;IAExF,uDAAuD;IACvD,yBAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IAC5C,IAAI,MAAM,CAAC,KAAK;QAAE,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEjE,OAAO;QACL,IAAI;QACJ,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AACF,yBAAyB;AAEzB;;;;;;;;;;;;GAYG;AACH,OAAO,CAAC,OAAO,GAAG,CAAC,MAAiC,EAAwC,EAAE;IAC5F,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;IAE3C,IAAI,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO;IAE1B,MAAM,MAAM,GAAG,aAAa,CAAa,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAElE,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { getActiveClient } from '~/client/api';\n\nimport { pullFromCache } from '~/cache/api';\nimport { ingestInCache } from '~/cache/api/ingestInCache';\n\n/* begin_public_function\n id: file.get\n*/\n/**\n * ```js\n * import { getFile } from '@amityco/ts-sdk-react-native'\n * const file = await getFile('foo')\n * ```\n *\n * Fetches a {@link Amity.File} object\n *\n * @param fileId the ID of the {@link Amity.File} to fetch\n * @returns the associated {@link Amity.File} object\n *\n * @category File API\n * @async\n */\nexport const getFile = async <T extends Amity.FileType = any>(\n fileId: Amity.File<any>['fileId'],\n): Promise<Amity.Cached<Amity.File<T>>> => {\n const client = getActiveClient();\n client.log('file/getFile', fileId);\n\n const { data } = await client.http.get<Amity.FilePayload<T>>(`/api/v3/files/${fileId}`);\n\n // API-FIX: backend bad serializer issue. it should be:\n // const { files } = data\n\n const cachedAt = client.cache && Date.now();\n if (client.cache) ingestInCache({ files: [data] }, { cachedAt });\n\n return {\n data,\n cachedAt,\n };\n};\n/* end_public_function */\n\n/**\n * ```js\n * import { getFile } from '@amityco/ts-sdk-react-native'\n * const file = getFile.locally('foo')\n * ```\n *\n * Fetches a {@link Amity.File} object from cache\n *\n * @param fileId the ID of the {@link Amity.File} to fetch\n * @returns the associated {@link Amity.File} object\n *\n * @category File API\n */\ngetFile.locally = (fileId: Amity.File<any>['fileId']): Amity.Cached<Amity.File> | undefined => {\n const client = getActiveClient();\n client.log('file/getFile.locally', fileId);\n\n if (!client.cache) return;\n\n const cached = pullFromCache<Amity.File>(['file', 'get', fileId]);\n\n if (!cached) return;\n\n return {\n data: cached.data,\n cachedAt: cached.cachedAt,\n };\n};\n"]}
|