@kinevolution/appwrite-functions-shared-utils 0.1.6 → 0.1.8

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.
@@ -0,0 +1,79 @@
1
+ import type { Models } from 'appwrite';
2
+
3
+ // This file is auto-generated by the Appwrite CLI.
4
+ // You can regenerate it by running `appwrite types -l ts types`.
5
+
6
+ export enum Role {
7
+ REQUESTER = 'requester',
8
+ COMPANION = 'companion',
9
+ }
10
+
11
+ export enum Activities {
12
+ CHAT = 'chat',
13
+ WALK = 'walk',
14
+ GAMES = 'games',
15
+ HOME_HELP = 'home_help',
16
+ READING = 'reading',
17
+ SHOPPING = 'shopping',
18
+ }
19
+
20
+ export enum Sex {
21
+ FEMALE = 'female',
22
+ MALE = 'male',
23
+ PREFER_NOT_SAY = 'prefer_not_say',
24
+ OTHER = 'other',
25
+ }
26
+
27
+ export type ProfilesRequester = Models.Row & {
28
+ phone: string;
29
+ contactByPhone: boolean;
30
+ approxLocationLabel: string;
31
+ homeLocation: string;
32
+ notesForCompanions: string | null;
33
+ emergencyContactName: string | null;
34
+ emergencyContactPhone: string | null;
35
+ user: Roles;
36
+ };
37
+
38
+ export type ProfilesCompanion = Models.Row & {
39
+ hasVehicle: boolean;
40
+ ratingCount: number;
41
+ ratingAvg: number;
42
+ user: Roles;
43
+ };
44
+
45
+ export type CompanionZones = Models.Row & {
46
+ label: string;
47
+ priority: number;
48
+ active: boolean;
49
+ notes: string | null;
50
+ zone: string | null;
51
+ profilesCompanion: ProfilesCompanion;
52
+ center: string | null;
53
+ radius: number | null;
54
+ };
55
+
56
+ export type Roles = Models.Row & {
57
+ userId: string;
58
+ role: Role;
59
+ };
60
+
61
+ export type ProfilesExtras = Models.Row & {
62
+ user: Roles;
63
+ bio: string | null;
64
+ photoIds: string[] | null;
65
+ activities: Activities[] | null;
66
+ locale: string | null;
67
+ timezone: string | null;
68
+ marketingOptIn: boolean;
69
+ };
70
+
71
+ export type ProfilesCore = Models.Row & {
72
+ pushTokens: string[] | null;
73
+ termsAcceptedAt: string;
74
+ birthDate: string;
75
+ firstName: string;
76
+ lastName: string;
77
+ sex: Sex;
78
+ user: Roles;
79
+ };
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,12 @@
1
+ export declare const APPWRITE_TABLE_IDS: {
2
+ DATABASE_ID: string;
3
+ ROLES_TABLE_ID: string;
4
+ PROFILES_CORE_TABLE_ID: string;
5
+ PROFILES_EXTRAS_TABLE_ID: string;
6
+ PROFILES_REQUESTER_TABLE_ID: string;
7
+ PROFILES_COMPANION_TABLE_ID: string;
8
+ COMPANION_ZONES_TABLE_ID: string;
9
+ };
1
10
  export interface Config {
2
11
  method: Method;
3
12
  fields: Array<FieldDefinition>;
package/dist/utils.js CHANGED
@@ -1,3 +1,12 @@
1
+ export const APPWRITE_TABLE_IDS = {
2
+ DATABASE_ID: '68cd8148000f7e778732',
3
+ ROLES_TABLE_ID: 'roles',
4
+ PROFILES_CORE_TABLE_ID: 'profiles_core',
5
+ PROFILES_EXTRAS_TABLE_ID: 'profiles_extras',
6
+ PROFILES_REQUESTER_TABLE_ID: 'profiles_requester',
7
+ PROFILES_COMPANION_TABLE_ID: 'profiles_companion',
8
+ COMPANION_ZONES_TABLE_ID: 'companion_zones',
9
+ };
1
10
  /**
2
11
  * Validates the input of an Appwrite function based on the provided configuration
3
12
  * @param config - The configuration defining expected method and fields
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.6",
6
+ "version": "0.1.8",
7
7
  "license": "ISC",
8
8
  "author": "Nicolas Forêt <nicolas4@gmail.com>",
9
9
  "description": "Shared utilities for Appwrite functions",
@@ -13,14 +13,15 @@
13
13
  "types": "dist/utils.d.ts",
14
14
  "exports": {
15
15
  ".": "./dist/utils.js",
16
- "./utils": "./dist/utils.js"
16
+ "./utils": "./dist/utils.js",
17
+ "./appwrite": "./dist/appwrite.d.ts"
17
18
  },
18
19
  "files": [
19
20
  "dist"
20
21
  ],
21
22
  "scripts": {
22
23
  "bat-update": "cd .. && shared-update.bat",
23
- "build": "tsc -p tsconfig.json",
24
+ "build": "tsc -p tsconfig.json && powershell -Command \"Copy-Item appwrite.d.ts dist/appwrite.d.ts\"",
24
25
  "bump-version": "npm run bump-version:patch",
25
26
  "bump-version:major": "gulp bump-version --type=major",
26
27
  "bump-version:minor": "gulp bump-version --type=minor",