firestore-meilisearch 0.1.0 → 0.1.3-beta.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.
Files changed (66) hide show
  1. package/{functions/.eslintignore → .eslintignore} +0 -0
  2. package/{functions/.eslintrc.js → .eslintrc.js} +0 -0
  3. package/{functions/__tests__ → __tests__}/__mocks__/console.ts +0 -0
  4. package/{functions/__tests__ → __tests__}/adapter.test.ts +3 -3
  5. package/{functions/__tests__ → __tests__}/config.test.ts +0 -0
  6. package/{functions/__tests__ → __tests__}/data/document.ts +0 -0
  7. package/{functions/__tests__ → __tests__}/data/environment.ts +0 -0
  8. package/{functions/__tests__ → __tests__}/functions.test.ts +0 -0
  9. package/{functions/__tests__ → __tests__}/jest.setup.ts +0 -0
  10. package/{functions/__tests__ → __tests__}/test.types.d.ts +0 -0
  11. package/{functions/__tests__ → __tests__}/tsconfig.json +0 -0
  12. package/{functions/__tests__ → __tests__}/util.test.ts +0 -0
  13. package/{functions/jest.config.js → jest.config.js} +0 -0
  14. package/{functions/lib → lib}/adapter.js +2 -2
  15. package/{functions/lib → lib}/config.js +0 -0
  16. package/{functions/lib → lib}/import/config.js +0 -0
  17. package/{functions/lib → lib}/import/index.js +0 -0
  18. package/{functions/lib → lib}/index.js +0 -0
  19. package/{functions/lib → lib}/logs.js +0 -0
  20. package/{functions/lib → lib}/meilisearch/create-index.js +0 -0
  21. package/{functions/lib → lib}/meilisearch-index.js +0 -0
  22. package/{functions/lib → lib}/types.js +0 -0
  23. package/{functions/lib → lib}/util.js +0 -0
  24. package/{functions/lib → lib}/version.js +1 -1
  25. package/package.json +48 -17
  26. package/{functions/src → src}/adapter.ts +7 -11
  27. package/{functions/src → src}/config.ts +0 -0
  28. package/{functions/src → src}/import/config.ts +0 -0
  29. package/{functions/src → src}/import/index.ts +0 -0
  30. package/{functions/src → src}/index.ts +0 -0
  31. package/{functions/src → src}/logs.ts +0 -0
  32. package/{functions/src → src}/meilisearch/create-index.ts +0 -0
  33. package/{functions/src → src}/types.ts +0 -0
  34. package/{functions/src → src}/util.ts +0 -0
  35. package/src/version.ts +1 -0
  36. package/{functions/tsconfig.eslint.json → tsconfig.eslint.json} +0 -0
  37. package/{functions/tsconfig.json → tsconfig.json} +0 -0
  38. package/.editorconfig +0 -20
  39. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -26
  40. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -18
  41. package/.github/ISSUE_TEMPLATE/other.md +0 -7
  42. package/.github/dependatbot.yml +0 -23
  43. package/.github/release-draft-template.yml +0 -33
  44. package/.github/scripts/check-release.sh +0 -42
  45. package/.github/workflows/publish.yml +0 -30
  46. package/.github/workflows/release-drafter.yml +0 -16
  47. package/.github/workflows/test.yml +0 -42
  48. package/CHANGELOG.md +0 -3
  49. package/CONTRIBUTING.md +0 -236
  50. package/LICENSE +0 -201
  51. package/POSTINSTALL.md +0 -40
  52. package/PREINSTALL.md +0 -42
  53. package/README.md +0 -128
  54. package/bors.toml +0 -8
  55. package/dataset/firebase-export-metadata.json +0 -8
  56. package/dataset/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata +0 -0
  57. package/dataset/firestore_export/all_namespaces/all_kinds/output-0 +0 -0
  58. package/dataset/firestore_export/firestore_export.overall_export_metadata +0 -0
  59. package/extension.yaml +0 -176
  60. package/firebase.json +0 -20
  61. package/functions/package.json +0 -53
  62. package/functions/src/version.ts +0 -1
  63. package/functions/yarn.lock +0 -5306
  64. package/guides/IMPORT_EXISTING_DOCUMENTS.md +0 -74
  65. package/script/version.sh +0 -51
  66. package/test-params-example.env +0 -9
@@ -1,8 +0,0 @@
1
- {
2
- "version": "9.16.0",
3
- "firestore": {
4
- "version": "1.13.1",
5
- "path": "firestore_export",
6
- "metadata_file": "firestore_export/firestore_export.overall_export_metadata"
7
- }
8
- }
package/extension.yaml DELETED
@@ -1,176 +0,0 @@
1
- # Copyright 2022 Meilisearch
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- # Identifier for your extension
16
- name: firestore-meilisearch
17
-
18
- # Follow semver versioning
19
- version: 0.1.0
20
-
21
- # Version of the Firebase Extensions specification
22
- specVersion: v1beta
23
-
24
- # Friendly display name for your extension (~3-5 words)
25
- displayName: Search in your Firestore content with Meilisearch
26
-
27
- # Brief description of the task your extension performs (~1 sentence)
28
- description: >-
29
- Full-text Search on Firebase with Meilisearch
30
-
31
- license: Apache-2.0 # https://spdx.org/licenses/
32
-
33
- # Public URL for the source code of your extension
34
- sourceUrl: https://github.com/meilisearch/firestore-meilisearch
35
-
36
- releaseNotesUrl: https://github.com/meilisearch/firestore-meilisearch/releases
37
-
38
- author:
39
- authorName: Meilisearch
40
- email: bonjour@meilisearch.com
41
- url: https://meilisearch.com
42
-
43
- # Specify whether a paid-tier billing plan is required to use your extension.
44
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#billing-required-field
45
- billingRequired: true
46
-
47
- # In an `apis` field, list any Google APIs (like Cloud Translation, BigQuery, etc.)
48
- # required for your extension to operate.
49
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#apis-field
50
-
51
- # In a `roles` field, list any IAM access roles required for your extension to operate.
52
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#roles-field
53
-
54
- # In the `resources` field, list each of your extension's functions, including the trigger for each function.
55
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#resources-field
56
- resources:
57
- - name: indexingWorker
58
- type: firebaseextensions.v1beta.function
59
- description: >-
60
- Cloud function triggered by document modification in Firestore to import changes into Meilisearch.
61
- properties:
62
- # LOCATION is a user-configured parameter value specified by the user
63
- # during installation.
64
- location: ${LOCATION}
65
- runtime: nodejs14
66
- eventTrigger:
67
- eventType: providers/cloud.firestore/eventTypes/document.write
68
- resource: projects/${PROJECT_ID}/databases/(default)/documents/${COLLECTION_PATH}/{documentID}
69
-
70
- # In the `params` field, set up your extension's user-configured parameters.
71
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#params-field
72
- params:
73
- - param: LOCATION
74
- label: Cloud Functions location
75
- description: >-
76
- Where do you want to deploy the functions created for this extension?
77
- If you need help selecting a location, refer to the [location selection
78
- guide](https://firebase.google.com/docs/functions/locations).
79
- type: select
80
- options:
81
- - label: Iowa (us-central1)
82
- value: us-central1
83
- - label: South Carolina (us-east1)
84
- value: us-east1
85
- - label: Northern Virginia (us-east4)
86
- value: us-east4
87
- - label: Los Angeles (us-west2)
88
- value: us-west2
89
- - label: Salt Lake City (us-west3)
90
- value: us-west3
91
- - label: Las Vegas (us-west4)
92
- value: us-west4
93
- - label: Warsaw (europe-central2)
94
- value: europe-central2
95
- - label: Belgium (europe-west1)
96
- value: europe-west1
97
- - label: London (europe-west2)
98
- value: europe-west2
99
- - label: Frankfurt (europe-west3)
100
- value: europe-west3
101
- - label: Zurich (europe-west6)
102
- value: europe-west6
103
- - label: Hong Kong (asia-east2)
104
- value: asia-east2
105
- - label: Tokyo (asia-northeast1)
106
- value: asia-northeast1
107
- - label: Osaka (asia-northeast2)
108
- value: asia-northeast2
109
- - label: Seoul (asia-northeast3)
110
- value: asia-northeast3
111
- - label: Mumbai (asia-south1)
112
- value: asia-south1
113
- - label: Jakarta (asia-southeast2)
114
- value: asia-southeast2
115
- - label: Montreal (northamerica-northeast1)
116
- value: northamerica-northeast1
117
- - label: Sao Paulo (southamerica-east1)
118
- value: southamerica-east1
119
- - label: Sydney (australia-southeast1)
120
- value: australia-southeast1
121
- required: true
122
- immutable: true
123
-
124
- - param: COLLECTION_PATH
125
- label: Collection path
126
- description: >-
127
- What is the path of the collection you would like to export into Meilisearch?
128
- example: movies
129
- type: string
130
- validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
131
- validationErrorMessage: Must be a valid Cloud Firestore Collection.
132
- required: true
133
-
134
- - param: MEILISEARCH_FIELDS_TO_INDEX
135
- label: Fields to index in Meilisearch
136
- description: >-
137
- What fields do you want to index in Meilisearch?
138
- Create a comma-separated list of the field names, or leave it blank to include all fields.
139
- The id field is always indexed even when omitted from the list.
140
- default: ''
141
- example: title,overview,release_date
142
- validationRegex: "^[^,]?[a-zA-Z-_0-9,]*[^,]$"
143
- validationErrorMessage:
144
- Fields must be given through a comma-separated list.
145
- required: false
146
-
147
- - param: MEILISEARCH_INDEX_NAME
148
- label: Meilisearch Index Name
149
- description: >-
150
- What Meilisearch index do you want to index your data in?
151
- type: string
152
- example: movies
153
- validationRegex: "^[0-9A-Za-z_-]+$"
154
- validationErrorMessage: Must be a valid Index format.
155
- Index uid can be of type integer or string only composed of alphanumeric characters, hyphens (-) and underscores (_).
156
- Check out our guide on [index creation](https://docs.meilisearch.com/learn/core_concepts/indexes.html#index-creation).
157
- required: true
158
-
159
- - param: MEILISEARCH_HOST
160
- label: Meilisearch host
161
- description: >-
162
- What is the URL of the host of your Meilisearch database?
163
- Make sure your URL starts with `http://` or `https://`
164
- type: string
165
- example: 'http://127.0.0.1:7700'
166
- required: true
167
-
168
- - param: MEILISEARCH_API_KEY
169
- label: Meilisearch API key
170
- description: >-
171
- What is your Meilisearch API key with permission to perform actions on indexes?
172
- Both the API keys and the master key are valid choices but we strongly recommend using an API key for security purposes.
173
- Check out our guide on [security](https://docs.meilisearch.com/learn/security/master_api_keys.html).
174
- type: string
175
- example: 37778d5a6f5c39660c66c0f882dabedd55840f3a
176
- required: false
package/firebase.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "functions": {
3
- "predeploy": [
4
- "npm --prefix \"$RESOURCE_DIR\" run lint",
5
- "npm --prefix \"$RESOURCE_DIR\" run build"
6
- ],
7
- "source": "functions"
8
- },
9
- "emulators": {
10
- "functions": {
11
- "port": 5001
12
- },
13
- "firestore": {
14
- "port": 8080
15
- },
16
- "ui": {
17
- "enabled": true
18
- }
19
- }
20
- }
@@ -1,53 +0,0 @@
1
- {
2
- "name": "firestore-meilisearch",
3
- "version": "0.1.0",
4
- "scripts": {
5
- "lint": "eslint .",
6
- "lint:fix": "eslint . --fix",
7
- "build": "tsc",
8
- "watch": "tsc --watch",
9
- "playground": "nodemon ./lib/import --project 521120192778 --source-collection-path movies --index movies --batch-size 300 --non-interactive -H 'http://localhost:7700' -a masterKey",
10
- "serve": "yarn build && firebase emulators:start --only functions",
11
- "shell": "yarn build && firebase functions:shell",
12
- "start": "yarn shell",
13
- "deploy": "firebase deploy --only functions",
14
- "logs": "firebase functions:log",
15
- "test": "jest",
16
- "test:watch": "jest --watch",
17
- "test:coverage": "jest --coverage"
18
- },
19
- "engines": {
20
- "node": ">=14.0.0"
21
- },
22
- "main": "lib/index.js",
23
- "dependencies": {
24
- "firebase-admin": "^10.0.2",
25
- "firebase-functions": "^3.16.0",
26
- "meilisearch": "^0.25.0"
27
- },
28
- "devDependencies": {
29
- "@babel/preset-typescript": "^7.15.0",
30
- "@types/jest": "^27.0.2",
31
- "@typescript-eslint/eslint-plugin": "^4.32.0",
32
- "@typescript-eslint/parser": "^4.32.0",
33
- "commander": "^8.3.0",
34
- "eslint": "^7.6.0",
35
- "eslint-config-google": "^0.14.0",
36
- "eslint-config-prettier": "^8.3.0",
37
- "eslint-plugin-import": "^2.24.2",
38
- "eslint-plugin-jest": "^24.4.2",
39
- "eslint-plugin-prettier": "^4.0.0",
40
- "firebase-functions-test": "^0.3.2",
41
- "inquirer": "^8.2.0",
42
- "jest": "^27.2.2",
43
- "jest-mock": "^27.1.1",
44
- "js-yaml": "^4.1.0",
45
- "mocked-env": "^1.3.5",
46
- "prettier": "^2.4.1",
47
- "ts-jest": "^27.0.5",
48
- "ts-node": "^10.2.1",
49
- "typescript": "^4.4.3"
50
- },
51
- "private": true,
52
- "bin": "lib/import/index.js"
53
- }
@@ -1 +0,0 @@
1
- export const version = '0.1.0'