cozy-client 46.4.0 → 46.5.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/dist/CozyClient.js +1 -1
- package/dist/types.js +97 -0
- package/package.json +3 -3
- package/types/types.d.ts +239 -0
package/dist/CozyClient.js
CHANGED
|
@@ -2705,7 +2705,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2705
2705
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2706
2706
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2707
2707
|
|
|
2708
|
-
CozyClient.version = "46.
|
|
2708
|
+
CozyClient.version = "46.5.0";
|
|
2709
2709
|
|
|
2710
2710
|
_microee.default.mixin(CozyClient);
|
|
2711
2711
|
|
package/dist/types.js
CHANGED
|
@@ -431,6 +431,103 @@ var _dsl = require("./queries/dsl");
|
|
|
431
431
|
* @typedef {CozyClientDocument & OAuthClientDocument} IOCozyOAuthClient - An io.cozy.oauth.clients document
|
|
432
432
|
*/
|
|
433
433
|
|
|
434
|
+
/**
|
|
435
|
+
* @typedef {object} ContactName
|
|
436
|
+
* @property {string} [familyName] - The family name (example: "House")
|
|
437
|
+
* @property {string} [givenName] - The given name (example: "Gregory")
|
|
438
|
+
* @property {string} [additionalName] - The additional name (example: "J.")
|
|
439
|
+
* @property {string} [namePrefix] - The name prefix (example: "Dr.")
|
|
440
|
+
* @property {string} [nameSuffix] - The name suffix (example: "III")
|
|
441
|
+
*/
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @typedef {object} ContactEmail
|
|
445
|
+
* @property {string} address - Email address
|
|
446
|
+
* @property {string} [type] - A user-provided localized type of email address (example: "Work", "Home", "Other")
|
|
447
|
+
* @property {boolean} [primary] - Indicates a preferred-use address
|
|
448
|
+
*/
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @typedef {object} ContactExtendedAddress
|
|
452
|
+
* @property {string} [locality] - Locality name
|
|
453
|
+
* @property {string} [building] - Building number
|
|
454
|
+
* @property {string} [stairs] - Stairs number
|
|
455
|
+
* @property {string} [floor] - Apartment floor
|
|
456
|
+
* @property {string} [apartment] - Apartment number
|
|
457
|
+
* @property {string} [entrycode] - Entry code
|
|
458
|
+
*/
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @typedef {object} ContactGeo
|
|
462
|
+
* @property {Array<number>} [geo] - Coordinates of the address, must be [long, lat]
|
|
463
|
+
* @property {"home"|"work"} [cozyCategory] - The category of the address type
|
|
464
|
+
*/
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @typedef {object} ContactAddress
|
|
468
|
+
* @property {string} [id] - Id of the address
|
|
469
|
+
* @property {string} [street] - Street name
|
|
470
|
+
* @property {string} [pobox] - P.O Box number
|
|
471
|
+
* @property {string} [city] - City name
|
|
472
|
+
* @property {string} [region] - Region name
|
|
473
|
+
* @property {string} [number] - Lane number
|
|
474
|
+
* @property {string} [code] - Postal code
|
|
475
|
+
* @property {string} [country] - Country name
|
|
476
|
+
* @property {string} [type] - A user-provided localized type of address (example: "Work", "Home", "Other")
|
|
477
|
+
* @property {boolean} [primary] - Indicates a preferred-use address
|
|
478
|
+
* @property {ContactExtendedAddress} [extendedAddress]
|
|
479
|
+
* @property {string} [formattedAddress] - Unstructured version of the address
|
|
480
|
+
* @property {ContactGeo} [geo]
|
|
481
|
+
*/
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* @typedef {object} ContactPhone
|
|
485
|
+
* @property {string} number - Phone number
|
|
486
|
+
* @property {string} [type] - A user-provided localized type of phone number (example: "Work", "Home", "Other")
|
|
487
|
+
* @property {boolean} [primary] - Indicates a preferred-use number
|
|
488
|
+
*
|
|
489
|
+
*/
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @typedef {object} ContactCozy
|
|
493
|
+
* @property {string} url
|
|
494
|
+
* @property {string} [label] - A user-provided localized type of instance
|
|
495
|
+
* @property {boolean} [primary] - Indicates a preferred-use instance
|
|
496
|
+
*
|
|
497
|
+
*/
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* @typedef {object} ContactMetadata
|
|
501
|
+
* @property {boolean} cozy - Whether the contact has been created by cozy
|
|
502
|
+
* @property {object} google - Google metadata
|
|
503
|
+
* @property {number} version - Used for migrations. Current version is 1
|
|
504
|
+
*
|
|
505
|
+
*/
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* @typedef {object} ContactDocument
|
|
509
|
+
* @property {object} indexes - Used to sort contacts in different ways
|
|
510
|
+
* @property {string} indexes.byFamilyNameGivenNameEmailCozyUrl - Index for sorting
|
|
511
|
+
* @property {string} displayName - Displayed name in cozy applications
|
|
512
|
+
* @property {string} [fullname] - Unstructured representation of the name (example: "Dr. Gregory House, M.D.")
|
|
513
|
+
* @property {ContactName} [name] - Structured representation of the name
|
|
514
|
+
* @property {string} [birthday] - Birthday (example: "1959-05-15")
|
|
515
|
+
* @property {string} [note] - Note
|
|
516
|
+
* @property {Array<ContactEmail>} [email] - Email addresses
|
|
517
|
+
* @property {Array<ContactAddress>} [address] - Addresses
|
|
518
|
+
* @property {Array<ContactPhone>} [phone] - Phone numbers
|
|
519
|
+
* @property {Array<ContactCozy>} [cozy] - Cozy instances
|
|
520
|
+
* @property {string} company - Company
|
|
521
|
+
* @property {string} jobTitle - Job title
|
|
522
|
+
* @property {boolean} [trashed] - true if the contact is marked for removal and will be deleted soon (e.g. after remote deletion is confirmed)
|
|
523
|
+
* @property {boolean} me - Whether the contact matches the cozy owner (defaults to false)
|
|
524
|
+
* @property {Array<string>} [nationalities] - 2-letter iso3166 country codes (can be set in io.cozy.identities for legal reasons in Banks)
|
|
525
|
+
* @property {string} [birthcity] - City of birth of a contact (can be set in io.cozy.identities for legal reasons in Banks)
|
|
526
|
+
* @property {string} [birthcountry] - Country of birth of a contact (can be set in io.cozy.identities for legal reasons in Banks)
|
|
527
|
+
* @property {ContactMetadata} metadata - Previous metadata information
|
|
528
|
+
* @typedef {CozyClientDocument & ContactDocument} IOCozyContact - An io.cozy.contacts document
|
|
529
|
+
*/
|
|
530
|
+
|
|
434
531
|
/**
|
|
435
532
|
* @typedef {object} ClientError
|
|
436
533
|
* @property {string} [status]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@types/jest": "^26.0.20",
|
|
19
19
|
"@types/lodash": "^4.14.170",
|
|
20
20
|
"btoa": "^1.2.1",
|
|
21
|
-
"cozy-stack-client": "^46.
|
|
21
|
+
"cozy-stack-client": "^46.5.0",
|
|
22
22
|
"date-fns": "2.29.3",
|
|
23
23
|
"json-stable-stringify": "^1.0.1",
|
|
24
24
|
"lodash": "^4.17.13",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
|
|
76
76
|
},
|
|
77
77
|
"sideEffects": false,
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "d6a21c0a61f2f2f37133b12c0c82593779d2f90b"
|
|
79
79
|
}
|
package/types/types.d.ts
CHANGED
|
@@ -801,6 +801,245 @@ export type OAuthClientDocument = {
|
|
|
801
801
|
* - An io.cozy.oauth.clients document
|
|
802
802
|
*/
|
|
803
803
|
export type IOCozyOAuthClient = CozyClientDocument & OAuthClientDocument;
|
|
804
|
+
export type ContactName = {
|
|
805
|
+
/**
|
|
806
|
+
* - The family name (example: "House")
|
|
807
|
+
*/
|
|
808
|
+
familyName?: string;
|
|
809
|
+
/**
|
|
810
|
+
* - The given name (example: "Gregory")
|
|
811
|
+
*/
|
|
812
|
+
givenName?: string;
|
|
813
|
+
/**
|
|
814
|
+
* - The additional name (example: "J.")
|
|
815
|
+
*/
|
|
816
|
+
additionalName?: string;
|
|
817
|
+
/**
|
|
818
|
+
* - The name prefix (example: "Dr.")
|
|
819
|
+
*/
|
|
820
|
+
namePrefix?: string;
|
|
821
|
+
/**
|
|
822
|
+
* - The name suffix (example: "III")
|
|
823
|
+
*/
|
|
824
|
+
nameSuffix?: string;
|
|
825
|
+
};
|
|
826
|
+
export type ContactEmail = {
|
|
827
|
+
/**
|
|
828
|
+
* - Email address
|
|
829
|
+
*/
|
|
830
|
+
address: string;
|
|
831
|
+
/**
|
|
832
|
+
* - A user-provided localized type of email address (example: "Work", "Home", "Other")
|
|
833
|
+
*/
|
|
834
|
+
type?: string;
|
|
835
|
+
/**
|
|
836
|
+
* - Indicates a preferred-use address
|
|
837
|
+
*/
|
|
838
|
+
primary?: boolean;
|
|
839
|
+
};
|
|
840
|
+
export type ContactExtendedAddress = {
|
|
841
|
+
/**
|
|
842
|
+
* - Locality name
|
|
843
|
+
*/
|
|
844
|
+
locality?: string;
|
|
845
|
+
/**
|
|
846
|
+
* - Building number
|
|
847
|
+
*/
|
|
848
|
+
building?: string;
|
|
849
|
+
/**
|
|
850
|
+
* - Stairs number
|
|
851
|
+
*/
|
|
852
|
+
stairs?: string;
|
|
853
|
+
/**
|
|
854
|
+
* - Apartment floor
|
|
855
|
+
*/
|
|
856
|
+
floor?: string;
|
|
857
|
+
/**
|
|
858
|
+
* - Apartment number
|
|
859
|
+
*/
|
|
860
|
+
apartment?: string;
|
|
861
|
+
/**
|
|
862
|
+
* - Entry code
|
|
863
|
+
*/
|
|
864
|
+
entrycode?: string;
|
|
865
|
+
};
|
|
866
|
+
export type ContactGeo = {
|
|
867
|
+
/**
|
|
868
|
+
* - Coordinates of the address, must be [long, lat]
|
|
869
|
+
*/
|
|
870
|
+
geo?: Array<number>;
|
|
871
|
+
/**
|
|
872
|
+
* - The category of the address type
|
|
873
|
+
*/
|
|
874
|
+
cozyCategory?: "home" | "work";
|
|
875
|
+
};
|
|
876
|
+
export type ContactAddress = {
|
|
877
|
+
/**
|
|
878
|
+
* - Id of the address
|
|
879
|
+
*/
|
|
880
|
+
id?: string;
|
|
881
|
+
/**
|
|
882
|
+
* - Street name
|
|
883
|
+
*/
|
|
884
|
+
street?: string;
|
|
885
|
+
/**
|
|
886
|
+
* - P.O Box number
|
|
887
|
+
*/
|
|
888
|
+
pobox?: string;
|
|
889
|
+
/**
|
|
890
|
+
* - City name
|
|
891
|
+
*/
|
|
892
|
+
city?: string;
|
|
893
|
+
/**
|
|
894
|
+
* - Region name
|
|
895
|
+
*/
|
|
896
|
+
region?: string;
|
|
897
|
+
/**
|
|
898
|
+
* - Lane number
|
|
899
|
+
*/
|
|
900
|
+
number?: string;
|
|
901
|
+
/**
|
|
902
|
+
* - Postal code
|
|
903
|
+
*/
|
|
904
|
+
code?: string;
|
|
905
|
+
/**
|
|
906
|
+
* - Country name
|
|
907
|
+
*/
|
|
908
|
+
country?: string;
|
|
909
|
+
/**
|
|
910
|
+
* - A user-provided localized type of address (example: "Work", "Home", "Other")
|
|
911
|
+
*/
|
|
912
|
+
type?: string;
|
|
913
|
+
/**
|
|
914
|
+
* - Indicates a preferred-use address
|
|
915
|
+
*/
|
|
916
|
+
primary?: boolean;
|
|
917
|
+
extendedAddress?: ContactExtendedAddress;
|
|
918
|
+
/**
|
|
919
|
+
* - Unstructured version of the address
|
|
920
|
+
*/
|
|
921
|
+
formattedAddress?: string;
|
|
922
|
+
geo?: ContactGeo;
|
|
923
|
+
};
|
|
924
|
+
export type ContactPhone = {
|
|
925
|
+
/**
|
|
926
|
+
* - Phone number
|
|
927
|
+
*/
|
|
928
|
+
number: string;
|
|
929
|
+
/**
|
|
930
|
+
* - A user-provided localized type of phone number (example: "Work", "Home", "Other")
|
|
931
|
+
*/
|
|
932
|
+
type?: string;
|
|
933
|
+
/**
|
|
934
|
+
* - Indicates a preferred-use number
|
|
935
|
+
*/
|
|
936
|
+
primary?: boolean;
|
|
937
|
+
};
|
|
938
|
+
export type ContactCozy = {
|
|
939
|
+
url: string;
|
|
940
|
+
/**
|
|
941
|
+
* - A user-provided localized type of instance
|
|
942
|
+
*/
|
|
943
|
+
label?: string;
|
|
944
|
+
/**
|
|
945
|
+
* - Indicates a preferred-use instance
|
|
946
|
+
*/
|
|
947
|
+
primary?: boolean;
|
|
948
|
+
};
|
|
949
|
+
export type ContactMetadata = {
|
|
950
|
+
/**
|
|
951
|
+
* - Whether the contact has been created by cozy
|
|
952
|
+
*/
|
|
953
|
+
cozy: boolean;
|
|
954
|
+
/**
|
|
955
|
+
* - Google metadata
|
|
956
|
+
*/
|
|
957
|
+
google: object;
|
|
958
|
+
/**
|
|
959
|
+
* - Used for migrations. Current version is 1
|
|
960
|
+
*/
|
|
961
|
+
version: number;
|
|
962
|
+
};
|
|
963
|
+
export type ContactDocument = {
|
|
964
|
+
/**
|
|
965
|
+
* - Used to sort contacts in different ways
|
|
966
|
+
*/
|
|
967
|
+
indexes: {
|
|
968
|
+
byFamilyNameGivenNameEmailCozyUrl: string;
|
|
969
|
+
};
|
|
970
|
+
/**
|
|
971
|
+
* - Displayed name in cozy applications
|
|
972
|
+
*/
|
|
973
|
+
displayName: string;
|
|
974
|
+
/**
|
|
975
|
+
* - Unstructured representation of the name (example: "Dr. Gregory House, M.D.")
|
|
976
|
+
*/
|
|
977
|
+
fullname?: string;
|
|
978
|
+
/**
|
|
979
|
+
* - Structured representation of the name
|
|
980
|
+
*/
|
|
981
|
+
name?: ContactName;
|
|
982
|
+
/**
|
|
983
|
+
* - Birthday (example: "1959-05-15")
|
|
984
|
+
*/
|
|
985
|
+
birthday?: string;
|
|
986
|
+
/**
|
|
987
|
+
* - Note
|
|
988
|
+
*/
|
|
989
|
+
note?: string;
|
|
990
|
+
/**
|
|
991
|
+
* - Email addresses
|
|
992
|
+
*/
|
|
993
|
+
email?: Array<ContactEmail>;
|
|
994
|
+
/**
|
|
995
|
+
* - Addresses
|
|
996
|
+
*/
|
|
997
|
+
address?: Array<ContactAddress>;
|
|
998
|
+
/**
|
|
999
|
+
* - Phone numbers
|
|
1000
|
+
*/
|
|
1001
|
+
phone?: Array<ContactPhone>;
|
|
1002
|
+
/**
|
|
1003
|
+
* - Cozy instances
|
|
1004
|
+
*/
|
|
1005
|
+
cozy?: Array<ContactCozy>;
|
|
1006
|
+
/**
|
|
1007
|
+
* - Company
|
|
1008
|
+
*/
|
|
1009
|
+
company: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* - Job title
|
|
1012
|
+
*/
|
|
1013
|
+
jobTitle: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* - true if the contact is marked for removal and will be deleted soon (e.g. after remote deletion is confirmed)
|
|
1016
|
+
*/
|
|
1017
|
+
trashed?: boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* - Whether the contact matches the cozy owner (defaults to false)
|
|
1020
|
+
*/
|
|
1021
|
+
me: boolean;
|
|
1022
|
+
/**
|
|
1023
|
+
* - 2-letter iso3166 country codes (can be set in io.cozy.identities for legal reasons in Banks)
|
|
1024
|
+
*/
|
|
1025
|
+
nationalities?: Array<string>;
|
|
1026
|
+
/**
|
|
1027
|
+
* - City of birth of a contact (can be set in io.cozy.identities for legal reasons in Banks)
|
|
1028
|
+
*/
|
|
1029
|
+
birthcity?: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* - Country of birth of a contact (can be set in io.cozy.identities for legal reasons in Banks)
|
|
1032
|
+
*/
|
|
1033
|
+
birthcountry?: string;
|
|
1034
|
+
/**
|
|
1035
|
+
* - Previous metadata information
|
|
1036
|
+
*/
|
|
1037
|
+
metadata: ContactMetadata;
|
|
1038
|
+
};
|
|
1039
|
+
/**
|
|
1040
|
+
* - An io.cozy.contacts document
|
|
1041
|
+
*/
|
|
1042
|
+
export type IOCozyContact = CozyClientDocument & ContactDocument;
|
|
804
1043
|
export type ClientError = {
|
|
805
1044
|
status?: string;
|
|
806
1045
|
};
|